Page MenuHomeFreeBSD

bhyve: implement rdmsr for MSR_IA32_FEATURE_CONTROL
ClosedPublic

Authored by corvink on Apr 9 2021, 5:42 AM.
Tags
Referenced Files
Unknown Object (File)
Fri, Apr 12, 9:09 AM
Unknown Object (File)
Feb 29 2024, 10:04 AM
Unknown Object (File)
Feb 18 2024, 7:21 AM
Unknown Object (File)
Feb 5 2024, 11:33 AM
Unknown Object (File)
Jan 25 2024, 3:05 AM
Unknown Object (File)
Jan 18 2024, 9:37 AM
Unknown Object (File)
Jan 12 2024, 5:15 AM
Unknown Object (File)
Jan 8 2024, 4:09 AM

Details

Summary

Windows guest crashes on boot. It's caused by rdmsr to MSR_IA32_FEATURE_CONTROL. Windows checks this MSR to determine enabled VMX features. Bhyve hasn't implement it yet. For that reason, bhyve injects a GP which causes Windows to crash.
This patch returns MSR_IA32_FEATURE_CONTROL with Lock Bit set and VMX disabled to tell Windows that VMX isn't available.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

corvink edited the summary of this revision. (Show Details)
corvink retitled this revision from bhyve: fix crash of rdmsr from windows guests to bhyve: implement rdmsr for MSR_IA32_FEATURE_CONTROL.Apr 9 2021, 5:45 AM
jlduran_gmail.com added inline comments.
usr.sbin/bhyve/xmsr.c
133

I guess machine/specialreg.h already defines IA32_FEATURE_CONTROL_LOCK?

  • Use IA32_FEATURE_CONTROL_LOCK define

This looks ok to me with the tweaked comment. Does this permit Windows guests to boot without -w?

usr.sbin/bhyve/xmsr.c
129–131

I'm able to boot a Windows guest without -w by applying this patch.

grehan added a subscriber: grehan.

Looks fine, and preserves #GP on writes.

This revision is now accepted and ready to land.Apr 13 2021, 7:51 AM

Do you have this already staged as a git commit in a tree Peter or I could pull from?

This commit isn't staged in a tree.

This revision was automatically updated to reflect the committed changes.