* Re: [edk2-devel] [PATCH v8 00/37] Enable LoongArch virtual machine in edk2 [not found] <17ADD1C0483F8D84.24595@groups.io> @ 2024-01-26 6:43 ` Chao Li [not found] ` <17ADD29C1061FE55.11113@groups.io> 1 sibling, 0 replies; 7+ messages in thread From: Chao Li @ 2024-01-26 6:43 UTC (permalink / raw) To: devel Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Eric Dong, Ray Ni, Rahul Kumar, Gerd Hoffmann, Leif Lindholm, Ard Biesheuvel, Abner Chang, Daniel Schaefer, Sami Mujawar, Jiewen Yao, Jordan Justen, Andrei Warkentin, Laszlo Ersek, Sunil V L, Bibo Mao [-- Attachment #1: Type: text/plain, Size: 25817 bytes --] Hi Ray and Laszlo, Sorry, I was busy the past few days, so V8 was late. Ray, I *removed* your review message in patches 11, 12, 24, 15 and 16, because our adjusted the folders layout, so please review again, thanks. Laszlo, I did what you pointed out, please refer the cover letter, please review, thanks. Thanks, Chao On 2024/1/26 14:27, Chao Li wrote: > This patch set will enable LoongArch virtual machine in edk2, the new > LoongArch virtual machine is located in OvmfPkg/LoongArchVirt/, it is a > generic platform that dose not require any actual hardware. > > Patch1-Patch14: Submit the common library and driver for LoongArch > virtual machine and real hardware. Such as base help functions, > exception handel, MMU library, multiprocessor library etc. > > Patch15-Patch16: Add PrePiCpuIoSize for LoongArch64. and move ArmVirtPkg > two PCDs into OvmfPkg for easier use by other architectures. > > Patch17-Patch29: LoongArch virtual machine private code, include SEC and > PEI phase code, some library and drivers. > > Patch30: Add LoongArchVirt's self introduction-file. > > Modfied modues: MdePkg, UefiCpuPkg, EmbeddedPkg, ArmVirtPkg, OvmfPkg. > > BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=4584 > > PR:https://github.com/tianocore/edk2/pull/5208 > > **Changes from V1 to V2:** > 1. Add Ray's Ack signature to patch 13. > 2. Add LoongArchVirt's self introduction-file. And made a standalone > patch for this change. > > **Changes from V2 to V3:** > Compared with V2, there are 9 more patches, removed 2 libraries and 1 > driver from OvmfPkg/LoongArchVrt. > > New patches: > MdePkg: Add a new library named PeiServicesTablePointerLibReg > MdePkg: Add method of LoongArch64 to PeiServicesTablePointerLibReg > MdePkg: Add a PCD feature flag named PcdPciIoTranslationIsEnabled > UefiCpuPkg: Add MMIO method in CpuIo2Dxe > ArmVirtPkg: Enable UefiCpuPkg version CpuIo2Dxe > ArmPkg: Remove ArmPciCpuIo2Dxe from ArmPkg > OvmfPkg/RiscVVirt: Enable UefiCpuPkg version CpuIo2Dxe > OvmfPkg/RiscVVirt: Remove PciCpuIo2Dxe from RiscVVirt > ArmVirtPkg: Move the FdtSerialPortAddressLib to OvmfPkg > ArmVirtPkg: Move the PcdTerminalTypeGuidBuffer into OvmfPkg > ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg > > For the review opinions: > 1. Add MMIO method to CpuIo2Dxe driver to accommodate more ARCH that > require MMIO method, enable it on ARM, RISCV64 and LOONGARCH64. > Questioner: Gerd, Sunil. > > 2. Move the FdtSerialProtAddressLib to OvmfPkg and enabled it on ARM and > LOONGARCH64. Questioner: Gerd, Laszlo. > > 3. Add a new library in MdePkg named PeiServiceTablePointerLibReg for > the Register Mechanism and enabled it on LOONGARCH64. Questioner: Laszlo. > > 4. Moved the ARM version of PlatformBootManagerLib to OvmfPkg/Library, and > enabled it on ARM and LOONGARCH64. Questioner: Laszlo, Gerd. > > 5. Adjust the order of some inf file in ArmVirtPkg. Questioner: Sami. > > 6. Move the CpuMmuLib.h some architecture-specific PTE #defines into > Csr.h. Questioner: Andrei. > > **Changes from V3 to V4:** > Compared with V3, 1 patch moving ArmPciCpuIo2Dxe has been removed. > Adjusted the code of the LoongArch64 CPU timer library. Rename > PeiServiceTablePointerLibReg to PeiServiceTablePointerLibKs0. Fixed some > typos. Remove some APIs of CpuMmuLib. > > For the review opinions: > 1. Removed the patch that removed ArmPciCpuIo2Dxe, there are 15 platforms > in edk2-platforms were affected, so wait for this patch series to be > merged, then submit a patch to remove it. Questioner: Leif. > > 2. Renamed the PeiServiceTablePointLibReg to PeiServiceTablePointLibKs0. > Currently, this library is specific to LoongArch architecture. > Questioner: Laszlo, Liming. > > 3. Adjust some logic of LoongArch64 CPU timer library. Using the safe > INT library and adjust the bit width of stable counter. Questioner: Laszlo. > > 4. Removed some APIs from CpuMmuLib. Change some APIs to private. > Questioner: Ray. > > **Changes from V4 to V5:** > Compared with V4, 1 patch adding PcdPciIoTranslationIsEnabled in MdePkg > has been removed. > Copy ArmPciCpuIo2Dxe to UefiCpuPkg and renamed it to CpuMmio2Dxe. > Restore the definitions in MdePkg/Include/Protocol/DebugSupport.h, and > just add some comments. > > For the review opinions: > 1. Copy ArmPciCpuIo2Dxe to UefiCpuPkg so that more other ARCHs can use > it easily. Questioner: Ray, Ard. > > 2. Restore the changes of MdePkg/Include/Protocol/DebugSupport.h. > Questioner: Liming. > > 3. Ia32 X64 and LoongArch64 use a same API definition, > InitializeFloatingPointUnits in CpuLib.h. Questioner: Liming. > > 4. Adjust API definition in CpuMmuLib.h. Questioner: Ray. > > **Changes from V5 to V6:** > 1. Added Sunil "Reviewed-by" message to patches 20 and 21. > 2. Added Bibo "Reviced-by" message to patches 27, 29, 32 and 34. > 3. Added the IPI handler in SEC and PEI stage. Modified patches 11 and > 15. > 4. Adjust some code styles to suit CI ECC. > 5. Adjust the way of AP wakeup from IPI. > 6. Adjust the order between setting exceptions and copying exception > handlers. > > **Changes from V6 to V7:** > Compared with V6, 1 patch has been added. > > Added Bibo "Reviewed-by" message to new patches 26, 27, 29, 31, 32, 36, > 37. > > Added Liming "Reviewed-by" message to all MdePkg changes. > > For the review opinions: > 1. Moved the changes to OvmfPkg.dec from old patch 24 to new patch 23. > Questioner: Laszlo. > > 2. Separate the changes to DebugSupport.h from old patch 11 and > create a new patch 10. Questioner: Liming. > > **Changes from V7 to V8:** > Adjusted the folders layout in UefiCpuPkg, most LoongArch64 libraries and > drivers have been placed in current matching folders. > > Removed Ray "Reviewed-by" message to patches 11, 12, 14, 15, 16. Because > them are moved to other current matching folders in UefiCpuPkg, they > need to be reviewed again. > > For the review opinions: > 1. Moved remove FdtSerialPortAddressLib action in ArmVirtPkg.dec from > patch 25 to 23. Questioner: Laszlo. > > 2. Moved removal of ArmVirtPkg.dec dependency in > PlatformBootManagerLib.inf from patch 25 to 24. Questioner: Laszlo. > > Cc: Michael D Kinney<michael.d.kinney@intel.com> > Cc: Liming Gao<gaoliming@byosoft.com.cn> > Cc: Zhiguang Liu<zhiguang.liu@intel.com> > Cc: Eric Dong<eric.dong@intel.com> > Cc: Ray Ni<ray.ni@intel.com> > Cc: Rahul Kumar<rahul1.kumar@intel.com> > Cc: Gerd Hoffmann<kraxel@redhat.com> > Cc: Leif Lindholm<quic_llindhol@quicinc.com> > Cc: Ard Biesheuvel<ardb+tianocore@kernel.org> > Cc: Abner Chang<abner.chang@amd.com> > Cc: Daniel Schaefer<git@danielschaefer.me> > Cc: Sami Mujawar<sami.mujawar@arm.com> > Cc: Jiewen Yao<jiewen.yao@intel.com> > Cc: Jordan Justen<jordan.l.justen@intel.com> > Cc: Andrei Warkentin<andrei.warkentin@intel.com> > Cc: Laszlo Ersek<lersek@redhat.com> > Cc: Sunil V L<sunilvl@ventanamicro.com> > Cc: Bibo Mao<maobibo@loongson.cn> > > Chao Li (37): > MdePkg: Add the header file named Csr.h for LoongArch64 > MdePkg: Add LoongArch64 FPU function set into BaseCpuLib > MdePkg: Add LoongArch64 exception function set into BaseLib > MdePkg: Add LoongArch64 local interrupt function set into BaseLib > MdePkg: Add LoongArch Cpucfg function > MdePkg: Add read stable counter operation for LoongArch > MdePkg: Add CSR operation for LoongArch > MdePkg: Add IOCSR operation for LoongArch > MdePkg: Add a new library named PeiServicesTablePointerLibKs0 > MdePkg: Add some comments for LoongArch exceptions > UefiCpuPkg: Add LoongArch64 CPU Timer instance > UefiCpuPkg: Add CPU exception library for LoongArch > UefiCpuPkg: Add CpuMmuLib.h to UefiCpuPkg > UefiCpuPkg: Add CpuMmuLib to UefiCpuPkg > UefiCpuPkg: Add multiprocessor library for LoongArch64 > UefiCpuPkg: Add CpuDxe driver for LoongArch64 > EmbeddedPkg: Add PcdPrePiCpuIoSize width for LOONGARCH64 > ArmVirtPkg: Move PCD of FDT base address and FDT padding to OvmfPkg > UefiCpuPkg: Add a new CPU IO 2 driver named CpuMmio2Dxe > ArmVirtPkg: Enable CpuMmio2Dxe > OvmfPkg/RiscVVirt: Enable CpuMmio2Dxe > OvmfPkg/RiscVVirt: Remove PciCpuIo2Dxe from RiscVVirt > ArmVirtPkg: Move the FdtSerialPortAddressLib to OvmfPkg > ArmVirtPkg: Move two PCD variables into OvmfPkg > ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg > 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 > > ArmVirtPkg/ArmVirt.dsc.inc | 2 +- > ArmVirtPkg/ArmVirtCloudHv.dsc | 4 +- > ArmVirtPkg/ArmVirtCloudHv.fdf | 2 +- > ArmVirtPkg/ArmVirtKvmTool.dsc | 4 +- > ArmVirtPkg/ArmVirtKvmTool.fdf | 2 +- > ArmVirtPkg/ArmVirtPkg.ci.yaml | 1 - > ArmVirtPkg/ArmVirtPkg.dec | 28 - > ArmVirtPkg/ArmVirtQemu.dsc | 8 +- > ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 2 +- > ArmVirtPkg/ArmVirtQemuKernel.dsc | 8 +- > ArmVirtPkg/ArmVirtXen.dsc | 2 +- > .../ArmVirtPsciResetSystemPeiLib.inf | 3 +- > .../CloudHvVirtMemInfoPeiLib.inf | 3 +- > .../DebugLibFdtPL011UartFlash.inf | 3 +- > .../EarlyFdt16550SerialPortHookLib.inf | 3 +- > .../EarlyFdtPL011SerialPortLib.inf | 3 +- > .../KvmtoolPlatformPeiLib.inf | 5 +- > .../Library/PlatformPeiLib/PlatformPeiLib.inf | 10 +- > .../QemuVirtMemInfoPeiLib.inf | 3 +- > .../PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 3 +- > EmbeddedPkg/EmbeddedPkg.dec | 3 + > MdePkg/Include/Library/BaseLib.h | 221 +++ > MdePkg/Include/Library/CpuLib.h | 43 +- > .../Library/PeiServicesTablePointerLib.h | 9 +- > MdePkg/Include/Protocol/DebugSupport.h | 14 + > MdePkg/Include/Register/LoongArch64/Cpucfg.h | 565 ++++++ > MdePkg/Include/Register/LoongArch64/Csr.h | 263 +++ > MdePkg/Library/BaseCpuLib/BaseCpuLib.inf | 7 +- > .../Library/BaseCpuLib/LoongArch/DisableFpu.S | 17 + > .../Library/BaseCpuLib/LoongArch/EnableFpu.S | 17 + > .../BaseCpuLib/LoongArch/InitializeFpu.S | 51 + > MdePkg/Library/BaseLib/BaseLib.inf | 6 + > MdePkg/Library/BaseLib/LoongArch64/AsmCsr.S | 422 +++++ > MdePkg/Library/BaseLib/LoongArch64/Cpucfg.S | 26 + > MdePkg/Library/BaseLib/LoongArch64/Csr.c | 81 + > .../BaseLib/LoongArch64/DisableInterrupts.S | 22 +- > .../BaseLib/LoongArch64/EnableInterrupts.S | 22 +- > .../BaseLib/LoongArch64/ExceptionBase.S | 41 + > MdePkg/Library/BaseLib/LoongArch64/IoCsr.S | 120 ++ > .../BaseLib/LoongArch64/ReadStableCounter.S | 24 + > .../PeiServicesTablePointer.c | 87 + > .../PeiServicesTablePointerLibKs0.inf | 37 + > .../PeiServicesTablePointerLibKs0.uni | 20 + > MdePkg/MdePkg.ci.yaml | 3 +- > MdePkg/MdePkg.dsc | 3 + > .../Include/Library/FdtSerialPortAddressLib.h | 0 > .../FdtSerialPortAddressLib.c | 0 > .../FdtSerialPortAddressLib.inf | 2 +- > .../PlatformBootManagerLibLight}/PlatformBm.c | 0 > .../PlatformBootManagerLibLight}/PlatformBm.h | 0 > .../PlatformBootManagerLib.inf | 7 +- > .../PlatformBootManagerLibLight}/QemuKernel.c | 0 > .../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 | 679 +++++++ > OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf | 313 ++++ > OvmfPkg/LoongArchVirt/PlatformPei/Fv.c | 39 + > OvmfPkg/LoongArchVirt/PlatformPei/MemDetect.c | 201 ++ > OvmfPkg/LoongArchVirt/PlatformPei/Platform.c | 393 ++++ > OvmfPkg/LoongArchVirt/PlatformPei/Platform.h | 146 ++ > .../LoongArchVirt/PlatformPei/PlatformPei.inf | 72 + > OvmfPkg/LoongArchVirt/Readme.md | 67 + > OvmfPkg/LoongArchVirt/Sec/LoongArch64/Start.S | 184 ++ > OvmfPkg/LoongArchVirt/Sec/SecMain.c | 507 ++++++ > OvmfPkg/LoongArchVirt/Sec/SecMain.inf | 53 + > OvmfPkg/LoongArchVirt/VarStore.fdf.inc | 67 + > OvmfPkg/OvmfPkg.dec | 32 + > OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 2 +- > OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf | 2 +- > UefiCpuPkg/CpuDxe/CpuDxe.inf | 23 +- > UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.c | 454 +++++ > UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.h | 288 +++ > UefiCpuPkg/CpuDxe/LoongArch64/CpuMp.c | 544 ++++++ > UefiCpuPkg/CpuDxe/LoongArch64/Exception.c | 159 ++ > .../CpuMmio2Dxe/CpuMmio2Dxe.c | 8 +- > .../CpuMmio2Dxe/CpuMmio2Dxe.inf | 16 +- > UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.uni | 18 + > UefiCpuPkg/Include/Library/CpuMmuLib.h | 62 + > .../DxeCpuExceptionHandlerLib.inf | 34 +- > .../LoongArch/DxeExceptionLib.c | 198 ++ > .../LoongArch/ExceptionCommon.c | 171 ++ > .../LoongArch/ExceptionCommon.h | 131 ++ > .../LoongArch64/ArchExceptionHandler.c | 268 +++ > .../LoongArch64/ExceptionHandlerAsm.S | 366 ++++ > .../LoongArch/SecPeiExceptionLib.c | 102 ++ > .../SecPeiCpuExceptionHandlerLib.inf | 29 +- > UefiCpuPkg/Library/CpuMmuLib/DxeCpuMmuLib.inf | 36 + > UefiCpuPkg/Library/CpuMmuLib/DxeCpuMmuLib.uni | 14 + > .../CpuMmuLib/LoongArch64/CommonMmuLib.c | 988 ++++++++++ > .../CpuMmuLib/LoongArch64/CommonMmuLib.h | 43 + > .../Library/CpuMmuLib/LoongArch64/Page.h | 279 +++ > .../CpuMmuLib/LoongArch64/PeiCpuMmuLib.c | 178 ++ > .../Library/CpuMmuLib/LoongArch64/Tlb.h | 48 + > .../CpuMmuLib/LoongArch64/TlbOperation.S | 44 + > UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.inf | 44 + > UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.uni | 14 + > .../Library/CpuTimerLib/BaseCpuTimerLib.inf | 9 +- > .../CpuTimerLib/LoongArch64/CpuTimerLib.c | 251 +++ > UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 27 +- > .../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 | 27 +- > UefiCpuPkg/UefiCpuPkg.dec | 9 + > UefiCpuPkg/UefiCpuPkg.dsc | 6 + > 135 files changed, 16320 insertions(+), 146 deletions(-) > create mode 100644 MdePkg/Include/Register/LoongArch64/Cpucfg.h > create mode 100644 MdePkg/Include/Register/LoongArch64/Csr.h > create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/DisableFpu.S > create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/EnableFpu.S > create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/InitializeFpu.S > create mode 100644 MdePkg/Library/BaseLib/LoongArch64/AsmCsr.S > create mode 100644 MdePkg/Library/BaseLib/LoongArch64/Cpucfg.S > create mode 100644 MdePkg/Library/BaseLib/LoongArch64/Csr.c > create mode 100644 MdePkg/Library/BaseLib/LoongArch64/ExceptionBase.S > create mode 100644 MdePkg/Library/BaseLib/LoongArch64/IoCsr.S > create mode 100644 MdePkg/Library/BaseLib/LoongArch64/ReadStableCounter.S > create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointer.c > create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointerLibKs0.inf > create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointerLibKs0.uni > rename {ArmVirtPkg => OvmfPkg}/Include/Library/FdtSerialPortAddressLib.h (100%) > rename {ArmVirtPkg => OvmfPkg}/Library/FdtSerialPortAddressLib/FdtSerialPortAddressLib.c (100%) > rename {ArmVirtPkg => OvmfPkg}/Library/FdtSerialPortAddressLib/FdtSerialPortAddressLib.inf (90%) > rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBm.c (100%) > rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBm.h (100%) > rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBootManagerLib.inf (87%) > rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/QemuKernel.c (100%) > 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 > rename OvmfPkg/RiscVVirt/PciCpuIo2Dxe/PciCpuIo2Dxe.c => UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.c (96%) > rename OvmfPkg/RiscVVirt/PciCpuIo2Dxe/PciCpuIo2Dxe.inf => UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf (61%) > create mode 100644 UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.uni > 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/CpuMmuLib/DxeCpuMmuLib.inf > create mode 100644 UefiCpuPkg/Library/CpuMmuLib/DxeCpuMmuLib.uni > create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/CommonMmuLib.c > create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/CommonMmuLib.h > create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/Page.h > create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/PeiCpuMmuLib.c > create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/Tlb.h > create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/TlbOperation.S > create mode 100644 UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.inf > create mode 100644 UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.uni > 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 (#114564): https://edk2.groups.io/g/devel/message/114564 Mute This Topic: https://groups.io/mt/103971622/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 27594 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <17ADD29C1061FE55.11113@groups.io>]
* Re: [edk2-devel] [PATCH v8 00/37] Enable LoongArch virtual machine in edk2 [not found] ` <17ADD29C1061FE55.11113@groups.io> @ 2024-02-01 8:30 ` Chao Li 2024-02-01 22:23 ` Laszlo Ersek 2024-02-02 3:36 ` Ni, Ray 0 siblings, 2 replies; 7+ messages in thread From: Chao Li @ 2024-02-01 8:30 UTC (permalink / raw) To: devel Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Eric Dong, Ray Ni, Rahul Kumar, Gerd Hoffmann, Leif Lindholm, Ard Biesheuvel, Abner Chang, Daniel Schaefer, Sami Mujawar, Jiewen Yao, Jordan Justen, Andrei Warkentin, Laszlo Ersek, Sunil V L, Bibo Mao [-- Attachment #1: Type: text/plain, Size: 26786 bytes --] Hi Liming, Mike, Ray, Laszlo, Ard, Gerd Leif and Sunil, Since there are some mixed voices regarding patches for UefiCpuPkg, and the stable202402 feature deadline is approaching, so may I suggest that splitting this series into two or more smaller series, and having patches of don't depend on UefiCpuPkg merged into stable202402 first, involving patches 1-10, 17- 25, other patches still need to be reviewed and merged to master later. So what do you suggest? Thanks, Chao On 2024/1/26 14:43, Chao Li wrote: > > Hi Ray and Laszlo, > > Sorry, I was busy the past few days, so V8 was late. > > Ray, I *removed* your review message in patches 11, 12, 24, 15 and 16, > because our adjusted the folders layout, so please review again, thanks. > > Laszlo, I did what you pointed out, please refer the cover letter, > please review, thanks. > > On 2024/1/26 14:27, Chao Li wrote: >> This patch set will enable LoongArch virtual machine in edk2, the new >> LoongArch virtual machine is located in OvmfPkg/LoongArchVirt/, it is a >> generic platform that dose not require any actual hardware. >> >> Patch1-Patch14: Submit the common library and driver for LoongArch >> virtual machine and real hardware. Such as base help functions, >> exception handel, MMU library, multiprocessor library etc. >> >> Patch15-Patch16: Add PrePiCpuIoSize for LoongArch64. and move ArmVirtPkg >> two PCDs into OvmfPkg for easier use by other architectures. >> >> Patch17-Patch29: LoongArch virtual machine private code, include SEC and >> PEI phase code, some library and drivers. >> >> Patch30: Add LoongArchVirt's self introduction-file. >> >> Modfied modues: MdePkg, UefiCpuPkg, EmbeddedPkg, ArmVirtPkg, OvmfPkg. >> >> BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=4584 >> >> PR:https://github.com/tianocore/edk2/pull/5208 >> >> **Changes from V1 to V2:** >> 1. Add Ray's Ack signature to patch 13. >> 2. Add LoongArchVirt's self introduction-file. And made a standalone >> patch for this change. >> >> **Changes from V2 to V3:** >> Compared with V2, there are 9 more patches, removed 2 libraries and 1 >> driver from OvmfPkg/LoongArchVrt. >> >> New patches: >> MdePkg: Add a new library named PeiServicesTablePointerLibReg >> MdePkg: Add method of LoongArch64 to PeiServicesTablePointerLibReg >> MdePkg: Add a PCD feature flag named PcdPciIoTranslationIsEnabled >> UefiCpuPkg: Add MMIO method in CpuIo2Dxe >> ArmVirtPkg: Enable UefiCpuPkg version CpuIo2Dxe >> ArmPkg: Remove ArmPciCpuIo2Dxe from ArmPkg >> OvmfPkg/RiscVVirt: Enable UefiCpuPkg version CpuIo2Dxe >> OvmfPkg/RiscVVirt: Remove PciCpuIo2Dxe from RiscVVirt >> ArmVirtPkg: Move the FdtSerialPortAddressLib to OvmfPkg >> ArmVirtPkg: Move the PcdTerminalTypeGuidBuffer into OvmfPkg >> ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg >> >> For the review opinions: >> 1. Add MMIO method to CpuIo2Dxe driver to accommodate more ARCH that >> require MMIO method, enable it on ARM, RISCV64 and LOONGARCH64. >> Questioner: Gerd, Sunil. >> >> 2. Move the FdtSerialProtAddressLib to OvmfPkg and enabled it on ARM and >> LOONGARCH64. Questioner: Gerd, Laszlo. >> >> 3. Add a new library in MdePkg named PeiServiceTablePointerLibReg for >> the Register Mechanism and enabled it on LOONGARCH64. Questioner: Laszlo. >> >> 4. Moved the ARM version of PlatformBootManagerLib to OvmfPkg/Library, and >> enabled it on ARM and LOONGARCH64. Questioner: Laszlo, Gerd. >> >> 5. Adjust the order of some inf file in ArmVirtPkg. Questioner: Sami. >> >> 6. Move the CpuMmuLib.h some architecture-specific PTE #defines into >> Csr.h. Questioner: Andrei. >> >> **Changes from V3 to V4:** >> Compared with V3, 1 patch moving ArmPciCpuIo2Dxe has been removed. >> Adjusted the code of the LoongArch64 CPU timer library. Rename >> PeiServiceTablePointerLibReg to PeiServiceTablePointerLibKs0. Fixed some >> typos. Remove some APIs of CpuMmuLib. >> >> For the review opinions: >> 1. Removed the patch that removed ArmPciCpuIo2Dxe, there are 15 platforms >> in edk2-platforms were affected, so wait for this patch series to be >> merged, then submit a patch to remove it. Questioner: Leif. >> >> 2. Renamed the PeiServiceTablePointLibReg to PeiServiceTablePointLibKs0. >> Currently, this library is specific to LoongArch architecture. >> Questioner: Laszlo, Liming. >> >> 3. Adjust some logic of LoongArch64 CPU timer library. Using the safe >> INT library and adjust the bit width of stable counter. Questioner: Laszlo. >> >> 4. Removed some APIs from CpuMmuLib. Change some APIs to private. >> Questioner: Ray. >> >> **Changes from V4 to V5:** >> Compared with V4, 1 patch adding PcdPciIoTranslationIsEnabled in MdePkg >> has been removed. >> Copy ArmPciCpuIo2Dxe to UefiCpuPkg and renamed it to CpuMmio2Dxe. >> Restore the definitions in MdePkg/Include/Protocol/DebugSupport.h, and >> just add some comments. >> >> For the review opinions: >> 1. Copy ArmPciCpuIo2Dxe to UefiCpuPkg so that more other ARCHs can use >> it easily. Questioner: Ray, Ard. >> >> 2. Restore the changes of MdePkg/Include/Protocol/DebugSupport.h. >> Questioner: Liming. >> >> 3. Ia32 X64 and LoongArch64 use a same API definition, >> InitializeFloatingPointUnits in CpuLib.h. Questioner: Liming. >> >> 4. Adjust API definition in CpuMmuLib.h. Questioner: Ray. >> >> **Changes from V5 to V6:** >> 1. Added Sunil "Reviewed-by" message to patches 20 and 21. >> 2. Added Bibo "Reviced-by" message to patches 27, 29, 32 and 34. >> 3. Added the IPI handler in SEC and PEI stage. Modified patches 11 and >> 15. >> 4. Adjust some code styles to suit CI ECC. >> 5. Adjust the way of AP wakeup from IPI. >> 6. Adjust the order between setting exceptions and copying exception >> handlers. >> >> **Changes from V6 to V7:** >> Compared with V6, 1 patch has been added. >> >> Added Bibo "Reviewed-by" message to new patches 26, 27, 29, 31, 32, 36, >> 37. >> >> Added Liming "Reviewed-by" message to all MdePkg changes. >> >> For the review opinions: >> 1. Moved the changes to OvmfPkg.dec from old patch 24 to new patch 23. >> Questioner: Laszlo. >> >> 2. Separate the changes to DebugSupport.h from old patch 11 and >> create a new patch 10. Questioner: Liming. >> >> **Changes from V7 to V8:** >> Adjusted the folders layout in UefiCpuPkg, most LoongArch64 libraries and >> drivers have been placed in current matching folders. >> >> Removed Ray "Reviewed-by" message to patches 11, 12, 14, 15, 16. Because >> them are moved to other current matching folders in UefiCpuPkg, they >> need to be reviewed again. >> >> For the review opinions: >> 1. Moved remove FdtSerialPortAddressLib action in ArmVirtPkg.dec from >> patch 25 to 23. Questioner: Laszlo. >> >> 2. Moved removal of ArmVirtPkg.dec dependency in >> PlatformBootManagerLib.inf from patch 25 to 24. Questioner: Laszlo. >> >> Cc: Michael D Kinney<michael.d.kinney@intel.com> >> Cc: Liming Gao<gaoliming@byosoft.com.cn> >> Cc: Zhiguang Liu<zhiguang.liu@intel.com> >> Cc: Eric Dong<eric.dong@intel.com> >> Cc: Ray Ni<ray.ni@intel.com> >> Cc: Rahul Kumar<rahul1.kumar@intel.com> >> Cc: Gerd Hoffmann<kraxel@redhat.com> >> Cc: Leif Lindholm<quic_llindhol@quicinc.com> >> Cc: Ard Biesheuvel<ardb+tianocore@kernel.org> >> Cc: Abner Chang<abner.chang@amd.com> >> Cc: Daniel Schaefer<git@danielschaefer.me> >> Cc: Sami Mujawar<sami.mujawar@arm.com> >> Cc: Jiewen Yao<jiewen.yao@intel.com> >> Cc: Jordan Justen<jordan.l.justen@intel.com> >> Cc: Andrei Warkentin<andrei.warkentin@intel.com> >> Cc: Laszlo Ersek<lersek@redhat.com> >> Cc: Sunil V L<sunilvl@ventanamicro.com> >> Cc: Bibo Mao<maobibo@loongson.cn> >> >> Chao Li (37): >> MdePkg: Add the header file named Csr.h for LoongArch64 >> MdePkg: Add LoongArch64 FPU function set into BaseCpuLib >> MdePkg: Add LoongArch64 exception function set into BaseLib >> MdePkg: Add LoongArch64 local interrupt function set into BaseLib >> MdePkg: Add LoongArch Cpucfg function >> MdePkg: Add read stable counter operation for LoongArch >> MdePkg: Add CSR operation for LoongArch >> MdePkg: Add IOCSR operation for LoongArch >> MdePkg: Add a new library named PeiServicesTablePointerLibKs0 >> MdePkg: Add some comments for LoongArch exceptions >> UefiCpuPkg: Add LoongArch64 CPU Timer instance >> UefiCpuPkg: Add CPU exception library for LoongArch >> UefiCpuPkg: Add CpuMmuLib.h to UefiCpuPkg >> UefiCpuPkg: Add CpuMmuLib to UefiCpuPkg >> UefiCpuPkg: Add multiprocessor library for LoongArch64 >> UefiCpuPkg: Add CpuDxe driver for LoongArch64 >> EmbeddedPkg: Add PcdPrePiCpuIoSize width for LOONGARCH64 >> ArmVirtPkg: Move PCD of FDT base address and FDT padding to OvmfPkg >> UefiCpuPkg: Add a new CPU IO 2 driver named CpuMmio2Dxe >> ArmVirtPkg: Enable CpuMmio2Dxe >> OvmfPkg/RiscVVirt: Enable CpuMmio2Dxe >> OvmfPkg/RiscVVirt: Remove PciCpuIo2Dxe from RiscVVirt >> ArmVirtPkg: Move the FdtSerialPortAddressLib to OvmfPkg >> ArmVirtPkg: Move two PCD variables into OvmfPkg >> ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg >> 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 >> >> ArmVirtPkg/ArmVirt.dsc.inc | 2 +- >> ArmVirtPkg/ArmVirtCloudHv.dsc | 4 +- >> ArmVirtPkg/ArmVirtCloudHv.fdf | 2 +- >> ArmVirtPkg/ArmVirtKvmTool.dsc | 4 +- >> ArmVirtPkg/ArmVirtKvmTool.fdf | 2 +- >> ArmVirtPkg/ArmVirtPkg.ci.yaml | 1 - >> ArmVirtPkg/ArmVirtPkg.dec | 28 - >> ArmVirtPkg/ArmVirtQemu.dsc | 8 +- >> ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 2 +- >> ArmVirtPkg/ArmVirtQemuKernel.dsc | 8 +- >> ArmVirtPkg/ArmVirtXen.dsc | 2 +- >> .../ArmVirtPsciResetSystemPeiLib.inf | 3 +- >> .../CloudHvVirtMemInfoPeiLib.inf | 3 +- >> .../DebugLibFdtPL011UartFlash.inf | 3 +- >> .../EarlyFdt16550SerialPortHookLib.inf | 3 +- >> .../EarlyFdtPL011SerialPortLib.inf | 3 +- >> .../KvmtoolPlatformPeiLib.inf | 5 +- >> .../Library/PlatformPeiLib/PlatformPeiLib.inf | 10 +- >> .../QemuVirtMemInfoPeiLib.inf | 3 +- >> .../PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 3 +- >> EmbeddedPkg/EmbeddedPkg.dec | 3 + >> MdePkg/Include/Library/BaseLib.h | 221 +++ >> MdePkg/Include/Library/CpuLib.h | 43 +- >> .../Library/PeiServicesTablePointerLib.h | 9 +- >> MdePkg/Include/Protocol/DebugSupport.h | 14 + >> MdePkg/Include/Register/LoongArch64/Cpucfg.h | 565 ++++++ >> MdePkg/Include/Register/LoongArch64/Csr.h | 263 +++ >> MdePkg/Library/BaseCpuLib/BaseCpuLib.inf | 7 +- >> .../Library/BaseCpuLib/LoongArch/DisableFpu.S | 17 + >> .../Library/BaseCpuLib/LoongArch/EnableFpu.S | 17 + >> .../BaseCpuLib/LoongArch/InitializeFpu.S | 51 + >> MdePkg/Library/BaseLib/BaseLib.inf | 6 + >> MdePkg/Library/BaseLib/LoongArch64/AsmCsr.S | 422 +++++ >> MdePkg/Library/BaseLib/LoongArch64/Cpucfg.S | 26 + >> MdePkg/Library/BaseLib/LoongArch64/Csr.c | 81 + >> .../BaseLib/LoongArch64/DisableInterrupts.S | 22 +- >> .../BaseLib/LoongArch64/EnableInterrupts.S | 22 +- >> .../BaseLib/LoongArch64/ExceptionBase.S | 41 + >> MdePkg/Library/BaseLib/LoongArch64/IoCsr.S | 120 ++ >> .../BaseLib/LoongArch64/ReadStableCounter.S | 24 + >> .../PeiServicesTablePointer.c | 87 + >> .../PeiServicesTablePointerLibKs0.inf | 37 + >> .../PeiServicesTablePointerLibKs0.uni | 20 + >> MdePkg/MdePkg.ci.yaml | 3 +- >> MdePkg/MdePkg.dsc | 3 + >> .../Include/Library/FdtSerialPortAddressLib.h | 0 >> .../FdtSerialPortAddressLib.c | 0 >> .../FdtSerialPortAddressLib.inf | 2 +- >> .../PlatformBootManagerLibLight}/PlatformBm.c | 0 >> .../PlatformBootManagerLibLight}/PlatformBm.h | 0 >> .../PlatformBootManagerLib.inf | 7 +- >> .../PlatformBootManagerLibLight}/QemuKernel.c | 0 >> .../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 | 679 +++++++ >> OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf | 313 ++++ >> OvmfPkg/LoongArchVirt/PlatformPei/Fv.c | 39 + >> OvmfPkg/LoongArchVirt/PlatformPei/MemDetect.c | 201 ++ >> OvmfPkg/LoongArchVirt/PlatformPei/Platform.c | 393 ++++ >> OvmfPkg/LoongArchVirt/PlatformPei/Platform.h | 146 ++ >> .../LoongArchVirt/PlatformPei/PlatformPei.inf | 72 + >> OvmfPkg/LoongArchVirt/Readme.md | 67 + >> OvmfPkg/LoongArchVirt/Sec/LoongArch64/Start.S | 184 ++ >> OvmfPkg/LoongArchVirt/Sec/SecMain.c | 507 ++++++ >> OvmfPkg/LoongArchVirt/Sec/SecMain.inf | 53 + >> OvmfPkg/LoongArchVirt/VarStore.fdf.inc | 67 + >> OvmfPkg/OvmfPkg.dec | 32 + >> OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 2 +- >> OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf | 2 +- >> UefiCpuPkg/CpuDxe/CpuDxe.inf | 23 +- >> UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.c | 454 +++++ >> UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.h | 288 +++ >> UefiCpuPkg/CpuDxe/LoongArch64/CpuMp.c | 544 ++++++ >> UefiCpuPkg/CpuDxe/LoongArch64/Exception.c | 159 ++ >> .../CpuMmio2Dxe/CpuMmio2Dxe.c | 8 +- >> .../CpuMmio2Dxe/CpuMmio2Dxe.inf | 16 +- >> UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.uni | 18 + >> UefiCpuPkg/Include/Library/CpuMmuLib.h | 62 + >> .../DxeCpuExceptionHandlerLib.inf | 34 +- >> .../LoongArch/DxeExceptionLib.c | 198 ++ >> .../LoongArch/ExceptionCommon.c | 171 ++ >> .../LoongArch/ExceptionCommon.h | 131 ++ >> .../LoongArch64/ArchExceptionHandler.c | 268 +++ >> .../LoongArch64/ExceptionHandlerAsm.S | 366 ++++ >> .../LoongArch/SecPeiExceptionLib.c | 102 ++ >> .../SecPeiCpuExceptionHandlerLib.inf | 29 +- >> UefiCpuPkg/Library/CpuMmuLib/DxeCpuMmuLib.inf | 36 + >> UefiCpuPkg/Library/CpuMmuLib/DxeCpuMmuLib.uni | 14 + >> .../CpuMmuLib/LoongArch64/CommonMmuLib.c | 988 ++++++++++ >> .../CpuMmuLib/LoongArch64/CommonMmuLib.h | 43 + >> .../Library/CpuMmuLib/LoongArch64/Page.h | 279 +++ >> .../CpuMmuLib/LoongArch64/PeiCpuMmuLib.c | 178 ++ >> .../Library/CpuMmuLib/LoongArch64/Tlb.h | 48 + >> .../CpuMmuLib/LoongArch64/TlbOperation.S | 44 + >> UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.inf | 44 + >> UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.uni | 14 + >> .../Library/CpuTimerLib/BaseCpuTimerLib.inf | 9 +- >> .../CpuTimerLib/LoongArch64/CpuTimerLib.c | 251 +++ >> UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 27 +- >> .../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 | 27 +- >> UefiCpuPkg/UefiCpuPkg.dec | 9 + >> UefiCpuPkg/UefiCpuPkg.dsc | 6 + >> 135 files changed, 16320 insertions(+), 146 deletions(-) >> create mode 100644 MdePkg/Include/Register/LoongArch64/Cpucfg.h >> create mode 100644 MdePkg/Include/Register/LoongArch64/Csr.h >> create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/DisableFpu.S >> create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/EnableFpu.S >> create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/InitializeFpu.S >> create mode 100644 MdePkg/Library/BaseLib/LoongArch64/AsmCsr.S >> create mode 100644 MdePkg/Library/BaseLib/LoongArch64/Cpucfg.S >> create mode 100644 MdePkg/Library/BaseLib/LoongArch64/Csr.c >> create mode 100644 MdePkg/Library/BaseLib/LoongArch64/ExceptionBase.S >> create mode 100644 MdePkg/Library/BaseLib/LoongArch64/IoCsr.S >> create mode 100644 MdePkg/Library/BaseLib/LoongArch64/ReadStableCounter.S >> create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointer.c >> create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointerLibKs0.inf >> create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointerLibKs0.uni >> rename {ArmVirtPkg => OvmfPkg}/Include/Library/FdtSerialPortAddressLib.h (100%) >> rename {ArmVirtPkg => OvmfPkg}/Library/FdtSerialPortAddressLib/FdtSerialPortAddressLib.c (100%) >> rename {ArmVirtPkg => OvmfPkg}/Library/FdtSerialPortAddressLib/FdtSerialPortAddressLib.inf (90%) >> rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBm.c (100%) >> rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBm.h (100%) >> rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBootManagerLib.inf (87%) >> rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/QemuKernel.c (100%) >> 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 >> rename OvmfPkg/RiscVVirt/PciCpuIo2Dxe/PciCpuIo2Dxe.c => UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.c (96%) >> rename OvmfPkg/RiscVVirt/PciCpuIo2Dxe/PciCpuIo2Dxe.inf => UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf (61%) >> create mode 100644 UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.uni >> 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/CpuMmuLib/DxeCpuMmuLib.inf >> create mode 100644 UefiCpuPkg/Library/CpuMmuLib/DxeCpuMmuLib.uni >> create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/CommonMmuLib.c >> create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/CommonMmuLib.h >> create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/Page.h >> create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/PeiCpuMmuLib.c >> create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/Tlb.h >> create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/TlbOperation.S >> create mode 100644 UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.inf >> create mode 100644 UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.uni >> 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 (#114936): https://edk2.groups.io/g/devel/message/114936 Mute This Topic: https://groups.io/mt/103971622/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 29153 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [PATCH v8 00/37] Enable LoongArch virtual machine in edk2 2024-02-01 8:30 ` Chao Li @ 2024-02-01 22:23 ` Laszlo Ersek 2024-02-02 2:50 ` Chao Li 2024-02-02 3:36 ` Ni, Ray 1 sibling, 1 reply; 7+ messages in thread From: Laszlo Ersek @ 2024-02-01 22:23 UTC (permalink / raw) To: devel, lichao Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Eric Dong, Ray Ni, Rahul Kumar, Gerd Hoffmann, Leif Lindholm, Ard Biesheuvel, Abner Chang, Daniel Schaefer, Sami Mujawar, Jiewen Yao, Jordan Justen, Andrei Warkentin, Sunil V L, Bibo Mao On 2/1/24 09:30, Chao Li wrote: > Hi Liming, Mike, Ray, Laszlo, Ard, Gerd Leif and Sunil, > > Since there are some mixed voices regarding patches for UefiCpuPkg, and > the stable202402 feature deadline is approaching, so may I suggest that > splitting this series into two or more smaller series, and having > patches of don't depend on UefiCpuPkg merged into stable202402 first, > involving patches 1-10, 17- 25, other patches still need to be reviewed > and merged to master later. So what do you suggest? This sounds good to me. I think you should submit a new series that contains only the patches that you mention above, also picking up any new review tags you've received for v8. This will provide maintainers with a good overview. (And this will be needed anyway for the actual PR.) I think the only missing R-b has been for "[PATCH v8 20/37] ArmVirtPkg: Enable CpuMmio2Dxe", but I have reviewed that patch now. So I believe further patch-level reviews shouldn't be necessary, only an overview of those selected patches organized into a dedicated series. Regards, Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114971): https://edk2.groups.io/g/devel/message/114971 Mute This Topic: https://groups.io/mt/103971622/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [PATCH v8 00/37] Enable LoongArch virtual machine in edk2 2024-02-01 22:23 ` Laszlo Ersek @ 2024-02-02 2:50 ` Chao Li 0 siblings, 0 replies; 7+ messages in thread From: Chao Li @ 2024-02-02 2:50 UTC (permalink / raw) To: Laszlo Ersek, devel Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Eric Dong, Ray Ni, Rahul Kumar, Gerd Hoffmann, Leif Lindholm, Ard Biesheuvel, Abner Chang, Daniel Schaefer, Sami Mujawar, Jiewen Yao, Jordan Justen, Andrei Warkentin, Sunil V L, Bibo Mao [-- Attachment #1: Type: text/plain, Size: 1628 bytes --] OK, the new series has been submitted, it is starting from v1. Thanks, Chao On 2024/2/2 06:23, Laszlo Ersek wrote: > On 2/1/24 09:30, Chao Li wrote: >> Hi Liming, Mike, Ray, Laszlo, Ard, Gerd Leif and Sunil, >> >> Since there are some mixed voices regarding patches for UefiCpuPkg, and >> the stable202402 feature deadline is approaching, so may I suggest that >> splitting this series into two or more smaller series, and having >> patches of don't depend on UefiCpuPkg merged into stable202402 first, >> involving patches 1-10, 17- 25, other patches still need to be reviewed >> and merged to master later. So what do you suggest? > This sounds good to me. > > I think you should submit a new series that contains only the patches > that you mention above, also picking up any new review tags you've > received for v8. This will provide maintainers with a good overview. > (And this will be needed anyway for the actual PR.) > > I think the only missing R-b has been for "[PATCH v8 20/37] ArmVirtPkg: > Enable CpuMmio2Dxe", but I have reviewed that patch now. So I believe > further patch-level reviews shouldn't be necessary, only an overview of > those selected patches organized into a dedicated series. > > Regards, > Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115006): https://edk2.groups.io/g/devel/message/115006 Mute This Topic: https://groups.io/mt/103971622/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 2838 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [PATCH v8 00/37] Enable LoongArch virtual machine in edk2 2024-02-01 8:30 ` Chao Li 2024-02-01 22:23 ` Laszlo Ersek @ 2024-02-02 3:36 ` Ni, Ray 2024-02-02 14:10 ` Laszlo Ersek 1 sibling, 1 reply; 7+ messages in thread From: Ni, Ray @ 2024-02-02 3:36 UTC (permalink / raw) To: devel@edk2.groups.io, lichao@loongson.cn Cc: Kinney, Michael D, Liming Gao, Liu, Zhiguang, Dong, Eric, Kumar, Rahul R, Gerd Hoffmann, Leif Lindholm, Ard Biesheuvel, Abner Chang, Daniel Schaefer, Sami Mujawar, Yao, Jiewen, Justen, Jordan L, Warkentin, Andrei, Laszlo Ersek, Sunil V L, Bibo Mao [-- Attachment #1: Type: text/plain, Size: 28005 bytes --] Chao, When I review the detailed changes, I found a generic issue: Some changes to INF files are not necessary. They are just reordering the source files or libs within the same section. I hope that you could avoid these unnecessary changes. Another point is please make sure do not add unnecessary lib dependencies for x86 (e.g.: SafeIntLib). That might cause some platform build breaks due to not including the SafeIntLib in DSC. Thanks, Ray From: Chao Li <lichao@loongson.cn> Sent: Thursday, February 1, 2024 4:31 PM To: devel@edk2.groups.io Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; Leif Lindholm <quic_llindhol@quicinc.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Abner Chang <abner.chang@amd.com>; Daniel Schaefer <git@danielschaefer.me>; Sami Mujawar <sami.mujawar@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Warkentin, Andrei <andrei.warkentin@intel.com>; Laszlo Ersek <lersek@redhat.com>; Sunil V L <sunilvl@ventanamicro.com>; Bibo Mao <maobibo@loongson.cn> Subject: Re: [edk2-devel] [PATCH v8 00/37] Enable LoongArch virtual machine in edk2 Hi Liming, Mike, Ray, Laszlo, Ard, Gerd Leif and Sunil, Since there are some mixed voices regarding patches for UefiCpuPkg, and the stable202402 feature deadline is approaching, so may I suggest that splitting this series into two or more smaller series, and having patches of don't depend on UefiCpuPkg merged into stable202402 first, involving patches 1-10, 17- 25, other patches still need to be reviewed and merged to master later. So what do you suggest? Thanks, Chao On 2024/1/26 14:43, Chao Li wrote: Hi Ray and Laszlo, Sorry, I was busy the past few days, so V8 was late. Ray, I removed your review message in patches 11, 12, 24, 15 and 16, because our adjusted the folders layout, so please review again, thanks. Laszlo, I did what you pointed out, please refer the cover letter, please review, thanks. On 2024/1/26 14:27, Chao Li wrote: This patch set will enable LoongArch virtual machine in edk2, the new LoongArch virtual machine is located in OvmfPkg/LoongArchVirt/, it is a generic platform that dose not require any actual hardware. Patch1-Patch14: Submit the common library and driver for LoongArch virtual machine and real hardware. Such as base help functions, exception handel, MMU library, multiprocessor library etc. Patch15-Patch16: Add PrePiCpuIoSize for LoongArch64. and move ArmVirtPkg two PCDs into OvmfPkg for easier use by other architectures. Patch17-Patch29: LoongArch virtual machine private code, include SEC and PEI phase code, some library and drivers. Patch30: Add LoongArchVirt's self introduction-file. Modfied modues: MdePkg, UefiCpuPkg, EmbeddedPkg, ArmVirtPkg, OvmfPkg. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 PR: https://github.com/tianocore/edk2/pull/5208 **Changes from V1 to V2:** 1. Add Ray's Ack signature to patch 13. 2. Add LoongArchVirt's self introduction-file. And made a standalone patch for this change. **Changes from V2 to V3:** Compared with V2, there are 9 more patches, removed 2 libraries and 1 driver from OvmfPkg/LoongArchVrt. New patches: MdePkg: Add a new library named PeiServicesTablePointerLibReg MdePkg: Add method of LoongArch64 to PeiServicesTablePointerLibReg MdePkg: Add a PCD feature flag named PcdPciIoTranslationIsEnabled UefiCpuPkg: Add MMIO method in CpuIo2Dxe ArmVirtPkg: Enable UefiCpuPkg version CpuIo2Dxe ArmPkg: Remove ArmPciCpuIo2Dxe from ArmPkg OvmfPkg/RiscVVirt: Enable UefiCpuPkg version CpuIo2Dxe OvmfPkg/RiscVVirt: Remove PciCpuIo2Dxe from RiscVVirt ArmVirtPkg: Move the FdtSerialPortAddressLib to OvmfPkg ArmVirtPkg: Move the PcdTerminalTypeGuidBuffer into OvmfPkg ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg For the review opinions: 1. Add MMIO method to CpuIo2Dxe driver to accommodate more ARCH that require MMIO method, enable it on ARM, RISCV64 and LOONGARCH64. Questioner: Gerd, Sunil. 2. Move the FdtSerialProtAddressLib to OvmfPkg and enabled it on ARM and LOONGARCH64. Questioner: Gerd, Laszlo. 3. Add a new library in MdePkg named PeiServiceTablePointerLibReg for the Register Mechanism and enabled it on LOONGARCH64. Questioner: Laszlo. 4. Moved the ARM version of PlatformBootManagerLib to OvmfPkg/Library, and enabled it on ARM and LOONGARCH64. Questioner: Laszlo, Gerd. 5. Adjust the order of some inf file in ArmVirtPkg. Questioner: Sami. 6. Move the CpuMmuLib.h some architecture-specific PTE #defines into Csr.h. Questioner: Andrei. **Changes from V3 to V4:** Compared with V3, 1 patch moving ArmPciCpuIo2Dxe has been removed. Adjusted the code of the LoongArch64 CPU timer library. Rename PeiServiceTablePointerLibReg to PeiServiceTablePointerLibKs0. Fixed some typos. Remove some APIs of CpuMmuLib. For the review opinions: 1. Removed the patch that removed ArmPciCpuIo2Dxe, there are 15 platforms in edk2-platforms were affected, so wait for this patch series to be merged, then submit a patch to remove it. Questioner: Leif. 2. Renamed the PeiServiceTablePointLibReg to PeiServiceTablePointLibKs0. Currently, this library is specific to LoongArch architecture. Questioner: Laszlo, Liming. 3. Adjust some logic of LoongArch64 CPU timer library. Using the safe INT library and adjust the bit width of stable counter. Questioner: Laszlo. 4. Removed some APIs from CpuMmuLib. Change some APIs to private. Questioner: Ray. **Changes from V4 to V5:** Compared with V4, 1 patch adding PcdPciIoTranslationIsEnabled in MdePkg has been removed. Copy ArmPciCpuIo2Dxe to UefiCpuPkg and renamed it to CpuMmio2Dxe. Restore the definitions in MdePkg/Include/Protocol/DebugSupport.h, and just add some comments. For the review opinions: 1. Copy ArmPciCpuIo2Dxe to UefiCpuPkg so that more other ARCHs can use it easily. Questioner: Ray, Ard. 2. Restore the changes of MdePkg/Include/Protocol/DebugSupport.h. Questioner: Liming. 3. Ia32 X64 and LoongArch64 use a same API definition, InitializeFloatingPointUnits in CpuLib.h. Questioner: Liming. 4. Adjust API definition in CpuMmuLib.h. Questioner: Ray. **Changes from V5 to V6:** 1. Added Sunil "Reviewed-by" message to patches 20 and 21. 2. Added Bibo "Reviced-by" message to patches 27, 29, 32 and 34. 3. Added the IPI handler in SEC and PEI stage. Modified patches 11 and 15. 4. Adjust some code styles to suit CI ECC. 5. Adjust the way of AP wakeup from IPI. 6. Adjust the order between setting exceptions and copying exception handlers. **Changes from V6 to V7:** Compared with V6, 1 patch has been added. Added Bibo "Reviewed-by" message to new patches 26, 27, 29, 31, 32, 36, 37. Added Liming "Reviewed-by" message to all MdePkg changes. For the review opinions: 1. Moved the changes to OvmfPkg.dec from old patch 24 to new patch 23. Questioner: Laszlo. 2. Separate the changes to DebugSupport.h from old patch 11 and create a new patch 10. Questioner: Liming. **Changes from V7 to V8:** Adjusted the folders layout in UefiCpuPkg, most LoongArch64 libraries and drivers have been placed in current matching folders. Removed Ray "Reviewed-by" message to patches 11, 12, 14, 15, 16. Because them are moved to other current matching folders in UefiCpuPkg, they need to be reviewed again. For the review opinions: 1. Moved remove FdtSerialPortAddressLib action in ArmVirtPkg.dec from patch 25 to 23. Questioner: Laszlo. 2. Moved removal of ArmVirtPkg.dec dependency in PlatformBootManagerLib.inf from patch 25 to 24. Questioner: Laszlo. Cc: Michael D Kinney <michael.d.kinney@intel.com><mailto:michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn><mailto:gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com><mailto:zhiguang.liu@intel.com> Cc: Eric Dong <eric.dong@intel.com><mailto:eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com><mailto:ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com><mailto:rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com><mailto:kraxel@redhat.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com><mailto:quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org><mailto:ardb+tianocore@kernel.org> Cc: Abner Chang <abner.chang@amd.com><mailto:abner.chang@amd.com> Cc: Daniel Schaefer <git@danielschaefer.me><mailto:git@danielschaefer.me> Cc: Sami Mujawar <sami.mujawar@arm.com><mailto:sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com><mailto:jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com><mailto:jordan.l.justen@intel.com> Cc: Andrei Warkentin <andrei.warkentin@intel.com><mailto:andrei.warkentin@intel.com> Cc: Laszlo Ersek <lersek@redhat.com><mailto:lersek@redhat.com> Cc: Sunil V L <sunilvl@ventanamicro.com><mailto:sunilvl@ventanamicro.com> Cc: Bibo Mao <maobibo@loongson.cn><mailto:maobibo@loongson.cn> Chao Li (37): MdePkg: Add the header file named Csr.h for LoongArch64 MdePkg: Add LoongArch64 FPU function set into BaseCpuLib MdePkg: Add LoongArch64 exception function set into BaseLib MdePkg: Add LoongArch64 local interrupt function set into BaseLib MdePkg: Add LoongArch Cpucfg function MdePkg: Add read stable counter operation for LoongArch MdePkg: Add CSR operation for LoongArch MdePkg: Add IOCSR operation for LoongArch MdePkg: Add a new library named PeiServicesTablePointerLibKs0 MdePkg: Add some comments for LoongArch exceptions UefiCpuPkg: Add LoongArch64 CPU Timer instance UefiCpuPkg: Add CPU exception library for LoongArch UefiCpuPkg: Add CpuMmuLib.h to UefiCpuPkg UefiCpuPkg: Add CpuMmuLib to UefiCpuPkg UefiCpuPkg: Add multiprocessor library for LoongArch64 UefiCpuPkg: Add CpuDxe driver for LoongArch64 EmbeddedPkg: Add PcdPrePiCpuIoSize width for LOONGARCH64 ArmVirtPkg: Move PCD of FDT base address and FDT padding to OvmfPkg UefiCpuPkg: Add a new CPU IO 2 driver named CpuMmio2Dxe ArmVirtPkg: Enable CpuMmio2Dxe OvmfPkg/RiscVVirt: Enable CpuMmio2Dxe OvmfPkg/RiscVVirt: Remove PciCpuIo2Dxe from RiscVVirt ArmVirtPkg: Move the FdtSerialPortAddressLib to OvmfPkg ArmVirtPkg: Move two PCD variables into OvmfPkg ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg 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 ArmVirtPkg/ArmVirt.dsc.inc | 2 +- ArmVirtPkg/ArmVirtCloudHv.dsc | 4 +- ArmVirtPkg/ArmVirtCloudHv.fdf | 2 +- ArmVirtPkg/ArmVirtKvmTool.dsc | 4 +- ArmVirtPkg/ArmVirtKvmTool.fdf | 2 +- ArmVirtPkg/ArmVirtPkg.ci.yaml | 1 - ArmVirtPkg/ArmVirtPkg.dec | 28 - ArmVirtPkg/ArmVirtQemu.dsc | 8 +- ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 2 +- ArmVirtPkg/ArmVirtQemuKernel.dsc | 8 +- ArmVirtPkg/ArmVirtXen.dsc | 2 +- .../ArmVirtPsciResetSystemPeiLib.inf | 3 +- .../CloudHvVirtMemInfoPeiLib.inf | 3 +- .../DebugLibFdtPL011UartFlash.inf | 3 +- .../EarlyFdt16550SerialPortHookLib.inf | 3 +- .../EarlyFdtPL011SerialPortLib.inf | 3 +- .../KvmtoolPlatformPeiLib.inf | 5 +- .../Library/PlatformPeiLib/PlatformPeiLib.inf | 10 +- .../QemuVirtMemInfoPeiLib.inf | 3 +- .../PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 3 +- EmbeddedPkg/EmbeddedPkg.dec | 3 + MdePkg/Include/Library/BaseLib.h | 221 +++ MdePkg/Include/Library/CpuLib.h | 43 +- .../Library/PeiServicesTablePointerLib.h | 9 +- MdePkg/Include/Protocol/DebugSupport.h | 14 + MdePkg/Include/Register/LoongArch64/Cpucfg.h | 565 ++++++ MdePkg/Include/Register/LoongArch64/Csr.h | 263 +++ MdePkg/Library/BaseCpuLib/BaseCpuLib.inf | 7 +- .../Library/BaseCpuLib/LoongArch/DisableFpu.S | 17 + .../Library/BaseCpuLib/LoongArch/EnableFpu.S | 17 + .../BaseCpuLib/LoongArch/InitializeFpu.S | 51 + MdePkg/Library/BaseLib/BaseLib.inf | 6 + MdePkg/Library/BaseLib/LoongArch64/AsmCsr.S | 422 +++++ MdePkg/Library/BaseLib/LoongArch64/Cpucfg.S | 26 + MdePkg/Library/BaseLib/LoongArch64/Csr.c | 81 + .../BaseLib/LoongArch64/DisableInterrupts.S | 22 +- .../BaseLib/LoongArch64/EnableInterrupts.S | 22 +- .../BaseLib/LoongArch64/ExceptionBase.S | 41 + MdePkg/Library/BaseLib/LoongArch64/IoCsr.S | 120 ++ .../BaseLib/LoongArch64/ReadStableCounter.S | 24 + .../PeiServicesTablePointer.c | 87 + .../PeiServicesTablePointerLibKs0.inf | 37 + .../PeiServicesTablePointerLibKs0.uni | 20 + MdePkg/MdePkg.ci.yaml | 3 +- MdePkg/MdePkg.dsc | 3 + .../Include/Library/FdtSerialPortAddressLib.h | 0 .../FdtSerialPortAddressLib.c | 0 .../FdtSerialPortAddressLib.inf | 2 +- .../PlatformBootManagerLibLight}/PlatformBm.c | 0 .../PlatformBootManagerLibLight}/PlatformBm.h | 0 .../PlatformBootManagerLib.inf | 7 +- .../PlatformBootManagerLibLight}/QemuKernel.c | 0 .../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 | 679 +++++++ OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf | 313 ++++ OvmfPkg/LoongArchVirt/PlatformPei/Fv.c | 39 + OvmfPkg/LoongArchVirt/PlatformPei/MemDetect.c | 201 ++ OvmfPkg/LoongArchVirt/PlatformPei/Platform.c | 393 ++++ OvmfPkg/LoongArchVirt/PlatformPei/Platform.h | 146 ++ .../LoongArchVirt/PlatformPei/PlatformPei.inf | 72 + OvmfPkg/LoongArchVirt/Readme.md | 67 + OvmfPkg/LoongArchVirt/Sec/LoongArch64/Start.S | 184 ++ OvmfPkg/LoongArchVirt/Sec/SecMain.c | 507 ++++++ OvmfPkg/LoongArchVirt/Sec/SecMain.inf | 53 + OvmfPkg/LoongArchVirt/VarStore.fdf.inc | 67 + OvmfPkg/OvmfPkg.dec | 32 + OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 2 +- OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf | 2 +- UefiCpuPkg/CpuDxe/CpuDxe.inf | 23 +- UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.c | 454 +++++ UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.h | 288 +++ UefiCpuPkg/CpuDxe/LoongArch64/CpuMp.c | 544 ++++++ UefiCpuPkg/CpuDxe/LoongArch64/Exception.c | 159 ++ .../CpuMmio2Dxe/CpuMmio2Dxe.c | 8 +- .../CpuMmio2Dxe/CpuMmio2Dxe.inf | 16 +- UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.uni | 18 + UefiCpuPkg/Include/Library/CpuMmuLib.h | 62 + .../DxeCpuExceptionHandlerLib.inf | 34 +- .../LoongArch/DxeExceptionLib.c | 198 ++ .../LoongArch/ExceptionCommon.c | 171 ++ .../LoongArch/ExceptionCommon.h | 131 ++ .../LoongArch64/ArchExceptionHandler.c | 268 +++ .../LoongArch64/ExceptionHandlerAsm.S | 366 ++++ .../LoongArch/SecPeiExceptionLib.c | 102 ++ .../SecPeiCpuExceptionHandlerLib.inf | 29 +- UefiCpuPkg/Library/CpuMmuLib/DxeCpuMmuLib.inf | 36 + UefiCpuPkg/Library/CpuMmuLib/DxeCpuMmuLib.uni | 14 + .../CpuMmuLib/LoongArch64/CommonMmuLib.c | 988 ++++++++++ .../CpuMmuLib/LoongArch64/CommonMmuLib.h | 43 + .../Library/CpuMmuLib/LoongArch64/Page.h | 279 +++ .../CpuMmuLib/LoongArch64/PeiCpuMmuLib.c | 178 ++ .../Library/CpuMmuLib/LoongArch64/Tlb.h | 48 + .../CpuMmuLib/LoongArch64/TlbOperation.S | 44 + UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.inf | 44 + UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.uni | 14 + .../Library/CpuTimerLib/BaseCpuTimerLib.inf | 9 +- .../CpuTimerLib/LoongArch64/CpuTimerLib.c | 251 +++ UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 27 +- .../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 | 27 +- UefiCpuPkg/UefiCpuPkg.dec | 9 + UefiCpuPkg/UefiCpuPkg.dsc | 6 + 135 files changed, 16320 insertions(+), 146 deletions(-) create mode 100644 MdePkg/Include/Register/LoongArch64/Cpucfg.h create mode 100644 MdePkg/Include/Register/LoongArch64/Csr.h create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/DisableFpu.S create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/EnableFpu.S create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/InitializeFpu.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/AsmCsr.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/Cpucfg.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/Csr.c create mode 100644 MdePkg/Library/BaseLib/LoongArch64/ExceptionBase.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/IoCsr.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/ReadStableCounter.S create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointer.c create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointerLibKs0.inf create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointerLibKs0.uni rename {ArmVirtPkg => OvmfPkg}/Include/Library/FdtSerialPortAddressLib.h (100%) rename {ArmVirtPkg => OvmfPkg}/Library/FdtSerialPortAddressLib/FdtSerialPortAddressLib.c (100%) rename {ArmVirtPkg => OvmfPkg}/Library/FdtSerialPortAddressLib/FdtSerialPortAddressLib.inf (90%) rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBm.c (100%) rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBm.h (100%) rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBootManagerLib.inf (87%) rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/QemuKernel.c (100%) 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 rename OvmfPkg/RiscVVirt/PciCpuIo2Dxe/PciCpuIo2Dxe.c => UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.c (96%) rename OvmfPkg/RiscVVirt/PciCpuIo2Dxe/PciCpuIo2Dxe.inf => UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf (61%) create mode 100644 UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.uni 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/CpuMmuLib/DxeCpuMmuLib.inf create mode 100644 UefiCpuPkg/Library/CpuMmuLib/DxeCpuMmuLib.uni create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/CommonMmuLib.c create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/CommonMmuLib.h create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/Page.h create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/PeiCpuMmuLib.c create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/Tlb.h create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/TlbOperation.S create mode 100644 UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.inf create mode 100644 UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.uni 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 (#115011): https://edk2.groups.io/g/devel/message/115011 Mute This Topic: https://groups.io/mt/103971622/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 49157 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [PATCH v8 00/37] Enable LoongArch virtual machine in edk2 2024-02-02 3:36 ` Ni, Ray @ 2024-02-02 14:10 ` Laszlo Ersek 0 siblings, 0 replies; 7+ messages in thread From: Laszlo Ersek @ 2024-02-02 14:10 UTC (permalink / raw) To: Ni, Ray, devel@edk2.groups.io, lichao@loongson.cn Cc: Kinney, Michael D, Liming Gao, Liu, Zhiguang, Dong, Eric, Kumar, Rahul R, Gerd Hoffmann, Leif Lindholm, Ard Biesheuvel, Abner Chang, Daniel Schaefer, Sami Mujawar, Yao, Jiewen, Justen, Jordan L, Warkentin, Andrei, Sunil V L, Bibo Mao On 2/2/24 04:36, Ni, Ray wrote: > Chao, > > When I review the detailed changes, I found a generic issue: > > Some changes to INF files are not necessary. They are just reordering > the source files or libs within the same section. I'm myself a bit torn about this. I generally like to keep entries in [LibraryClasses] etc lexicographically sorted. However, it indeed becomes confusing when a lib class is added or removed *together* with sorting the entire list afresh. I think such changes are worth splitting in to: first, sort the entries (a no-op patch), then implement the change. > > I hope that you could avoid these unnecessary changes. I wouldn't necessarily call them unnecessary. I think sorting / cleanups are worthwhile, but they should be well separated from the other types of changes. > Another point is please make sure do not add unnecessary lib > dependencies for x86 (e.g.: SafeIntLib). That might cause > some platform build breaks due to not including the SafeIntLib in DSC. Can you clarify? SafeIntLib is generally a good idea to *use* in C code, and when one uses it, it must be listed in [LibraryClasses]. I agree that, when we extend an INF file with a new dependency, we should grep edk2 (at least) for platform DSCs that refer to that INF, and see if we have to resolve the lib class. Of course, when the C code doesn't actually consume SafeIntLib APIs, then listing SafeIntLib in the INF file is just a bug. Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115048): https://edk2.groups.io/g/devel/message/115048 Mute This Topic: https://groups.io/mt/103971622/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply [flat|nested] 7+ messages in thread
* [edk2-devel] [PATCH v8 00/37] Enable LoongArch virtual machine in edk2 @ 2024-01-26 6:27 Chao Li 0 siblings, 0 replies; 7+ messages in thread From: Chao Li @ 2024-01-26 6:27 UTC (permalink / raw) To: devel Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Eric Dong, Ray Ni, Rahul Kumar, Gerd Hoffmann, Leif Lindholm, Ard Biesheuvel, Abner Chang, Daniel Schaefer, Sami Mujawar, Jiewen Yao, Jordan Justen, Andrei Warkentin, Laszlo Ersek, Sunil V L, Bibo Mao This patch set will enable LoongArch virtual machine in edk2, the new LoongArch virtual machine is located in OvmfPkg/LoongArchVirt/, it is a generic platform that dose not require any actual hardware. Patch1-Patch14: Submit the common library and driver for LoongArch virtual machine and real hardware. Such as base help functions, exception handel, MMU library, multiprocessor library etc. Patch15-Patch16: Add PrePiCpuIoSize for LoongArch64. and move ArmVirtPkg two PCDs into OvmfPkg for easier use by other architectures. Patch17-Patch29: LoongArch virtual machine private code, include SEC and PEI phase code, some library and drivers. Patch30: Add LoongArchVirt's self introduction-file. Modfied modues: MdePkg, UefiCpuPkg, EmbeddedPkg, ArmVirtPkg, OvmfPkg. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 PR: https://github.com/tianocore/edk2/pull/5208 **Changes from V1 to V2:** 1. Add Ray's Ack signature to patch 13. 2. Add LoongArchVirt's self introduction-file. And made a standalone patch for this change. **Changes from V2 to V3:** Compared with V2, there are 9 more patches, removed 2 libraries and 1 driver from OvmfPkg/LoongArchVrt. New patches: MdePkg: Add a new library named PeiServicesTablePointerLibReg MdePkg: Add method of LoongArch64 to PeiServicesTablePointerLibReg MdePkg: Add a PCD feature flag named PcdPciIoTranslationIsEnabled UefiCpuPkg: Add MMIO method in CpuIo2Dxe ArmVirtPkg: Enable UefiCpuPkg version CpuIo2Dxe ArmPkg: Remove ArmPciCpuIo2Dxe from ArmPkg OvmfPkg/RiscVVirt: Enable UefiCpuPkg version CpuIo2Dxe OvmfPkg/RiscVVirt: Remove PciCpuIo2Dxe from RiscVVirt ArmVirtPkg: Move the FdtSerialPortAddressLib to OvmfPkg ArmVirtPkg: Move the PcdTerminalTypeGuidBuffer into OvmfPkg ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg For the review opinions: 1. Add MMIO method to CpuIo2Dxe driver to accommodate more ARCH that require MMIO method, enable it on ARM, RISCV64 and LOONGARCH64. Questioner: Gerd, Sunil. 2. Move the FdtSerialProtAddressLib to OvmfPkg and enabled it on ARM and LOONGARCH64. Questioner: Gerd, Laszlo. 3. Add a new library in MdePkg named PeiServiceTablePointerLibReg for the Register Mechanism and enabled it on LOONGARCH64. Questioner: Laszlo. 4. Moved the ARM version of PlatformBootManagerLib to OvmfPkg/Library, and enabled it on ARM and LOONGARCH64. Questioner: Laszlo, Gerd. 5. Adjust the order of some inf file in ArmVirtPkg. Questioner: Sami. 6. Move the CpuMmuLib.h some architecture-specific PTE #defines into Csr.h. Questioner: Andrei. **Changes from V3 to V4:** Compared with V3, 1 patch moving ArmPciCpuIo2Dxe has been removed. Adjusted the code of the LoongArch64 CPU timer library. Rename PeiServiceTablePointerLibReg to PeiServiceTablePointerLibKs0. Fixed some typos. Remove some APIs of CpuMmuLib. For the review opinions: 1. Removed the patch that removed ArmPciCpuIo2Dxe, there are 15 platforms in edk2-platforms were affected, so wait for this patch series to be merged, then submit a patch to remove it. Questioner: Leif. 2. Renamed the PeiServiceTablePointLibReg to PeiServiceTablePointLibKs0. Currently, this library is specific to LoongArch architecture. Questioner: Laszlo, Liming. 3. Adjust some logic of LoongArch64 CPU timer library. Using the safe INT library and adjust the bit width of stable counter. Questioner: Laszlo. 4. Removed some APIs from CpuMmuLib. Change some APIs to private. Questioner: Ray. **Changes from V4 to V5:** Compared with V4, 1 patch adding PcdPciIoTranslationIsEnabled in MdePkg has been removed. Copy ArmPciCpuIo2Dxe to UefiCpuPkg and renamed it to CpuMmio2Dxe. Restore the definitions in MdePkg/Include/Protocol/DebugSupport.h, and just add some comments. For the review opinions: 1. Copy ArmPciCpuIo2Dxe to UefiCpuPkg so that more other ARCHs can use it easily. Questioner: Ray, Ard. 2. Restore the changes of MdePkg/Include/Protocol/DebugSupport.h. Questioner: Liming. 3. Ia32 X64 and LoongArch64 use a same API definition, InitializeFloatingPointUnits in CpuLib.h. Questioner: Liming. 4. Adjust API definition in CpuMmuLib.h. Questioner: Ray. **Changes from V5 to V6:** 1. Added Sunil "Reviewed-by" message to patches 20 and 21. 2. Added Bibo "Reviced-by" message to patches 27, 29, 32 and 34. 3. Added the IPI handler in SEC and PEI stage. Modified patches 11 and 15. 4. Adjust some code styles to suit CI ECC. 5. Adjust the way of AP wakeup from IPI. 6. Adjust the order between setting exceptions and copying exception handlers. **Changes from V6 to V7:** Compared with V6, 1 patch has been added. Added Bibo "Reviewed-by" message to new patches 26, 27, 29, 31, 32, 36, 37. Added Liming "Reviewed-by" message to all MdePkg changes. For the review opinions: 1. Moved the changes to OvmfPkg.dec from old patch 24 to new patch 23. Questioner: Laszlo. 2. Separate the changes to DebugSupport.h from old patch 11 and create a new patch 10. Questioner: Liming. **Changes from V7 to V8:** Adjusted the folders layout in UefiCpuPkg, most LoongArch64 libraries and drivers have been placed in current matching folders. Removed Ray "Reviewed-by" message to patches 11, 12, 14, 15, 16. Because them are moved to other current matching folders in UefiCpuPkg, they need to be reviewed again. For the review opinions: 1. Moved remove FdtSerialPortAddressLib action in ArmVirtPkg.dec from patch 25 to 23. Questioner: Laszlo. 2. Moved removal of ArmVirtPkg.dec dependency in PlatformBootManagerLib.inf from patch 25 to 24. Questioner: Laszlo. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Abner Chang <abner.chang@amd.com> Cc: Daniel Schaefer <git@danielschaefer.me> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Andrei Warkentin <andrei.warkentin@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Cc: Bibo Mao <maobibo@loongson.cn> Chao Li (37): MdePkg: Add the header file named Csr.h for LoongArch64 MdePkg: Add LoongArch64 FPU function set into BaseCpuLib MdePkg: Add LoongArch64 exception function set into BaseLib MdePkg: Add LoongArch64 local interrupt function set into BaseLib MdePkg: Add LoongArch Cpucfg function MdePkg: Add read stable counter operation for LoongArch MdePkg: Add CSR operation for LoongArch MdePkg: Add IOCSR operation for LoongArch MdePkg: Add a new library named PeiServicesTablePointerLibKs0 MdePkg: Add some comments for LoongArch exceptions UefiCpuPkg: Add LoongArch64 CPU Timer instance UefiCpuPkg: Add CPU exception library for LoongArch UefiCpuPkg: Add CpuMmuLib.h to UefiCpuPkg UefiCpuPkg: Add CpuMmuLib to UefiCpuPkg UefiCpuPkg: Add multiprocessor library for LoongArch64 UefiCpuPkg: Add CpuDxe driver for LoongArch64 EmbeddedPkg: Add PcdPrePiCpuIoSize width for LOONGARCH64 ArmVirtPkg: Move PCD of FDT base address and FDT padding to OvmfPkg UefiCpuPkg: Add a new CPU IO 2 driver named CpuMmio2Dxe ArmVirtPkg: Enable CpuMmio2Dxe OvmfPkg/RiscVVirt: Enable CpuMmio2Dxe OvmfPkg/RiscVVirt: Remove PciCpuIo2Dxe from RiscVVirt ArmVirtPkg: Move the FdtSerialPortAddressLib to OvmfPkg ArmVirtPkg: Move two PCD variables into OvmfPkg ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg 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 ArmVirtPkg/ArmVirt.dsc.inc | 2 +- ArmVirtPkg/ArmVirtCloudHv.dsc | 4 +- ArmVirtPkg/ArmVirtCloudHv.fdf | 2 +- ArmVirtPkg/ArmVirtKvmTool.dsc | 4 +- ArmVirtPkg/ArmVirtKvmTool.fdf | 2 +- ArmVirtPkg/ArmVirtPkg.ci.yaml | 1 - ArmVirtPkg/ArmVirtPkg.dec | 28 - ArmVirtPkg/ArmVirtQemu.dsc | 8 +- ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 2 +- ArmVirtPkg/ArmVirtQemuKernel.dsc | 8 +- ArmVirtPkg/ArmVirtXen.dsc | 2 +- .../ArmVirtPsciResetSystemPeiLib.inf | 3 +- .../CloudHvVirtMemInfoPeiLib.inf | 3 +- .../DebugLibFdtPL011UartFlash.inf | 3 +- .../EarlyFdt16550SerialPortHookLib.inf | 3 +- .../EarlyFdtPL011SerialPortLib.inf | 3 +- .../KvmtoolPlatformPeiLib.inf | 5 +- .../Library/PlatformPeiLib/PlatformPeiLib.inf | 10 +- .../QemuVirtMemInfoPeiLib.inf | 3 +- .../PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 3 +- EmbeddedPkg/EmbeddedPkg.dec | 3 + MdePkg/Include/Library/BaseLib.h | 221 +++ MdePkg/Include/Library/CpuLib.h | 43 +- .../Library/PeiServicesTablePointerLib.h | 9 +- MdePkg/Include/Protocol/DebugSupport.h | 14 + MdePkg/Include/Register/LoongArch64/Cpucfg.h | 565 ++++++ MdePkg/Include/Register/LoongArch64/Csr.h | 263 +++ MdePkg/Library/BaseCpuLib/BaseCpuLib.inf | 7 +- .../Library/BaseCpuLib/LoongArch/DisableFpu.S | 17 + .../Library/BaseCpuLib/LoongArch/EnableFpu.S | 17 + .../BaseCpuLib/LoongArch/InitializeFpu.S | 51 + MdePkg/Library/BaseLib/BaseLib.inf | 6 + MdePkg/Library/BaseLib/LoongArch64/AsmCsr.S | 422 +++++ MdePkg/Library/BaseLib/LoongArch64/Cpucfg.S | 26 + MdePkg/Library/BaseLib/LoongArch64/Csr.c | 81 + .../BaseLib/LoongArch64/DisableInterrupts.S | 22 +- .../BaseLib/LoongArch64/EnableInterrupts.S | 22 +- .../BaseLib/LoongArch64/ExceptionBase.S | 41 + MdePkg/Library/BaseLib/LoongArch64/IoCsr.S | 120 ++ .../BaseLib/LoongArch64/ReadStableCounter.S | 24 + .../PeiServicesTablePointer.c | 87 + .../PeiServicesTablePointerLibKs0.inf | 37 + .../PeiServicesTablePointerLibKs0.uni | 20 + MdePkg/MdePkg.ci.yaml | 3 +- MdePkg/MdePkg.dsc | 3 + .../Include/Library/FdtSerialPortAddressLib.h | 0 .../FdtSerialPortAddressLib.c | 0 .../FdtSerialPortAddressLib.inf | 2 +- .../PlatformBootManagerLibLight}/PlatformBm.c | 0 .../PlatformBootManagerLibLight}/PlatformBm.h | 0 .../PlatformBootManagerLib.inf | 7 +- .../PlatformBootManagerLibLight}/QemuKernel.c | 0 .../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 | 679 +++++++ OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf | 313 ++++ OvmfPkg/LoongArchVirt/PlatformPei/Fv.c | 39 + OvmfPkg/LoongArchVirt/PlatformPei/MemDetect.c | 201 ++ OvmfPkg/LoongArchVirt/PlatformPei/Platform.c | 393 ++++ OvmfPkg/LoongArchVirt/PlatformPei/Platform.h | 146 ++ .../LoongArchVirt/PlatformPei/PlatformPei.inf | 72 + OvmfPkg/LoongArchVirt/Readme.md | 67 + OvmfPkg/LoongArchVirt/Sec/LoongArch64/Start.S | 184 ++ OvmfPkg/LoongArchVirt/Sec/SecMain.c | 507 ++++++ OvmfPkg/LoongArchVirt/Sec/SecMain.inf | 53 + OvmfPkg/LoongArchVirt/VarStore.fdf.inc | 67 + OvmfPkg/OvmfPkg.dec | 32 + OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 2 +- OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf | 2 +- UefiCpuPkg/CpuDxe/CpuDxe.inf | 23 +- UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.c | 454 +++++ UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.h | 288 +++ UefiCpuPkg/CpuDxe/LoongArch64/CpuMp.c | 544 ++++++ UefiCpuPkg/CpuDxe/LoongArch64/Exception.c | 159 ++ .../CpuMmio2Dxe/CpuMmio2Dxe.c | 8 +- .../CpuMmio2Dxe/CpuMmio2Dxe.inf | 16 +- UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.uni | 18 + UefiCpuPkg/Include/Library/CpuMmuLib.h | 62 + .../DxeCpuExceptionHandlerLib.inf | 34 +- .../LoongArch/DxeExceptionLib.c | 198 ++ .../LoongArch/ExceptionCommon.c | 171 ++ .../LoongArch/ExceptionCommon.h | 131 ++ .../LoongArch64/ArchExceptionHandler.c | 268 +++ .../LoongArch64/ExceptionHandlerAsm.S | 366 ++++ .../LoongArch/SecPeiExceptionLib.c | 102 ++ .../SecPeiCpuExceptionHandlerLib.inf | 29 +- UefiCpuPkg/Library/CpuMmuLib/DxeCpuMmuLib.inf | 36 + UefiCpuPkg/Library/CpuMmuLib/DxeCpuMmuLib.uni | 14 + .../CpuMmuLib/LoongArch64/CommonMmuLib.c | 988 ++++++++++ .../CpuMmuLib/LoongArch64/CommonMmuLib.h | 43 + .../Library/CpuMmuLib/LoongArch64/Page.h | 279 +++ .../CpuMmuLib/LoongArch64/PeiCpuMmuLib.c | 178 ++ .../Library/CpuMmuLib/LoongArch64/Tlb.h | 48 + .../CpuMmuLib/LoongArch64/TlbOperation.S | 44 + UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.inf | 44 + UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.uni | 14 + .../Library/CpuTimerLib/BaseCpuTimerLib.inf | 9 +- .../CpuTimerLib/LoongArch64/CpuTimerLib.c | 251 +++ UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 27 +- .../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 | 27 +- UefiCpuPkg/UefiCpuPkg.dec | 9 + UefiCpuPkg/UefiCpuPkg.dsc | 6 + 135 files changed, 16320 insertions(+), 146 deletions(-) create mode 100644 MdePkg/Include/Register/LoongArch64/Cpucfg.h create mode 100644 MdePkg/Include/Register/LoongArch64/Csr.h create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/DisableFpu.S create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/EnableFpu.S create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/InitializeFpu.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/AsmCsr.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/Cpucfg.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/Csr.c create mode 100644 MdePkg/Library/BaseLib/LoongArch64/ExceptionBase.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/IoCsr.S create mode 100644 MdePkg/Library/BaseLib/LoongArch64/ReadStableCounter.S create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointer.c create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointerLibKs0.inf create mode 100644 MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointerLibKs0.uni rename {ArmVirtPkg => OvmfPkg}/Include/Library/FdtSerialPortAddressLib.h (100%) rename {ArmVirtPkg => OvmfPkg}/Library/FdtSerialPortAddressLib/FdtSerialPortAddressLib.c (100%) rename {ArmVirtPkg => OvmfPkg}/Library/FdtSerialPortAddressLib/FdtSerialPortAddressLib.inf (90%) rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBm.c (100%) rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBm.h (100%) rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/PlatformBootManagerLib.inf (87%) rename {ArmVirtPkg/Library/PlatformBootManagerLib => OvmfPkg/Library/PlatformBootManagerLibLight}/QemuKernel.c (100%) 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 rename OvmfPkg/RiscVVirt/PciCpuIo2Dxe/PciCpuIo2Dxe.c => UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.c (96%) rename OvmfPkg/RiscVVirt/PciCpuIo2Dxe/PciCpuIo2Dxe.inf => UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf (61%) create mode 100644 UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.uni 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/CpuMmuLib/DxeCpuMmuLib.inf create mode 100644 UefiCpuPkg/Library/CpuMmuLib/DxeCpuMmuLib.uni create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/CommonMmuLib.c create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/CommonMmuLib.h create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/Page.h create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/PeiCpuMmuLib.c create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/Tlb.h create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/TlbOperation.S create mode 100644 UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.inf create mode 100644 UefiCpuPkg/Library/CpuMmuLib/PeiCpuMmuLib.uni 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 -- 2.27.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114526): https://edk2.groups.io/g/devel/message/114526 Mute This Topic: https://groups.io/mt/103971622/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-02-02 14:10 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <17ADD1C0483F8D84.24595@groups.io> 2024-01-26 6:43 ` [edk2-devel] [PATCH v8 00/37] Enable LoongArch virtual machine in edk2 Chao Li [not found] ` <17ADD29C1061FE55.11113@groups.io> 2024-02-01 8:30 ` Chao Li 2024-02-01 22:23 ` Laszlo Ersek 2024-02-02 2:50 ` Chao Li 2024-02-02 3:36 ` Ni, Ray 2024-02-02 14:10 ` Laszlo Ersek 2024-01-26 6:27 Chao Li
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox