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

entry: disable interrupts during usermode transition #316

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

wipawel
Copy link
Contributor

@wipawel wipawel commented Nov 3, 2023

SWAPGS instruction used to switch the GS base to usermode one (currently 0x0) for PERCPU variables accesses is only stable within an uninterruptable context.
Disable interrupts before the stack switch in enter_usermode() and re-enable it via IRET long return.

@wipawel wipawel added bugfix This fixes a bug Severity: high Very important bug - fix ASAP labels Nov 3, 2023
@wipawel wipawel requested a review from minipli-oss November 3, 2023 09:07
@wipawel wipawel requested a review from a team as a code owner November 3, 2023 09:07
@wipawel wipawel enabled auto-merge (rebase) November 3, 2023 09:07
SWAPGS instruction used to switch the GS base to usermode one
(currently 0x0) for PERCPU variables accesses is only stable
within an uninterruptable context.
Disable interrupts before the stack switch in enter_usermode()
and re-enable it via IRET long return.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
Copy link
Contributor

@sktt sktt 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 4b44717 into KernelTestFramework:mainline Nov 7, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This fixes a bug Severity: high Very important bug - fix ASAP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants