Project

General

Profile

Actions

Bug #13029

closed

AMD bhyve should reload TSS ASAP

Added by Patrick Mooney over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
bhyve
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
bhyve
Gerrit CR:
External Bug:

Description

Unlike VMX, SVM does not restore the TSS when making a round trip to guest context. This means that the TSS must be reloaded "manually" by the OS after vmload/vmrun/vmsave. Although bhyve keeps the GIF cleared while the TSS contains incorrect state, preventing interrupts (including NMI) from triggering it, dtrace probes on any functions called before the TSS is restored will run afoul of the bogus state and likely reboot the machine. This can be seen on an unpatched machine by tracing svm_launch:return, which causes an immediate crash when a VM is running. Like %gsbase, the TSS could be restored before returning from svm_launch(), avoiding those unfortunate crashes.

Actions #1

Updated by Electric Monk over 3 years ago

  • Gerrit CR set to 839
Actions #2

Updated by Patrick Mooney over 3 years ago

With the proposed patch applied, I'm able to dtrace svm_launch:return without the machine immediately rebooting. Test VMs run normally, as expected.

Actions #3

Updated by Electric Monk over 3 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 4d3fdeb14779bb6b0838521971d9ac99d65b0572

commit  4d3fdeb14779bb6b0838521971d9ac99d65b0572
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2020-08-14T18:17:41.000Z

    13029 AMD bhyve should reload TSS ASAP
    Reviewed by: John Levon <john.levon@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF