From e2f608687690c28fba52eb78cede62e516b1d26d Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Thu, 13 Oct 2011 12:21:10 +0100 Subject: [PATCH] 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 --- xen/arch/x86/hvm/svm/nestedsvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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. -- 2.30.2