]> git.proxmox.com Git - mirror_edk2.git/commit - UefiCpuPkg/CpuDxe/CpuGdt.c
UefiCpuPkg: Add a 16-bit protected mode code segment descriptor
authorTom Lendacky <thomas.lendacky@amd.com>
Wed, 12 Aug 2020 20:21:42 +0000 (15:21 -0500)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 17 Aug 2020 02:46:39 +0000 (02:46 +0000)
commit0d7601e5467a710cbdda4edf88440dbb6a334b6e
tree5c28ee99ba9e2c1f750c14392bffaeca2f0f0d86
parent437eb3f7a8db7681afe0e6064d3a8edb12abb766
UefiCpuPkg: Add a 16-bit protected mode code segment descriptor

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198

A hypervisor is not allowed to update an SEV-ES guests register state,
so when booting an SEV-ES guest AP, the hypervisor is not allowed to
set the RIP to the guest requested value. Instead, an SEV-ES AP must be
transition from 64-bit long mode to 16-bit real mode in response to an
INIT-SIPI-SIPI sequence. This requires a 16-bit code segment descriptor.
For PEI, create this descriptor in the reset vector GDT table. For DXE,
create this descriptor from the newly reserved entry at location 0x28.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
UefiCpuPkg/CpuDxe/CpuGdt.c
UefiCpuPkg/CpuDxe/CpuGdt.h
UefiCpuPkg/ResetVector/Vtf0/Ia16/Real16ToFlat32.asm