[PATCH] nestedsvm: Crash domain rather than Xen on unexpected VMEXIT

Ross Lagerwall posted 1 patch 2 weeks, 6 days ago
xen/arch/x86/hvm/svm/nestedsvm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] nestedsvm: Crash domain rather than Xen on unexpected VMEXIT
Posted by Ross Lagerwall 2 weeks, 6 days ago
On encountering an unexpected VMEXIT (e.g. because L1 has used an
intercept that L0 Xen doesn't know about), crash the domain rather than
the hypervisor.

Fixes: 9a779e4fc161 ("Implement SVM specific part for Nested Virtualization")
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---

This can be triggered running kvm-unit-tests in L1.
Xen undoubtedly needs to handle the intercepts properly but as a first
step it shouldn't BUG().

 xen/arch/x86/hvm/svm/nestedsvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 3d0e77f5eb24..5adb1bd72c4d 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -923,7 +923,7 @@ nsvm_vmcb_guest_intercepts_exitcode(struct vcpu *v,
 
     default:
         gdprintk(XENLOG_ERR, "Illegal exitcode %#"PRIx64"\n", exitcode);
-        BUG();
+        domain_crash(v->domain);
         break;
     }
 
-- 
2.53.0
Re: [PATCH] nestedsvm: Crash domain rather than Xen on unexpected VMEXIT
Posted by Andrew Cooper 2 weeks, 6 days ago
On 04/09/2026 3:27 pm, Ross Lagerwall wrote:
> On encountering an unexpected VMEXIT (e.g. because L1 has used an
> intercept that L0 Xen doesn't know about), crash the domain rather than
> the hypervisor.
>
> Fixes: 9a779e4fc161 ("Implement SVM specific part for Nested Virtualization")
> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>