ia64/xen-unstable

changeset 3897:edd47d0137fa

bitkeeper revision 1.1159.258.8 (421bc0b0jvILWAafCXfC9uUwrkZb3A)

Clean up task-switch path. Now differs more from native code, but
it is a critical path. Also fixed a comment and FPU TS setting.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@scramble.cl.cam.ac.uk
date Tue Feb 22 23:30:56 2005 +0000 (2005-02-22)
parents 606f04db7033
children 3d81ec6a75cd ac1ea7e64ac3
files linux-2.6.10-xen-sparse/arch/xen/i386/kernel/process.c
line diff
     1.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/process.c	Tue Feb 22 09:36:11 2005 +0000
     1.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/process.c	Tue Feb 22 23:30:56 2005 +0000
     1.3 @@ -481,11 +481,8 @@ struct task_struct fastcall * __switch_t
     1.4  	asm volatile("movl %%gs,%0":"=m" (*(int *)&prev->gs));
     1.5  
     1.6  	/*
     1.7 -	 * We clobber FS and GS here so that we avoid a GPF when
     1.8 -	 * restoring previous task's FS/GS values in Xen when the LDT
     1.9 -	 * is switched. If we don't do this then we can end up
    1.10 -	 * erroneously re-flushing the page-update queue when we
    1.11 -	 * 'execute_multicall_list'.
    1.12 +	 * We clobber FS and GS here so that we avoid a GPF when restoring
    1.13 +	 * previous task's FS/GS values in Xen when the LDT is switched.
    1.14  	 */
    1.15  	__asm__ __volatile__ ( 
    1.16  		"xorl %%eax,%%eax; movl %%eax,%%fs; movl %%eax,%%gs" : : :
    1.17 @@ -501,7 +498,7 @@ struct task_struct fastcall * __switch_t
    1.18  	 * synchronously trapping to Xen.
    1.19  	 */
    1.20  	if (prev_p->thread_info->status & TS_USEDFPU) {
    1.21 -		save_init_fpu(prev_p);
    1.22 +		__save_init_fpu(prev_p); /* _not_ save_init_fpu() */
    1.23  		queue_multicall0(__HYPERVISOR_fpu_taskswitch);
    1.24  	}
    1.25  
    1.26 @@ -510,12 +507,6 @@ struct task_struct fastcall * __switch_t
    1.27  	 * This is load_esp0(tss, next) with a multicall.
    1.28  	 */
    1.29  	tss->esp0 = next->esp0;
    1.30 -	/* This can only happen when SEP is enabled, no need to test
    1.31 -	 * "SEP"arately */
    1.32 -	if (unlikely(tss->ss1 != next->sysenter_cs)) {
    1.33 -		tss->ss1 = next->sysenter_cs;
    1.34 -		wrmsr(MSR_IA32_SYSENTER_CS, next->sysenter_cs, 0);
    1.35 -	}
    1.36  	queue_multicall2(__HYPERVISOR_stack_switch, tss->ss0, tss->esp0);
    1.37  
    1.38  	/*
    1.39 @@ -549,7 +540,7 @@ struct task_struct fastcall * __switch_t
    1.40  	/*
    1.41  	 * Restore %fs and %gs if needed.
    1.42  	 */
    1.43 -	if (unlikely(prev->fs | prev->gs | next->fs | next->gs)) {
    1.44 +	if (unlikely(next->fs | next->gs)) {
    1.45  		loadsegment(fs, next->fs);
    1.46  		loadsegment(gs, next->gs);
    1.47  	}