mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
OvmfPkg: SEC/SMM: Use 256 IDT Descriptors
This follows the update in UefiCpuPkg to use 256 IDT descriptors in SEC and SMM. This is done to: - Have a defined action when exceptions are taken (use the common exception handler) - Allow processing the stack cookie exception gracefully instead of generating a #GP fault. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This commit is contained in:
parent
4512733ac8
commit
3bfe4fadff
2 changed files with 7 additions and 8 deletions
|
|
@ -274,10 +274,10 @@ InitSmmIdt (
|
|||
CONST EFI_PEI_SERVICES **PeiServices;
|
||||
|
||||
//
|
||||
// There are 32 (not 255) entries in it since only processor
|
||||
// generated exceptions will be handled.
|
||||
// Populate 256 entries to ensure that a known state occurs
|
||||
// for all possible exception vectors.
|
||||
//
|
||||
gcSmmInitIdtr.Limit = (sizeof (IA32_IDT_GATE_DESCRIPTOR) * 32) - 1;
|
||||
gcSmmInitIdtr.Limit = (sizeof (IA32_IDT_GATE_DESCRIPTOR) * X86_CPU_INTERRUPT_NUM) - 1;
|
||||
|
||||
//
|
||||
// Allocate for IDT.
|
||||
|
|
|
|||
|
|
@ -33,11 +33,9 @@
|
|||
#include <Register/Intel/Cpuid.h>
|
||||
#include "AmdSev.h"
|
||||
|
||||
#define SEC_IDT_ENTRY_COUNT 34
|
||||
|
||||
typedef struct _SEC_IDT_TABLE {
|
||||
EFI_PEI_SERVICES *PeiService;
|
||||
IA32_IDT_GATE_DESCRIPTOR IdtTable[SEC_IDT_ENTRY_COUNT];
|
||||
IA32_IDT_GATE_DESCRIPTOR IdtTable[X86_CPU_INTERRUPT_NUM];
|
||||
} SEC_IDT_TABLE;
|
||||
|
||||
VOID
|
||||
|
|
@ -844,7 +842,7 @@ SecCoreStartupWithStack (
|
|||
//
|
||||
IdtTableInStack.PeiService = NULL;
|
||||
|
||||
for (Index = 0; Index < SEC_IDT_ENTRY_COUNT; Index++) {
|
||||
for (Index = 0; Index < X86_CPU_INTERRUPT_NUM; Index++) {
|
||||
//
|
||||
// Declare the local variables that actually move the data elements as
|
||||
// volatile to prevent the optimizer from replacing this function with
|
||||
|
|
@ -889,9 +887,10 @@ SecCoreStartupWithStack (
|
|||
|
||||
if (!SevEsIsEnabled ()) {
|
||||
//
|
||||
// For non SEV-ES guests, just load the IDTR.
|
||||
// For non SEV-ES guests, now load the IDTR and initialize the exception handlers.
|
||||
//
|
||||
AsmWriteIdtr (&IdtDescriptor);
|
||||
InitializeCpuExceptionHandlers (NULL);
|
||||
} else {
|
||||
//
|
||||
// Under SEV-ES, the hypervisor can't modify CR0 and so can't enable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue