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>
This commit is contained in:
committed by
mergify[bot]
parent
437eb3f7a8
commit
0d7601e546
@@ -129,5 +129,14 @@ LINEAR_CODE64_SEL equ $-GDT_BASE
|
||||
DB 0 ; base 31:24
|
||||
%endif
|
||||
|
||||
; linear code segment descriptor
|
||||
LINEAR_CODE16_SEL equ $-GDT_BASE
|
||||
DW 0xffff ; limit 15:0
|
||||
DW 0 ; base 15:0
|
||||
DB 0 ; base 23:16
|
||||
DB PRESENT_FLAG(1)|DPL(0)|SYSTEM_FLAG(1)|DESC_TYPE(CODE32_TYPE)
|
||||
DB GRANULARITY_FLAG(1)|DEFAULT_SIZE32(0)|CODE64_FLAG(0)|UPPER_LIMIT(0xf)
|
||||
DB 0 ; base 31:24
|
||||
|
||||
GDT_END:
|
||||
|
||||
|
Reference in New Issue
Block a user