mirror of https://github.com/acidanthera/audk.git
b72f487372
Current IsInSmm() method makes use of gEfiSmmBase2ProtocolGuid.InSmm() to
check if current processor is in SMM mode or not. But this is not correct
because gEfiSmmBase2ProtocolGuid.InSmm() can only detect if the caller is
running in SMRAM or from SMM driver. It cannot guarantee if the caller is
running in SMM mode. Because SMM mode will load its own page table, adding
an extra check of saved DXE page table base address against current CR3
register value can help to get the correct answer for sure (in SMM mode or
not in SMM mode).
There's indiscriminate uses of Context.X64 and Context.Ia32 in code which
is not a good coding practice and will cause potential issue. In addition,
the related structure type definition is not packed and has also potential
issue. This will not be covered by this patch but be tracked by a bug below.
https://bugzilla.tianocore.org/show_bug.cgi?id=1039
This is an issue caused by check-in at
|
||
---|---|---|
.. | ||
Ia32 | ||
X64 | ||
CpuDxe.c | ||
CpuDxe.h | ||
CpuDxe.inf | ||
CpuDxe.uni | ||
CpuDxeExtra.uni | ||
CpuGdt.c | ||
CpuGdt.h | ||
CpuMp.c | ||
CpuMp.h | ||
CpuPageTable.c | ||
CpuPageTable.h |