From 136f5e2f776a22a910ad2624265b1fa5435f7da1 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 3 Oct 2007 14:33:57 +0100 Subject: [PATCH] svm: Can only avoid CR3 reads when NPT is enabled. CR0 and CR4 reads must still be intercepted. Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/svm/vmcb.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c index d7de03d1cb..497e6e0cda 100644 --- a/xen/arch/x86/hvm/svm/vmcb.c +++ b/xen/arch/x86/hvm/svm/vmcb.c @@ -235,14 +235,16 @@ static int construct_vmcb(struct vcpu *v) vmcb->h_cr3 = pagetable_get_paddr(v->domain->arch.phys_table); vmcb->exception_intercepts = HVM_TRAP_MASK; - /* No point in intercepting CR3/4 reads, because the hardware - * will return the guest versions anyway. Still need to intercept - * CR0 reads to hide the changes we make to CR0.TS in the lazy-fpu - * code. */ + /* + * No point in intercepting CR3 reads, because the hardware will return + * the guest version anyway. + */ vmcb->cr_intercepts &= ~(CR_INTERCEPT_CR3_READ|CR_INTERCEPT_CR4_READ); - /* No point in intercepting INVLPG if we don't have shadow pagetables - * that need to be fixed up. */ + /* + * No point in intercepting INVLPG if we don't have shadow pagetables + * that need to be fixed up. + */ vmcb->general1_intercepts &= ~GENERAL1_INTERCEPT_INVLPG; } else -- 2.39.5