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

[xen stable-4.20] xen/x86/hvm: Propagate emulated CR2 writes to the VMCB



commit e3e24d84b6169032841fbfe3571adcbad842019e
Author:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
AuthorDate: Thu Oct 29 13:32:42 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Oct 29 13:32:42 2026 +0100

    xen/x86/hvm: Propagate emulated CR2 writes to the VMCB
    
    hvmemul_write_cr() updates guest_cr[2] but, unlike every other writer of
    it, doesn't call hvm_update_guest_cr(). On SVM, CR2 is loaded from
    the VMCB, so the emulated write never reaches the guest, and the next
    VMExit overwrites guest_cr[2] with the stale VMCB value.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
    Acked-by: Roger Pau Monné <roger@xxxxxxxxxxxxxx>
    master commit: e4d90abb26a814ae6f33ce6aa66c9095aa5cae5f
    master date: 2026-10-23 17:23:43 -0700
---
 xen/arch/x86/hvm/emulate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 841216f2ea..9c82c6dc37 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -2343,6 +2343,7 @@ static int cf_check hvmemul_write_cr(
 
     case 2:
         curr->arch.hvm.guest_cr[2] = val;
+        hvm_update_guest_cr(curr, 2);
         rc = X86EMUL_OKAY;
         break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20



 


Rackspace

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