Fix 64bit VMX guest crashing SMP x86_64 dom0
Quoted 18 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Keir Fraser
Sent: Saturday, February 18, 2006 12:35 AM
To: Li, Xin B
Cc: [email protected]
Subject: Re: [Xen-devel] [patch] Fix 64bit VMX guest crashing SMPx86_64dom0Quoted 4 lines · Xin B
Fix 64bit VMX guest crashing SMP
x86_64dom0.
We found creating 64bit VMX guest on SMPx86_64dom0 will crash the system, and this is introduced when merging with the HVM tree.
Quoted 6 lines
Quoted 2 lines
Signed-off-by Yunhong Jiang <[email protected]>Signed-off-by Xin Li <[email protected]>I've applied a more extensive patch that moves the calls to hvm_load_msrs/hvm_restore_msrs into
__context_switch(). Hopefully it isn't broken! :-) The changeset is 8871.
Yes, it works well :)
Quoted 8 lines
Looking at that area of the code, I wonder whether HVM guests need to be calling
save_segments()at all, since segment info is automatically saved into the VMCS on vmexit? Even thehvm_save_segments()call seems unnecessary -- all it does is save the contents of theSHADOW_GSMSR, but you keep a shadow copy of that MSR which you update every time the guest writes to the MSR, so surely that is not necessary? Can you try testingx86_64with the call tosave_segments()made conditional on !HVM_DOMAIN(p)?
For SHADOW_GS MSR, it need to be kept for swapgs, which may change the SHADOW GS MSR without causing vmexit. So we have to save the SHADOW_GS MSR on each context_switch.
Agree with you that HVM domain need not save_segments(), we try it on x86_64 and it works.
Attached is the patch
Thanks
Yunhong Jiang
Quoted 10 lines
Thanks,
Keir_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
xen/arch/x86/domain.c +5 -5
@@ -610,9 +610,6 @@struct cpu_user_regs *regs = &ctxt->user_regs;unsigned int dirty_segment_mask =0 ; -if (HVM_DOMAIN (v) ) -hvm_save_segments (v); - regs->ds =read_segment_register (ds); regs->es =read_segment_register (es); regs->fs =read_segment_register (fs);
@@ -682,9 +679,12 @@ stack_regs, CTXT_SWITCH_STACK_BYTES);unlazy_fpu (p); -save_segments (p); -if (HVM_DOMAIN (p) ) +if (!HVM_DOMAIN (p)) +save_segments (p); +else { +hvm_save_segments (p);hvm_load_msrs (); + } }if ( !is_idle_vcpu (n) )
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel