From 5fa2c5849f8d7a6e6a87f6e3478e8522b4d20d79 Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Thu, 7 May 2026 11:55:07 +0100 Subject: [PATCH] nestedsvm: Clear GIF when injecting VMEXIT If L1 executes VMRUN with the GIF set and it fails consistency checks, Xen will inject a VMEXIT and fail the assert checking the GIF is cleared. Instead, clear the GIF when injecting a VMEXIT to match what hardware does. Fixes: 9a779e4fc161 ("Implement SVM specific part for Nested Virtualization") Signed-off-by: Ross Lagerwall Reviewed-by: Andrew Cooper --- xen/arch/x86/hvm/svm/nestedsvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c index 64fbfe8fa7..9899cb2147 100644 --- a/xen/arch/x86/hvm/svm/nestedsvm.c +++ b/xen/arch/x86/hvm/svm/nestedsvm.c @@ -717,9 +717,9 @@ nsvm_vcpu_vmexit_inject(struct vcpu *v, struct cpu_user_regs *regs, struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb; if ( vmcb->_vintr.fields.vgif_enable ) - ASSERT(vmcb->_vintr.fields.vgif == 0); + vmcb->_vintr.fields.vgif = 0; else - ASSERT(svm->ns_gif == 0); + svm->ns_gif = 0; ns_vmcb = nv->nv_vvmcx;