audk/MdePkg/Library/BaseLib
Dhaval 26727c2ae2 MdePkg: Implement RISC-V Cache Management Operations
Implement Cache Management Operations (CMO) defined by
RISC-V spec https://github.com/riscv/riscv-CMOs.

Notes:
1. CMO only supports block based Operations. Meaning cache
   flush/invd/clean Operations are not available for the entire
   range. In that case we fallback on fence.i instructions.
2. Operations are implemented using Opcodes to make them compiler
   independent. binutils 2.39+ compilers support CMO instructions.

Test:
1. Ensured correct instructions are refelecting in asm
2. Qemu implements basic support for CMO operations in that it allwos
   instructions without exceptions. Verified it works properly in
   that sense.
3. SG2042Pkg implements CMO-like instructions. It was verified that
   CpuFlushCpuDataCache works fine. This more of less
   confirms that framework is alright.
4. TODO: Once Silicon is available with exact instructions, we will
   further verify this.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Daniel Schaefer <git@danielschaefer.me>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Pedro Falcato <pedro.falcato@gmail.com>

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Sunil V L <sunilvl@...>
Reviewed-by: Jingyu Li <jingyu.li01@...>
2023-12-19 12:48:14 +00:00
..
AArch64 MdePkg/BaseLib: correct register sizes in AArch64 SetJump/LongJump 2023-10-02 15:48:02 +00:00
Arm MdePkg/BaseLib: fix typo in Arm SetJump 2023-10-03 11:56:52 +00:00
Ebc MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Ia32 MdePkg: Replace Opcode with the corresponding instructions. 2022-03-01 01:45:47 +00:00
LoongArch64 MdePkg/BaseLib: BaseLib for LOONGARCH64 architecture. 2022-10-14 02:16:33 +00:00
RiscV64 MdePkg: Implement RISC-V Cache Management Operations 2023-12-19 12:48:14 +00:00
X64 MdePkg/BaseLib: Update TdVmcall to always output the value in R11 2023-11-09 17:15:39 +00:00
ARShiftU64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BaseLib.inf MdePkg: Implement RISC-V Cache Management Operations 2023-12-19 12:48:14 +00:00
BaseLib.uni
BaseLibInternals.h MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BitField.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CheckSum.c MdePkg/BaseLib: Fix CRC16-ANSI calculation 2023-12-03 02:37:26 +00:00
ChkStkGcc.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Cpu.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CpuDeadLoop.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DivS64x64Remainder.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DivU64x32.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DivU64x32Remainder.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DivU64x64Remainder.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
FilePaths.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
GetPowerOfTwo32.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
GetPowerOfTwo64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
HighBitSet32.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
HighBitSet64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
IntelTdxNull.c MdePkg: Introduce basic Tdx functions in BaseLib 2022-04-02 08:15:12 +00:00
LRotU32.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
LRotU64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
LShiftU64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
LinkedList.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
LongJump.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
LowBitSet32.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
LowBitSet64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Math64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ModU64x32.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
MultS64x64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
MultU64x32.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
MultU64x64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
QuickSort.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
RRotU32.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
RRotU64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
RShiftU64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SafeString.c MdePkg: Update code to be more C11 compliant by using __func__ 2023-03-17 17:55:48 +00:00
SetJump.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
String.c MdePkg: Fix conditionally uninitialized variables 2023-04-03 15:29:08 +00:00
SwapBytes16.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SwapBytes32.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SwapBytes64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SwitchStack.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Unaligned.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UnitTestHost.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UnitTestHost.h MdePkg/Library/BaseLib: Add BaseLib instance for host based unit tests 2020-07-15 05:25:21 +00:00
UnitTestHostBaseLib.inf MdePkg/Library/BaseLib: HOST_APPLICATION IA32/X64 only 2023-04-10 05:59:02 +00:00
UnitTestHostBaseLib.uni MdePkg/Library/BaseLib: Add BaseLib instance for host based unit tests 2020-07-15 05:25:21 +00:00
X86DisablePaging32.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86DisablePaging64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86EnablePaging32.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86EnablePaging64.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86FxRestore.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86FxSave.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86GetInterruptState.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86MemoryFence.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86Msr.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86PatchInstruction.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86RdRand.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86ReadGdtr.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86ReadIdtr.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86SpeculationBarrier.c MdePkg/BaseLib: Use PcdSpeculationBarrierType 2019-04-30 16:39:15 -07:00
X86Thunk.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86UnitTestHost.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86WriteGdtr.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86WriteIdtr.c MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00