Implementing code to support Cache Management Operations (CMO) defined by RV 
spec https://github.com/riscv/riscv-CMOs

Notes:

CMO only supports block based Operations. Meaning complete cache 
flush/invd/clean Operations are not available. In that case we fallback on 
fence.i instructions.
Rely on the fact that platform init has initialized CMO and this implementation 
just checks if it is enabled.
In order to avoid compiler dependency injecting byte code.
Test:

Ensured correct instructions are refelecting in asm
Able to boot platform with RiscVVirtQemu config
Not able to verify actual instruction in HW as Qemu ignores any actual cache 
operations.

Dhaval Sharma (1):
  MdePkg:Implement RISCV CMO

 MdePkg/Library/BaseLib/BaseLib.inf                  |   2 +-
 MdePkg/Include/Register/RiscV64/RiscVEncoding.h     |   4 +
 MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 200 ++++++++++++++++++--
 MdePkg/Library/BaseLib/RiscV64/FlushCache.S         |  21 --
 MdePkg/Library/BaseLib/RiscV64/RiscVCacheMgmt.S     |  64 +++++++
 5 files changed, 254 insertions(+), 37 deletions(-)
 delete mode 100644 MdePkg/Library/BaseLib/RiscV64/FlushCache.S
 create mode 100644 MdePkg/Library/BaseLib/RiscV64/RiscVCacheMgmt.S

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106901): https://edk2.groups.io/g/devel/message/106901
Mute This Topic: https://groups.io/mt/100117168/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to