Skip to content

Fix Guestmem label and page-fault handler#1154

Open
joergroedel wants to merge 3 commits into
coconut-svsm:mainfrom
joergroedel:fixes
Open

Fix Guestmem label and page-fault handler#1154
joergroedel wants to merge 3 commits into
coconut-svsm:mainfrom
joergroedel:fixes

Conversation

@joergroedel

Copy link
Copy Markdown
Member

Fix two issues and add missing Copy + Clone annotations to ELF code. The issues fixes here:

  • Fix the faulting label in copy_bytes() so it points to the instruction that will fault.
  • Fix the page-fault handler so that it correctly handles and resolves faults when kernel mode accesses user-mode addresses.

Comment thread kernel/src/mm/guestmem.rs
Comment thread elf/src/program_header.rs
Comment thread kernel/src/cpu/idt/svsm.rs Outdated
@00xc 00xc added the needs-rebase The PR needs to be rebased to the latest upstream branch label Jul 8, 2026
@joergroedel joergroedel removed the needs-rebase The PR needs to be rebased to the latest upstream branch label Jul 8, 2026
The label must point at the potentially faulting RIP in order for the
exception to be handled correctly. Fix the label in copy_bytes().

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
The page-fault handler did not handle faults to the user memory region
correctly when they were coming from kernel code. Rewrite the handler
to implement the right behavior.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Some structs in the ELF parser code miss the Copy + Clone annotations,
so add them.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
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