Skip to content

Conversation

@wipawel
Copy link
Contributor

@wipawel wipawel commented Sep 1, 2023

No description provided.

Add generic _from_usermode and _to_usermode macros that switch pagetable,
swap GS and optionally switch stack.
Use these macros in syscall_(from/to)_usermode macros directly.
Rename enter_(from/to)_usermode macros to cond_(from/to)_usermode macros
to highlight the conditional nature of transition.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
There is no need to switch stack for sysenter and int80 as the CPU
switches to TSS.RSP0. However, it is still necessary for SYSCALL_EXIT
since we are terminating the user task.

Also, there is no need to save user registers for SYSCALL_EXIT.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
@wipawel wipawel added bugfix This fixes a bug Severity: high Very important bug - fix ASAP labels Sep 1, 2023
@wipawel wipawel requested review from minipli-oss and sktt September 1, 2023 09:55
@wipawel wipawel requested a review from a team as a code owner September 1, 2023 09:55
By treating both error_code and vector as machines words (either
32bit or 64bit based on built architecture) we simplify
handling of the exceptions across architectures.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
On IRQ entry always push fake error_code value (always zero) and a
corresponding IRQ vector number on the stack to make its layout
match the exception stack frame layout. This simplifies the handling
of both exceptions and interrupts.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
The proper order of initialization is: ACPI -> IOAPIC -> Timers.
The ACPI provided MADT table provides configuration for IOAPICs
and for example HPET.
Also, initialized IOAPIC is required by timers to setup their IRQs.

Signed-off-by: Pawel Wieczorkiewicz <[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.

Looking good, just a few more nits.

@wipawel wipawel enabled auto-merge (rebase) September 1, 2023 14:01
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.

Thanks a lot, Pawel!

@wipawel wipawel merged commit a2ed92d into KernelTestFramework:mainline Sep 1, 2023
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