Skip to content

x86_64: fix crashes when the guest switches CPU mode - #336

Merged
dreamliner787-9 merged 2 commits into
mainfrom
x86_mode_switch_fixes
Jul 20, 2026
Merged

x86_64: fix crashes when the guest switches CPU mode#336
dreamliner787-9 merged 2 commits into
mainfrom
x86_mode_switch_fixes

Conversation

@dreamliner787-9

Copy link
Copy Markdown
Collaborator

Fixed a few crashes I ran into while trying out desktop Linux distros on libvmm with OVMF. See the commits for more details.

I ran into a triple fault while trying to boot Linux with
with Limine on top of OVMF and this was the cause.

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
On x86, software exit long mode by clearing CR0.PG. However, the act
of clearing this bit causes side effects in the processor that we the
VMM must emulate in software. Otherwise vmresume will fail with invalid
guest state.

I ran into this problem while trying Limine on OVMF. Which seems to
drop into protected mode from long mode when booting Linux.

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
@dreamliner787-9
dreamliner787-9 force-pushed the x86_mode_switch_fixes branch from 73be223 to d33273e Compare July 20, 2026 03:33
@dreamliner787-9
dreamliner787-9 merged commit 5757f70 into main Jul 20, 2026
11 checks passed
@dreamliner787-9
dreamliner787-9 deleted the x86_mode_switch_fixes branch July 20, 2026 04:08
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

Successfully merging this pull request may close these issues.

1 participant