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

[xen staging] nestedsvm: Don't set CR2 while injecting VMEXIT_EXCEPTION_PF



commit 79e62d545c41644a9f42921bd6efee3a4ae64033
Author:     Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
AuthorDate: Thu Nov 19 10:37:38 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Nov 19 10:37:38 2026 +0100

    nestedsvm: Don't set CR2 while injecting VMEXIT_EXCEPTION_PF
    
    According to the APM, the #PF intercept is tested before CR2 is written
    so don't write CR2 (with a possibly stale value) while injecting
    VMEXIT_EXCEPTION_PF into L1. The faulting address is available to L1 in
    EXITINFO2.
    
    Fixes: 9a779e4fc161 ("Implement SVM specific part for Nested 
Virtualization")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 81cae929dd..366178ff54 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -741,8 +741,6 @@ nsvm_vcpu_vmexit_inject(struct vcpu *v, struct 
cpu_user_regs *regs,
                 ns_vmcb->exit_int_info = ns_vmcb->event_inj;
             break;
         case VMEXIT_EXCEPTION_PF:
-            ns_vmcb->_cr2 = ns_vmcb->ei.exc.cr2;
-            fallthrough;
         case VMEXIT_NPF:
             ns_vmcb->exitinfo2 = svm->ns_vmexit.exitinfo2;
             fallthrough;
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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