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

Fix real mode transition #294

Merged
merged 3 commits into from
Aug 29, 2023
Merged

Conversation

sktt
Copy link
Contributor

@sktt sktt commented Aug 29, 2023

Going into real mode would crash on the wrmsr that clears the EFER_LME flag. This happened because paging was still enabled. And before disabling paging, we must also set the %ds.

@sktt sktt requested a review from a team as a code owner August 29, 2023 09:27
wipawel
wipawel previously approved these changes Aug 29, 2023
arch/x86/real_mode.S Outdated Show resolved Hide resolved
sktt added 3 commits August 29, 2023 15:41
Going into real mode would crash when clearing EFER_LME, i.e., when
transitioning from long to protected mode. This happened because paging
was still enabled. Before disabling paging, we must also set the %ds.

Signed-off-by: Johannes Wikner <[email protected]>
In protected mode, like in head.S, we want to be able to save all
registers. {SAVE,RESTORE}_ALL_REGS32 should therefore always be working
on 32-bit registers and not be build-dependent.

Signed-off-by: Johannes Wikner <[email protected]>
Copy link
Contributor

@minipli-oss minipli-oss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@wipawel wipawel merged commit a5a2a96 into KernelTestFramework:mainline Aug 29, 2023
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.

3 participants