emulate Intel Silicon Debug MSR (fixes OpenBSD guests) #182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OpenBSD since 6.1 reads this register and attempts to disable the debug interface if enabled. Ref: openbsd/src@61bf105
Returning 0 will satifsy OpenBSD guests that this feature is disabled and allow running xhyve without
-w
.This might also need to be upstreamed to bhyve, as I found a similar report for it (and workaround with
-w
): https://marc.info/?t=149136054700003&r=1&w=2A reply to that thread indicated the hardenedbsd fork fixed it via returning a "locked and disabled" value in that MSR, but that doesn't seem to have made it into FreeBSD bhyve. Also, in my testing simply returning 0 (disabled) is sufficient.
This only affects certain host CPUs (those with the SDBG CPU ID bit, which bhyve/xhyve pass through), but they're apparently common among recent-ish Macs. An alternative solution would be to mask off that CPU ID bit, but this seemed like a simpler solution.