git: 873508de1eb6 - main - vmm: Suspend the VM on a hardware triple fault

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Wed, 30 Sep 2026 15:54:07 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=873508de1eb6ee3e73a92a25dc769baffd3d3f64

commit 873508de1eb6ee3e73a92a25dc769baffd3d3f64
Author:     Hayzam Sherif <hayzam@gmail.com>
AuthorDate: 2026-09-30 14:16:15 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-09-30 15:53:51 +0000

    vmm: Suspend the VM on a hardware triple fault
    
    The VMX backend did not handle EXIT_REASON_TRIPLE_FAULT, so a hardware
    triple fault fell through as an unhandled exit: bhyve printed a raw VMX
    exit dump and aborted, instead of suspending the VM with the
    reason the software exception path already uses.
    
    Add the missing case so the VM suspends with VM_SUSPEND_TRIPLEFAULT and
    bhyve exits with BHYVE_EXIT_TRIPLEFAULT.  This matches illumos change 14664.
    
    Obtained from:  illumos 83b49c54d9c0766e810b6c8ff849dfb6693fc68a
    Reviewed by:    bnovkov, markj
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D59840
---
 sys/amd64/vmm/intel/vmx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index 29aadb5881f3..ff0e1cb2b882 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -2471,6 +2471,10 @@ vmx_exit_process(struct vmx *vmx, struct vmx_vcpu *vcpu, struct vm_exit *vmexit)
 	}
 
 	switch (reason) {
+	case EXIT_REASON_TRIPLE_FAULT:
+		(void)vm_suspend(vmx->vm, VM_SUSPEND_TRIPLEFAULT);
+		handled = HANDLED;
+		break;
 	case EXIT_REASON_TASK_SWITCH:
 		ts = &vmexit->u.task_switch;
 		ts->tsssel = qual & 0xffff;