[edk2-devel] [PATCH v1 0/1] Not to Update Bitwidth Variable in Static Paging

Kun Qin kuqin12 at gmail.com
Wed Apr 14 02:59:21 UTC 2021


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 at intel.com>
Cc: Ray Ni <ray.ni at intel.com>
Cc: Laszlo Ersek <lersek at redhat.com>
Cc: Rahul Kumar <rahul1.kumar at 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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74078): https://edk2.groups.io/g/devel/message/74078
Mute This Topic: https://groups.io/mt/82082903/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list