From: Christoph Egger Date: Thu, 13 Oct 2011 11:21:10 +0000 (+0100) Subject: nestedsvm: fix checks of guest writes to HSAVE_PA MSR X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e2f608687690c28fba52eb78cede62e516b1d26d;p=xen.git nestedsvm: fix checks of guest writes to HSAVE_PA MSR Accessing HSAVE_PA MSR does not require SVM to be enabled nor any special guest paging mode. But accessing HSAVE_PA MSR requires the address to be 4k aligned. Signed-off-by: Christoph Egger Acked-by: Tim Deegan Committed-by: Tim Deegan --- diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c index bbd8866c1d..f7fae0da78 100644 --- a/xen/arch/x86/hvm/svm/nestedsvm.c +++ b/xen/arch/x86/hvm/svm/nestedsvm.c @@ -51,7 +51,8 @@ nestedsvm_vcpu_stgi(struct vcpu *v) static int nestedsvm_vmcb_isvalid(struct vcpu *v, uint64_t vmcxaddr) { - if ( !hvm_svm_enabled(v) || hvm_guest_x86_mode(v) < 2 ) + /* Address must be 4k aligned */ + if ( (vmcxaddr & ~PAGE_MASK) != 0 ) return 0; /* Maximum valid physical address.