lkml.org 
[lkml]   [2014]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH v4 06/10] x86: process: Introduce helper to clear a thread's IO bitmap
    This will make it easier to make the io_bitmap_ptr field optional later.

    Signed-off-by: Josh Triplett <josh@joshtriplett.org>
    ---
    arch/x86/kernel/process-io.h | 5 +++++
    arch/x86/kernel/process_32.c | 4 ++--
    arch/x86/kernel/process_64.c | 2 +-
    3 files changed, 8 insertions(+), 3 deletions(-)

    diff --git a/arch/x86/kernel/process-io.h b/arch/x86/kernel/process-io.h
    index d884444..ffa65e8 100644
    --- a/arch/x86/kernel/process-io.h
    +++ b/arch/x86/kernel/process-io.h
    @@ -1,6 +1,11 @@
    #ifndef _X86_KERNEL_PROCESS_IO_H
    #define _X86_KERNEL_PROCESS_IO_H

    +static inline void clear_thread_io_bitmap(struct task_struct *p)
    +{
    + p->thread.io_bitmap_ptr = NULL;
    +}
    +
    static inline int copy_io_bitmap(struct task_struct *me,
    struct task_struct *p)
    {
    diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
    index 07550ff..b55f78e 100644
    --- a/arch/x86/kernel/process_32.c
    +++ b/arch/x86/kernel/process_32.c
    @@ -154,7 +154,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
    childregs->orig_ax = -1;
    childregs->cs = __KERNEL_CS | get_kernel_rpl();
    childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_FIXED;
    - p->thread.io_bitmap_ptr = NULL;
    + clear_thread_io_bitmap(p);
    return 0;
    }
    *childregs = *current_pt_regs();
    @@ -165,7 +165,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
    p->thread.ip = (unsigned long) ret_from_fork;
    task_user_gs(p) = get_user_gs(current_pt_regs());

    - p->thread.io_bitmap_ptr = NULL;
    + clear_thread_io_bitmap(p);
    tsk = current;

    /*
    diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
    index b1babb4..d18f3fc 100644
    --- a/arch/x86/kernel/process_64.c
    +++ b/arch/x86/kernel/process_64.c
    @@ -164,7 +164,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
    p->thread.sp = (unsigned long) childregs;
    p->thread.usersp = me->thread.usersp;
    set_tsk_thread_flag(p, TIF_FORK);
    - p->thread.io_bitmap_ptr = NULL;
    + clear_thread_io_bitmap(p);

    savesegment(gs, p->thread.gsindex);
    p->thread.gs = p->thread.gsindex ? 0 : me->thread.gs;
    --
    2.1.1


    \
     
     \ /
      Last update: 2014-11-02 18:41    [W:3.966 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site