[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH][SVM] Fix 32bit Windows guest VMs save/restore


  • To: <wei.huang2@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <keir@xxxxxxx>
  • Date: Mon, 31 Jan 2011 22:13:28 +0100
  • Cc: james.harper@xxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 31 Jan 2011 13:14:42 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=V8kI5yOlwyDGJjy+1Ehe6a4MW3aLGw4D7AT4+2bWIUJ++dQhBxO63AIEpVCV43eptt gB2u6/vihgqT3gKoCAkTK9gb0IY6TU4Y+UbXpSrxnTonR7dnM0fSih4BuxQ+bVda+RdM u1vXW+ltbwXTpuLo4rwCn6UayXEB0liwdJimM=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcvBi7RQhJ+1CeXoA0aavUh0h3YWNg==
  • Thread-topic: [Xen-devel] [PATCH][SVM] Fix 32bit Windows guest VMs save/restore

On 31/01/2011 18:33, "Wei Huang" <wei.huang2@xxxxxxx> wrote:

> The attached patch fixes the save/restore issue seen with 32bit Windows
> guest VMs. The root cause is that current Xen doesn't intercept
> SYSENTER-related MSRs for 32bit guest VMs. As a result, the
> guest_sysenter_xxx fields contain incorrect values and shouldn't be used
> for save/restore. This patch checks the LMA bit of EFER register in the
> save/restore code path.
>
> Please apply it to both Xen-4.0 and Xen-unstable trees.
> 
> Reported-by: James Harper <james.harper@xxxxxxxxxxxxxxxx>
> Signed-off-by: Wei Huang <wei.huang2@xxxxxxx>
> Acked-by: Christoph Egger <christoph.egger@xxxxxxx>

Nacked-by: Keir Fraser <keir@xxxxxxx>

This handling of the SYSENTER MSRs is overly complicated. I suggest
reverting a bunch of the original handling of cross-vendor migration as
follows:
 * Never intercept the SYSENTER MSRs.
 * Remove the vcpu->arch.hvm_svm.guest_sysenter_* fields.
 * Always hvm save/restore from/to the values in the vmcb.
 * Modify svm_msr_read_intercept(MSR_IA32_SYSENTER_*) to svm_sync_vmcb() and
then read the sysenter msr value from vmcb
 * Modify svm_msr_write_intercept(MSR_IA32_SYSENTER_*) to svm_sync_vmcb(),
then modify the sysenter msr in the vmcb, and then svm_vmload().

Result is that we get rid of some redundant fields from the vcpu structure
and have one canonical place we always keep the sysenter msr values, in the
vmcb. The extra cost in the msr read/write functions is totally
inconsequential, and only used after guest migration from an Intel CPU
anyway. Hardly something to optimise for.

 -- Keir

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.