X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fi386%2Fkernel%2Fprocess-xen.c;fp=arch%2Fi386%2Fkernel%2Fprocess-xen.c;h=6cad288d53a80a1344ec3dca57dee16166ad4edf;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=0c2fdcc1912eddc269511cd429c42cea3545a121;hpb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;p=linux-2.6.git diff --git a/arch/i386/kernel/process-xen.c b/arch/i386/kernel/process-xen.c index 0c2fdcc19..6cad288d5 100644 --- a/arch/i386/kernel/process-xen.c +++ b/arch/i386/kernel/process-xen.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -61,9 +60,6 @@ #include #include -#include -#include - asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); static int hlt_counter; @@ -108,10 +104,10 @@ void xen_idle(void) if (need_resched()) local_irq_enable(); else { - clear_thread_flag(TIF_POLLING_NRFLAG); + current_thread_info()->status &= ~TS_POLLING; smp_mb__after_clear_bit(); safe_halt(); - set_thread_flag(TIF_POLLING_NRFLAG); + current_thread_info()->status |= TS_POLLING; } } #ifdef CONFIG_APM_MODULE @@ -146,7 +142,8 @@ void cpu_idle(void) { int cpu = smp_processor_id(); - set_thread_flag(TIF_POLLING_NRFLAG); + current_thread_info()->status |= TS_POLLING; + /* endless idle loop with no priority at all */ while (1) { @@ -228,7 +225,7 @@ void show_regs(struct pt_regs * regs) cr3 = read_cr3(); cr4 = read_cr4_safe(); printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", cr0, cr2, cr3, cr4); - show_trace(NULL, ®s->esp); + show_trace(NULL, regs, ®s->esp); } /* @@ -276,15 +273,16 @@ EXPORT_SYMBOL(kernel_thread); */ void exit_thread(void) { - struct task_struct *tsk = current; - struct thread_struct *t = &tsk->thread; - /* The process may have allocated an io port bitmap... nuke it. */ - if (unlikely(NULL != t->io_bitmap_ptr)) { + if (unlikely(test_thread_flag(TIF_IO_BITMAP))) { + struct task_struct *tsk = current; + struct thread_struct *t = &tsk->thread; + struct physdev_set_iobitmap set_iobitmap = { 0 }; HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &set_iobitmap); kfree(t->io_bitmap_ptr); t->io_bitmap_ptr = NULL; + clear_thread_flag(TIF_IO_BITMAP); } } @@ -294,6 +292,7 @@ void flush_thread(void) memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8); memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); + clear_tsk_thread_flag(tsk, TIF_DEBUG); /* * Forget coprocessor state.. */ @@ -338,7 +337,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp, savesegment(gs,p->thread.gs); tsk = current; - if (unlikely(NULL != tsk->thread.io_bitmap_ptr)) { + 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; @@ -346,6 +345,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp, } memcpy(p->thread.io_bitmap_ptr, tsk->thread.io_bitmap_ptr, IO_BITMAP_BYTES); + set_tsk_thread_flag(p, TIF_IO_BITMAP); } /* @@ -524,6 +524,7 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas #if 0 /* lazy fpu sanity check */ else BUG_ON(!(read_cr0() & 8)); #endif + if (next_p->mm) load_user_cs_desc(cpu, next_p->mm); @@ -654,9 +655,6 @@ asmlinkage int sys_execve(struct pt_regs regs) (char __user * __user *) regs.edx, ®s); if (error == 0) { - task_lock(current); - current->ptrace &= ~PT_DTRACE; - task_unlock(current); /* Make sure we don't return using sysenter.. */ set_thread_flag(TIF_IRET); } @@ -825,6 +823,7 @@ void arch_add_exec_range(struct mm_struct *mm, unsigned long limit) } } } + void arch_remove_exec_range(struct mm_struct *mm, unsigned long old_end) { struct vm_area_struct *vma;