diff options
| author | Chao Liu <chao.liu.zevorn@gmail.com> | 2026-01-05 13:00:00 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-01-19 08:57:29 +0300 |
| commit | f2c63dca1bc5201903b75a8551afdf2c7ab2fc4d (patch) | |
| tree | a9ce464ae8fa88e40005dcd402448e42a4cb5830 /MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptInternalFormat.h | |
| parent | b1707d99ae05b7e3f70b28fee830fbad131de5b5 (diff) | |
| download | edk2-f2c63dca1bc5201903b75a8551afdf2c7ab2fc4d.tar.xz | |
UefiCpuPkg/BaseRiscV64CpuTimerLib: Add constructor to initialize mTimeBase
Add a constructor function that calls GetPerformanceCounterProperties(NULL, NULL)
to ensure mTimeBase is initialized during DXE phase, before virtual memory is
enabled.
This fixes crashes on RISC-V platforms without fw_cfg device support (e.g.,
QEMU rvsp-ref) where Runtime Services may call GetPerformanceCounterProperties()
before mTimeBase has been initialized. When virtual memory is then enabled, the
uninitialized mTimeBase value causes HOB access to fail with a page fault.
Fixes: https://github.com/tianocore/edk2/issues/11747
Signed-off-by: Chao Liu <chao.liu.riscv@isrc.iscas.ac.cn>
Reported-by: Xiaofan Tan <xiaofan@iscas.ac.cn>
Suggested-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptInternalFormat.h')
0 files changed, 0 insertions, 0 deletions
