public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 0/1] Not to Update Bitwidth Variable in Static Paging
@ 2021-04-14  2:59 Kun Qin
  2021-04-14  2:59 ` [PATCH v1 1/1] UefiCpuPkg: PiSmmCpuDxeSmm: Not to Change Bitwidth During " Kun Qin
  0 siblings, 1 reply; 6+ messages in thread
From: Kun Qin @ 2021-04-14  2:59 UTC (permalink / raw)
  To: devel; +Cc: Eric Dong, Ray Ni, Laszlo Ersek, Rahul Kumar

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3300

Current implementation of SetStaticPageTable routine in PiSmmCpuDxeSmm
driver will check a global variable mPhysicalAddressBits, and eventually
cap any value larger than 39 at 39.

However, this global variable is used in ConvertMemoryPageAttributes,
which backs SmmSetMemoryAttributes and SmmClearMemoryAttributes. Thus for
a processor that supports more than 39 bits width, trying to mark page
table regions higher than 39-bit will always return EFI_UNSUPPROTED. As a
result, access rights to pages residing higher than 39 bits in the
physical address space will not be correctly configured (i.e. restricted)
in the SMM page table entries.

This change attempts to fix this issue by switching to caching the global
bitwidth variable in local variable for SetStaticPageTable routine.

Patch v1 branch: https://github.com/kuqin12/edk2/tree/bitwidth_paging

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>

Kun Qin (1):
  UefiCpuPkg: PiSmmCpuDxeSmm: Not to Change Bitwidth During Static
    Paging

 UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c | 25 +++++++++++---------
 1 file changed, 14 insertions(+), 11 deletions(-)

-- 
2.31.0.windows.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-14 17:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-14  2:59 [PATCH v1 0/1] Not to Update Bitwidth Variable in Static Paging Kun Qin
2021-04-14  2:59 ` [PATCH v1 1/1] UefiCpuPkg: PiSmmCpuDxeSmm: Not to Change Bitwidth During " Kun Qin
2021-04-14  9:15   ` Laszlo Ersek
2021-04-14 17:33     ` Kun Qin
2021-04-14  9:49   ` Ni, Ray
2021-04-14 17:26     ` Kun Qin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox