jonomango / hv

Lightweight Intel VT-x Hypervisor.
MIT License
363 stars 77 forks source link

Vmlaunch is failing on a new cpu #13

Closed thewolfram closed 1 year ago

thewolfram commented 1 year ago

hey jonomango, I've got a new i5-12400F cpu and when I start the hypervisor, it is failing with instruction error 7 image

jonomango commented 1 year ago

This is the second time I've seen this issue and I'm still not sure what the cause is. According to the Intel Manual, error 7 means "VM entry with invalid control field." Try commenting out this line and seeing what happens.

thewolfram commented 1 year ago

This is the second time I've seen this issue and I'm still not sure what the cause is. According to the Intel Manual, error 7 means "VM entry with invalid control field." Try commenting out this line and seeing what happens.

I tried, but still nothing changed

jonomango commented 1 year ago

Can you try to set this line to 0?

thewolfram commented 1 year ago

Can you try to set this line to 0?

Seems like it succeded, but my pc just froze without bsod after this output rn_image_picker_lib_temp_2521e767-bf5d-4939-91f5-555a779abf40.jpg

jonomango commented 1 year ago

Interesting, I'll have to push a commit with that fix. I'm already aware that the hypervisor doesn't work correctly for Intel 10th gen and up, which can be seen in this issue so I'll mark this as closed for now since we fixed the original issue.

thewolfram commented 1 year ago

Interesting, I'll have to push a commit with that fix. I'm already aware that the hypervisor doesn't work correctly for Intel 10th gen and up, which can be seen in this issue so I'll mark this as closed for now since we fixed the original issue.

It actually works for 10th gen Intel, you can see my issue where you helped me.

jonomango commented 1 year ago

Sorry, I meant 11th gen and up 😅

jonomango commented 1 year ago

I think that I'll try to compile a list of every Intel CPU that the hypervisor is confirmed to work on since it just seems to fail on the newer ones.

jonomango commented 1 year ago

Initial issue is fixed with https://github.com/jonomango/hv/commit/7ea88187afe2aac49151654e5c418c961b7bb94c

jonomango commented 1 year ago

As for the crashes, some users have said that increasing https://github.com/jonomango/hv/blob/main/hv/ept.h#L10 to around ~512 has fixed the issue, probably due to some I/O devices claiming the physical memory above RAM (my hypothesis).