Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exits on MSR read/write (Windows 10 1903) #9

Closed
s405 opened this issue Oct 26, 2019 · 2 comments
Closed

Unhandled exits on MSR read/write (Windows 10 1903) #9

s405 opened this issue Oct 26, 2019 · 2 comments

Comments

@s405
Copy link

s405 commented Oct 26, 2019

Hey, I'm having some trouble getting the hypervisor to run correctly on both virtualized and non-virtualized environments.

Both of the test environments are running Windows 10 Pro, build 1903.
I wanted to test other builds to see if the issue persists, however, the source doesn't seem to mess with undocumented OS internals and there's already been another issue opened (but closed later on) describing the same issue I'm experiencing.

Now, the HvExitHandleUnknownExit function is invoked multiple times by the VM exit handler and it receives exit codes 0x1F and 0x20, which are, as far as I'm aware, exits for MSR read/write.

What makes this interesting to me is that the MSR bitmap is both cleared and set before the CPU is subverted (https://github.com/Gbps/gbhv/blob/master/gbhv/vmcs.c#L515-L527), so I'm not sure what could be causing the exits...

I'm not too experienced with VT-x, I've never implemented a type 1 hypervisor by myself, but I've covered most of the basics/theory in SDM volume 3, so pardon if my lack of experience is the cause of the issue :)

EDIT: I haven't modified anything, I'm running it on clean Windows 10 installs and the hypervisor is compiled straight from the repo, no modifications...

@Gbps
Copy link
Owner

Gbps commented Oct 26, 2019 via email

@s405
Copy link
Author

s405 commented Oct 26, 2019

There is indeed a range of MSR values defined in the manual that will exit no matter the state of the bitmap.

-- Gbps

Oh sorry, I wasn't aware of this!

I'm going to implement exit handlers for both of these and I'll report back on the issue (logging the RIP as well to see where they come from ;) )

Cheers for the fast response! :)

@Gbps Gbps closed this as completed May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants