public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v5 0/7] Add RISC-V MMU support
@ 2023-07-14 19:08 Tuan Phan
  2023-07-14 19:08 ` [PATCH v5 1/7] MdePkg/BaseLib: RISC-V: Support getting satp register value Tuan Phan
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Tuan Phan @ 2023-07-14 19:08 UTC (permalink / raw)
  To: devel
  Cc: michael.d.kinney, gaoliming, zhiguang.liu, sunilvl, git,
	andrei.warkentin, ardb+tianocore, Tuan Phan

This series adds MMU support for RISC-V. Only SV39/48/57 modes
are supported and tested. The MMU is required to support setting
page attribute which is the first basic step to support security
booting on RISC-V.

There are two parts:
1. Add MMU base library. MMU will be enabled during
CpuDxe initialization.
2. Fix all resources should be populated in HOB
or added to GCD by driver before accessing when MMU enabled.

All changes can be found in the branch tphan/riscv_mmu at:
https://github.com/pttuan/edk2.git

Changes in V5:
  - Rebased master.
  - Fix CI issue.

Changes in v4:
  - Rebased master.
  - Added VirtNorFlashDxe to APRIORI DXE list.

Changes in v3:
  - Move MMU library to UefiCpuPkg.
  - Add Andrei reviewed-by.

Changes in v2:
  - Move MMU core to a library.
  - Setup SATP mode as highest possible that HW supports.

Tuan Phan (7):
  MdePkg/BaseLib: RISC-V: Support getting satp register value
  MdePkg/Register: RISC-V: Add satp mode bits shift definition
  OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size
  OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform
    devices
  OvmfPkg/RiscVVirt: Add VirtNorFlashDxe to APRIORI list
  OvmfPkg: RiscVVirt: Remove satp bare mode setting
  UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode

 MdePkg/Include/Library/BaseLib.h              |   5 +
 .../Include/Register/RiscV64/RiscVEncoding.h  |   7 +-
 MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S     |   8 +
 .../VirtNorFlashStaticLib.c                   |   3 +-
 OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc           |   1 +
 OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf           |  10 +
 OvmfPkg/RiscVVirt/Sec/Memory.c                |  18 +-
 OvmfPkg/RiscVVirt/Sec/Platform.c              |  62 ++
 UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c             |   9 +-
 UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h             |   2 +
 UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf    |   2 +
 UefiCpuPkg/Include/Library/BaseRiscVMmuLib.h  |  68 ++
 .../Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c | 730 ++++++++++++++++++
 .../BaseRiscVMmuLib/BaseRiscVMmuLib.inf       |  27 +
 .../Library/BaseRiscVMmuLib/RiscVMmuCore.S    |  31 +
 UefiCpuPkg/UefiCpuPkg.dec                     |   5 +
 UefiCpuPkg/UefiCpuPkg.dsc                     |   1 +
 17 files changed, 967 insertions(+), 22 deletions(-)
 create mode 100644 UefiCpuPkg/Include/Library/BaseRiscVMmuLib.h
 create mode 100644 UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c
 create mode 100644 UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf
 create mode 100644 UefiCpuPkg/Library/BaseRiscVMmuLib/RiscVMmuCore.S

-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-07-14 19:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-14 19:08 [PATCH v5 0/7] Add RISC-V MMU support Tuan Phan
2023-07-14 19:08 ` [PATCH v5 1/7] MdePkg/BaseLib: RISC-V: Support getting satp register value Tuan Phan
2023-07-14 19:08 ` [PATCH v5 2/7] MdePkg/Register: RISC-V: Add satp mode bits shift definition Tuan Phan
2023-07-14 19:08 ` [PATCH v5 3/7] OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size Tuan Phan
2023-07-14 19:08 ` [PATCH v5 4/7] OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform devices Tuan Phan
2023-07-14 19:08 ` [PATCH v5 5/7] OvmfPkg/RiscVVirt: Add VirtNorFlashDxe to APRIORI list Tuan Phan
2023-07-14 19:08 ` [PATCH v5 6/7] OvmfPkg: RiscVVirt: Remove satp bare mode setting Tuan Phan
2023-07-14 19:08 ` [PATCH v5 7/7] UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode Tuan Phan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox