diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2025-06-26 13:40:11 +0200 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2025-06-27 13:53:12 +0200 |
commit | 7b22e0432981c2fa230f1b493082b7e67112c4aa (patch) | |
tree | c419c093a05ec59ce01ebbf10934ad1e1aa2a6c1 /rust/helpers/task.c | |
parent | 040ed574ee823a2ce5da36a8d385d3133787c9c5 (diff) |
x86/sev/vc: Fix EFI runtime instruction emulation
In case efi_mm is active go use the userspace instruction decoder which
supports fetching instructions from active_mm. This is needed to make
instruction emulation work for EFI runtime code, so it can use CPUID and
RDMSR.
EFI runtime code uses the CPUID instruction to gather information about
the environment it is running in, such as SEV being enabled or not, and
choose (if needed) the SEV code path for ioport access.
EFI runtime code uses the RDMSR instruction to get the location of the
CAA page (see SVSM spec, section 4.2 - "Post Boot").
The big picture behind this is that the kernel needs to be able to
properly handle #VC exceptions that come from EFI runtime services.
Since EFI runtime services have a special page table mapping for the EFI
virtual address space, the efi_mm context must be used when decoding
instructions during #VC handling.
[ bp: Massage. ]
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
Link: https://lore.kernel.org/20250626114014.373748-2-kraxel@redhat.com
Diffstat (limited to 'rust/helpers/task.c')
0 files changed, 0 insertions, 0 deletions