WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: x86_64 SMP support (status update)


On 27 Jun 2005, at 23:15, Nakajima, Jun wrote:

The nptl01 runs fine on dom0 as long as it
runs _alone_. It starts failing with presence of domUs. I feel this
implies some problems with GDT switching. Is there any race you think of
where modifications to GDT (done by do_update_descriptor) are not be
visible or deferred?

Actually, the bug is in XenLinux. You need to save DS-GS (and possibly also clear each one, if it is not already zero) before switching CR3 in switch_mm. We use prepare_arch_switch() hook in include/asm-xen/asm-i386/mmu_context.h for this purpose (although on i386 we only need to save/clear FS-GS at that point).

What is currently happening is that a domain ctxt switch is happening after switch_mm but before __switch_to. So when Xen switches back to your test domain, it tries to load old process's FS value and fails -- traps up to XenLinux which sets FS to zero. So you end up saving FS==0 for the nptl process and next time XenLinux switches to it you are toast. :-)

Solution:
Move segment save/clear to prepare_arch_switch. Remove segment save from __switch_to. If you choose to clear segment registers in prepare_arch_switch, remove the test of prev->{ds,es,fs,gs} from segment reload tests.

 -- Keir


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel