Page MenuHomeFreeBSD

vmm: Suspend the VM on a hardware triple fault
AcceptedPublic

Authored by hayzam_gmail.com on Sat, Sep 19, 1:49 PM.
Tags
None
Referenced Files
F172645339: D59840.id187215.diff
Sat, Sep 19, 10:38 PM
F172635702: D59840.diff
Sat, Sep 19, 9:04 PM
F172633261: D59840.id187215.diff
Sat, Sep 19, 8:34 PM
F172632754: D59840.id.diff
Sat, Sep 19, 8:29 PM
F172627865: D59840.diff
Sat, Sep 19, 7:36 PM
F172604595: D59840.id187215.diff
Sat, Sep 19, 3:23 PM

Details

Reviewers
markj
bnovkov
Group Reviewers
bhyve
Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77089
Build 73972: arc lint + arc unit

Event Timeline

bnovkov added a subscriber: bnovkov.

LGTM, I'll give the patch a spin tomorrow before landing it. Have you tested this change somehow already?

This revision is now accepted and ready to land.Sat, Sep 19, 5:15 PM

LGTM, I'll give the patch a spin tomorrow before landing it. Have you tested this change somehow already?

Yep, I tested with a small 16-bit payload that loads a null IDT and executes ud2, so the guest takes a hardware triple fault (VMX exit reason 2).

Before: raw VMX dump, then abort.
After patch: no dump, exits 3 (BHYVE_EXIT_TRIPLEFAULT).

Only the VMX side is covered though as you can see, the SVM side still injects #UD for VMCB_EXIT_SHUTDOWN (illumos I believe handles it in 13170), and I have no AMD hardware here.

I can attach the payload image and both serial logs if that's useful.