]> git.proxmox.com Git - mirror_edk2.git/commit
UefiCpuPkg: PiSmmCpuDxeSmm: Not to Change Bitwidth During Static Paging
authorKun Qin <kuqin12@gmail.com>
Wed, 14 Apr 2021 20:25:47 +0000 (04:25 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 20 Apr 2021 00:32:24 +0000 (00:32 +0000)
commitc3dcbce26f9520597fc3027a0702f368217d6ca6
tree9c9381b2c413537576ac67e53539ec59bec5aadd
parent64138c95db5a7a3e4768d8a01ba71dc3475e6524
UefiCpuPkg: PiSmmCpuDxeSmm: Not to Change Bitwidth During Static Paging

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.

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.

This change updated the interface of SetStaticPageTable function to take
PhysicalAddressBits as an input parameter, in order to avoid changing/
accessing the global variable.

Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Fixes: 4eee0cc7cc0db74489b99c19eba056b53eda6358
Signed-off-by: Kun Qin <kuqin12@gmail.com>
UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c