Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: f2c63dca1bc5201903b75a8551afdf2c7ab2fc4d
      
https://github.com/tianocore/edk2/commit/f2c63dca1bc5201903b75a8551afdf2c7ab2fc4d
  Author: Chao Liu <[email protected]>
  Date:   2026-01-19 (Mon, 19 Jan 2026)

  Changed paths:
    M UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLib.inf
    M UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/CpuTimerLib.c

  Log Message:
  -----------
  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 <[email protected]>
Reported-by: Xiaofan Tan <[email protected]>
Suggested-by: Laszlo Ersek <[email protected]>



To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to