Re: [PATCH] i386 TIF flags for debug regs and io bitmap in ctxsw (v2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


In-Reply-To: <[email protected]>

On Mon, 24 Jul 2006 22:54:39 -0700, Stephane Eranian wrote:
> I would like to follow-up the TIF flags and especially on the
> rules of inheritance. It appears the TIF flags are copied from
> parent to child task systematically on copy_process.
> Then they are adjusted in copy_threads() or sub-functions.
> The TIF_IO_BITMAP is checked in copy_threads() with the following code:
> int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
>       unsigned long unused,
>       struct task_struct * p, struct pt_regs * regs)
> {
>       ....
>       if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) {
>               p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL);
>               if (!p->thread.io_bitmap_ptr) {
>                       p->thread.io_bitmap_max = 0;
>                       return -ENOMEM;
>               }
>               memcpy(p->thread.io_bitmap_ptr, tsk->thread.io_bitmap_ptr,
>                       IO_BITMAP_BYTES);
>               set_tsk_thread_flag(p, TIF_IO_BITMAP);
>       }
> I would think that the set_tsk_thread_flag() is extraneous.

Yeah.  But harmless.

> As for TIF_DEBUG, my patch is not clearing it. I don't think you can
> have HW breakpoints be inherited from one task to the other.

Looks like the debug regs get copied on fork and only cleared on exec
in flush_thread().  So this should be OK.  Please doublecheck.

(The new TIF_DEBUG flag went into 2.8.18-rc, in case you didn't notice.)


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at
Please read the FAQ at

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux