Hi All,

I submitted this version a few days ago and any comments are very welcome, can you review this series?


Thanks,
Chao
On 2024/3/11 17:36, Chao Li wrote:
This patch set is the part 2 of enable LoongArch virtual machine and is
a continuation of the first patch series v8 submitted at:
https://edk2.groups.io/g/devel/message/114526.

Patch1-Patch4: Reorder some INF files located in UefiCpuPkg
alphabetically.

Patch5-Patch14: Added Timer, CpuMmuLib, CpuMmuInitLib, MpInitLib, CpuDxe
for LoongArch, and added some PCD and header files requested by the
above libraries and drivers.

Patch15-Patch25: LoongArch QEMU virtual machine private code, include
SEC and PEI phase, some libraries and drivers.

Patch26: Added LoongArchVirt's self introduction-file.

Modfied modules: UefiCpuPkg and OvmfPkg

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

PR: https://github.com/tianocore/edk2/pull/5208

Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Dongyan Qian <qiandongyan@loongson.cn>

Chao Li (26):
  UefiCpuPkg/CpuTimerLib: Reorder the INF file alphabetically
  UefiCpuPkg/CpuExceptionHandlerLib: Reorder the INF files
    alphabetically
  UefiCpuPkg/MpInitLib: Reorder the INF files alphabetically
  UefiCpuPkg/CpuDxe: Reorder the INF file alphabetically
  UefiCpuPkg: Add LoongArch64 CPU Timer instance
  UefiCpuPkg: Add CPU exception library for LoongArch
  UefiCpuPkg: Add CpuMmuLib.h to UefiCpuPkg
  UefiCpuPkg: Added a new PCD named PcdCpuExceptionVectorBaseAddress
  UefiCpuPkg: Added a new PCD named PcdCpuMmuIsEnabled
  UefiCpuPkg: Add CpuMmuLib to UefiCpuPkg
  UefiCpuPkg: Add CpuMmuInitLib.h to UefiCpuPkg
  UefiCpuPkg: Add CpuMmuInitLib to UefiCpuPkg
  UefiCpuPkg: Add multiprocessor library for LoongArch64
  UefiCpuPkg: Add CpuDxe driver for LoongArch64
  OvmfPkg/LoongArchVirt: Add stable timer driver
  OvmfPkg/LoongArchVirt: Add a NULL library named
    CollectApResouceLibNull
  OvmfPkg/LoongArchVirt: Add serial port hook library
  OvmfPkg/LoongArchVirt: Add the early serial port output library
  OvmfPkg/LoongArchVirt: Add real time clock library
  OvmfPkg/LoongArchVirt: Add NorFlashQemuLib
  OvmfPkg/LoongArchVirt: Add FdtQemuFwCfgLib
  OvmfPkg/LoongArchVirt: Add reset system library
  OvmfPkg/LoongArchVirt: Support SEC phase
  OvmfPkg/LoongArchVirt: Support PEI phase
  OvmfPkg/LoongArchVirt: Add build file
  OvmfPkg/LoongArchVirt: Add self introduction file

 .../Drivers/StableTimerDxe/Timer.c            |  381 ++++
 .../Drivers/StableTimerDxe/Timer.h            |  127 ++
 .../Drivers/StableTimerDxe/TimerDxe.inf       |   41 +
 .../CollectApResourceLibNull.c                |   38 +
 .../CollectApResourceLibNull.inf              |   31 +
 .../CollectApResourceLibNull.uni              |    9 +
 .../EarlyFdtSerialPortLib16550.c              |  815 +++++++++
 .../EarlyFdtSerialPortLib16550.inf            |   46 +
 .../EarlyFdt16550SerialPortHookLib.c          |   52 +
 .../EarlyFdt16550SerialPortHookLib.inf        |   37 +
 .../Fdt16550SerialPortHookLib.c               |   39 +
 .../Fdt16550SerialPortHookLib.inf             |   33 +
 .../Fdt16550SerialPortHookLib.uni             |   14 +
 .../FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.c      |  504 +++++
 .../FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.inf    |   42 +
 .../FdtQemuFwCfgLib/QemuFwCfgLibInternal.h    |   73 +
 .../Library/FdtQemuFwCfgLib/QemuFwCfgPei.c    |  117 ++
 .../DxeLsRealTimeClockLib.c                   |  327 ++++
 .../DxeLsRealTimeClockLib.inf                 |   41 +
 .../LsRealTimeClockLib/LsRealTimeClock.h      |   47 +
 .../PeiLsRealTimeClockLib.c                   |   31 +
 .../PeiLsRealTimeClockLib.inf                 |   29 +
 .../Library/NorFlashQemuLib/NorFlashQemuLib.c |  140 ++
 .../NorFlashQemuLib/NorFlashQemuLib.inf       |   43 +
 .../BaseResetSystemAcpiGed.c                  |  148 ++
 .../BaseResetSystemAcpiGedLib.inf             |   36 +
 .../DxeResetSystemAcpiGed.c                   |  259 +++
 .../DxeResetSystemAcpiGedLib.inf              |   41 +
 .../ResetSystemAcpiLib/ResetSystemAcpiGed.c   |  125 ++
 .../ResetSystemAcpiLib/ResetSystemAcpiGed.h   |   23 +
 OvmfPkg/LoongArchVirt/LoongArchVirt.fdf.inc   |   34 +
 OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc   |  680 +++++++
 OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf   |  313 ++++
 OvmfPkg/LoongArchVirt/PlatformPei/Fv.c        |   39 +
 OvmfPkg/LoongArchVirt/PlatformPei/MemDetect.c |  202 ++
 OvmfPkg/LoongArchVirt/PlatformPei/Platform.c  |  393 ++++
 OvmfPkg/LoongArchVirt/PlatformPei/Platform.h  |  128 ++
 .../LoongArchVirt/PlatformPei/PlatformPei.inf |   72 +
 OvmfPkg/LoongArchVirt/Readme.md               |   69 +
 OvmfPkg/LoongArchVirt/Sec/LoongArch64/Start.S |  184 ++
 OvmfPkg/LoongArchVirt/Sec/SecMain.c           |  506 +++++
 OvmfPkg/LoongArchVirt/Sec/SecMain.inf         |   53 +
 OvmfPkg/LoongArchVirt/VarStore.fdf.inc        |   67 +
 UefiCpuPkg/CpuDxe/CpuDxe.inf                  |   37 +-
 UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.c        |  426 +++++
 UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.h        |  288 +++
 UefiCpuPkg/CpuDxe/LoongArch64/CpuMp.c         |  544 ++++++
 UefiCpuPkg/CpuDxe/LoongArch64/Exception.c     |  159 ++
 UefiCpuPkg/Include/Library/CpuMmuInitLib.h    |   34 +
 UefiCpuPkg/Include/Library/CpuMmuLib.h        |   55 +
 .../DxeCpuExceptionHandlerLib.inf             |   37 +-
 .../LoongArch/DxeExceptionLib.c               |  198 ++
 .../LoongArch/ExceptionCommon.c               |  171 ++
 .../LoongArch/ExceptionCommon.h               |  131 ++
 .../LoongArch64/ArchExceptionHandler.c        |  268 +++
 .../LoongArch64/ExceptionHandlerAsm.S         |  366 ++++
 .../LoongArch/SecPeiExceptionLib.c            |  102 ++
 .../PeiCpuExceptionHandlerLib.inf             |   16 +-
 .../SecPeiCpuExceptionHandlerLib.inf          |   31 +-
 .../SmmCpuExceptionHandlerLib.inf             |   16 +-
 .../Library/CpuMmuInitLib/CpuMmuInitLib.inf   |   42 +
 .../Library/CpuMmuInitLib/CpuMmuInitLib.uni   |   14 +
 .../CpuMmuInitLib/LoongArch64/CpuMmuInit.c    |  242 +++
 .../LoongArch64/TlbExceptionHandle.S          |   51 +
 .../LoongArch64/TlbExceptionHandle.h          |   36 +
 UefiCpuPkg/Library/CpuMmuLib/CpuMmuLib.inf    |   38 +
 UefiCpuPkg/Library/CpuMmuLib/CpuMmuLib.uni    |   14 +
 .../Library/CpuMmuLib/LoongArch64/CpuMmu.c    |  614 +++++++
 .../Library/CpuMmuLib/LoongArch64/Page.h      |   24 +
 .../CpuMmuLib/LoongArch64/TlbInvalid.S        |   24 +
 .../CpuMmuLib/LoongArch64/TlbInvalid.h        |   24 +
 .../Library/CpuTimerLib/BaseCpuTimerLib.inf   |   17 +-
 .../CpuTimerLib/LoongArch64/CpuTimerLib.c     |  251 +++
 UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |   39 +-
 .../Library/MpInitLib/LoongArch64/DxeMpLib.c  |  480 +++++
 .../Library/MpInitLib/LoongArch64/MpLib.c     | 1621 +++++++++++++++++
 .../Library/MpInitLib/LoongArch64/MpLib.h     |  361 ++++
 .../Library/MpInitLib/LoongArch64/PeiMpLib.c  |  404 ++++
 UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |   37 +-
 UefiCpuPkg/UefiCpuPkg.dec                     |   17 +
 UefiCpuPkg/UefiCpuPkg.dsc                     |    7 +
 81 files changed, 13586 insertions(+), 79 deletions(-)
 create mode 100644 OvmfPkg/LoongArchVirt/Drivers/StableTimerDxe/Timer.c
 create mode 100644 OvmfPkg/LoongArchVirt/Drivers/StableTimerDxe/Timer.h
 create mode 100644 OvmfPkg/LoongArchVirt/Drivers/StableTimerDxe/TimerDxe.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.uni
 create mode 100644 OvmfPkg/LoongArchVirt/Library/EarlyFdtSerialPortLib16550/EarlyFdtSerialPortLib16550.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/EarlyFdtSerialPortLib16550/EarlyFdtSerialPortLib16550.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.uni
 create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/QemuFwCfgLibInternal.h
 create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/QemuFwCfgPei.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/DxeLsRealTimeClockLib.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/DxeLsRealTimeClockLib.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/LsRealTimeClock.h
 create mode 100644 OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/PeiLsRealTimeClockLib.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/PeiLsRealTimeClockLib.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Library/NorFlashQemuLib/NorFlashQemuLib.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/NorFlashQemuLib/NorFlashQemuLib.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/BaseResetSystemAcpiGed.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/BaseResetSystemAcpiGedLib.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/DxeResetSystemAcpiGed.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/DxeResetSystemAcpiGedLib.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/ResetSystemAcpiGed.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/ResetSystemAcpiGed.h
 create mode 100644 OvmfPkg/LoongArchVirt/LoongArchVirt.fdf.inc
 create mode 100644 OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc
 create mode 100644 OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf
 create mode 100644 OvmfPkg/LoongArchVirt/PlatformPei/Fv.c
 create mode 100644 OvmfPkg/LoongArchVirt/PlatformPei/MemDetect.c
 create mode 100644 OvmfPkg/LoongArchVirt/PlatformPei/Platform.c
 create mode 100644 OvmfPkg/LoongArchVirt/PlatformPei/Platform.h
 create mode 100644 OvmfPkg/LoongArchVirt/PlatformPei/PlatformPei.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Readme.md
 create mode 100644 OvmfPkg/LoongArchVirt/Sec/LoongArch64/Start.S
 create mode 100644 OvmfPkg/LoongArchVirt/Sec/SecMain.c
 create mode 100644 OvmfPkg/LoongArchVirt/Sec/SecMain.inf
 create mode 100644 OvmfPkg/LoongArchVirt/VarStore.fdf.inc
 create mode 100644 UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.c
 create mode 100644 UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.h
 create mode 100644 UefiCpuPkg/CpuDxe/LoongArch64/CpuMp.c
 create mode 100644 UefiCpuPkg/CpuDxe/LoongArch64/Exception.c
 create mode 100644 UefiCpuPkg/Include/Library/CpuMmuInitLib.h
 create mode 100644 UefiCpuPkg/Include/Library/CpuMmuLib.h
 create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/DxeExceptionLib.c
 create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.c
 create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.h
 create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/LoongArch64/ArchExceptionHandler.c
 create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/LoongArch64/ExceptionHandlerAsm.S
 create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/SecPeiExceptionLib.c
 create mode 100644 UefiCpuPkg/Library/CpuMmuInitLib/CpuMmuInitLib.inf
 create mode 100644 UefiCpuPkg/Library/CpuMmuInitLib/CpuMmuInitLib.uni
 create mode 100644 UefiCpuPkg/Library/CpuMmuInitLib/LoongArch64/CpuMmuInit.c
 create mode 100644 UefiCpuPkg/Library/CpuMmuInitLib/LoongArch64/TlbExceptionHandle.S
 create mode 100644 UefiCpuPkg/Library/CpuMmuInitLib/LoongArch64/TlbExceptionHandle.h
 create mode 100644 UefiCpuPkg/Library/CpuMmuLib/CpuMmuLib.inf
 create mode 100644 UefiCpuPkg/Library/CpuMmuLib/CpuMmuLib.uni
 create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/CpuMmu.c
 create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/Page.h
 create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/TlbInvalid.S
 create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/TlbInvalid.h
 create mode 100644 UefiCpuPkg/Library/CpuTimerLib/LoongArch64/CpuTimerLib.c
 create mode 100644 UefiCpuPkg/Library/MpInitLib/LoongArch64/DxeMpLib.c
 create mode 100644 UefiCpuPkg/Library/MpInitLib/LoongArch64/MpLib.c
 create mode 100644 UefiCpuPkg/Library/MpInitLib/LoongArch64/MpLib.h
 create mode 100644 UefiCpuPkg/Library/MpInitLib/LoongArch64/PeiMpLib.c

_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116724) | | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_