From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 60E46AC0F58 for ; Mon, 11 Mar 2024 09:36:56 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=lZWmwF3dNySvOXmCWzTFkUZ+V7Kl1GFYkB+ws74hoTM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1710149815; v=1; b=WDbukxGINhhn8hwjWNUEzSJrWuQz0VXIxfZ20oKVo5hVqk4UEi+YTCQySrStRUKAV288eybP iry2j9uvmInipu9JhJOTHVv9hVaRT6G01UVco8p5/P7kxfwjCszf+5t6v2YlN1/PYQUz+WKxNEc oqTTf7SREbgJSNeNkWyctAmYfUoS+4P83Z3V+jhjkVb/yuOGRPv997++jau3FkK8kbIvwPnKLu7 xsNGNkWPEHCMwwPuHMPIzO6c0frBLQVkxRhnNmSGebQn2AumFDZ2pnm6ek0lkFRbHxJuvKtzlwW dgnuoESHVE1CZv22zDMirio0gmqYYrqrC+y+uuxNiSV+w== X-Received: by 127.0.0.2 with SMTP id no2PYY7687511xr8pCuN1Z0F; Mon, 11 Mar 2024 02:36:55 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web11.58722.1710149812359425558 for ; Mon, 11 Mar 2024 02:36:54 -0700 X-Received: from loongson.cn (unknown [10.2.9.245]) by gateway (Coremail) with SMTP id _____8Axeeis0O5lIhoXAA--.37409S3; Mon, 11 Mar 2024 17:36:44 +0800 (CST) X-Received: from code-server.gen (unknown [10.2.9.245]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxXROp0O5lbCRWAA--.30465S2; Mon, 11 Mar 2024 17:36:41 +0800 (CST) From: "Chao Li" To: devel@edk2.groups.io Cc: Ray Ni , Rahul Kumar , Gerd Hoffmann , Ard Biesheuvel , Jiewen Yao , Leif Lindholm , Sami Mujawar , Sunil V L , Bibo Mao , Dongyan Qian Subject: [edk2-devel] [PATCH v1 00/26] Part 2 patch set to enable LoongArch virtual machine in edk2 Date: Mon, 11 Mar 2024 02:36:54 -0700 Message-Id: <20240311093631.1251466-1-lichao@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxXROp0O5lbCRWAA--.30465S2 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQANCGXuwOYA3wAAs2 X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 1o9rsxVNK8lKCwq4T3aXhtmHx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=WDbukxGI; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io This patch set is the part 2 of enable LoongArch virtual machine and is a continuation of the first patch series v8 submitted at: https://edk2.groups.io/g/devel/message/114526. Patch1-Patch4: Reorder some INF files located in UefiCpuPkg alphabetically. Patch5-Patch14: Added Timer, CpuMmuLib, CpuMmuInitLib, MpInitLib, CpuDxe for LoongArch, and added some PCD and header files requested by the above libraries and drivers. Patch15-Patch25: LoongArch QEMU virtual machine private code, include SEC and PEI phase, some libraries and drivers. Patch26: Added LoongArchVirt's self introduction-file. Modfied modules: UefiCpuPkg and OvmfPkg BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 PR: https://github.com/tianocore/edk2/pull/5208 Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Leif Lindholm Cc: Sami Mujawar Cc: Sunil V L Cc: Bibo Mao Cc: Dongyan Qian Chao Li (26): UefiCpuPkg/CpuTimerLib: Reorder the INF file alphabetically UefiCpuPkg/CpuExceptionHandlerLib: Reorder the INF files alphabetically UefiCpuPkg/MpInitLib: Reorder the INF files alphabetically UefiCpuPkg/CpuDxe: Reorder the INF file alphabetically UefiCpuPkg: Add LoongArch64 CPU Timer instance UefiCpuPkg: Add CPU exception library for LoongArch UefiCpuPkg: Add CpuMmuLib.h to UefiCpuPkg UefiCpuPkg: Added a new PCD named PcdCpuExceptionVectorBaseAddress UefiCpuPkg: Added a new PCD named PcdCpuMmuIsEnabled UefiCpuPkg: Add CpuMmuLib to UefiCpuPkg UefiCpuPkg: Add CpuMmuInitLib.h to UefiCpuPkg UefiCpuPkg: Add CpuMmuInitLib to UefiCpuPkg UefiCpuPkg: Add multiprocessor library for LoongArch64 UefiCpuPkg: Add CpuDxe driver for LoongArch64 OvmfPkg/LoongArchVirt: Add stable timer driver OvmfPkg/LoongArchVirt: Add a NULL library named CollectApResouceLibNull OvmfPkg/LoongArchVirt: Add serial port hook library OvmfPkg/LoongArchVirt: Add the early serial port output library OvmfPkg/LoongArchVirt: Add real time clock library OvmfPkg/LoongArchVirt: Add NorFlashQemuLib OvmfPkg/LoongArchVirt: Add FdtQemuFwCfgLib OvmfPkg/LoongArchVirt: Add reset system library OvmfPkg/LoongArchVirt: Support SEC phase OvmfPkg/LoongArchVirt: Support PEI phase OvmfPkg/LoongArchVirt: Add build file OvmfPkg/LoongArchVirt: Add self introduction file .../Drivers/StableTimerDxe/Timer.c | 381 ++++ .../Drivers/StableTimerDxe/Timer.h | 127 ++ .../Drivers/StableTimerDxe/TimerDxe.inf | 41 + .../CollectApResourceLibNull.c | 38 + .../CollectApResourceLibNull.inf | 31 + .../CollectApResourceLibNull.uni | 9 + .../EarlyFdtSerialPortLib16550.c | 815 +++++++++ .../EarlyFdtSerialPortLib16550.inf | 46 + .../EarlyFdt16550SerialPortHookLib.c | 52 + .../EarlyFdt16550SerialPortHookLib.inf | 37 + .../Fdt16550SerialPortHookLib.c | 39 + .../Fdt16550SerialPortHookLib.inf | 33 + .../Fdt16550SerialPortHookLib.uni | 14 + .../FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.c | 504 +++++ .../FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.inf | 42 + .../FdtQemuFwCfgLib/QemuFwCfgLibInternal.h | 73 + .../Library/FdtQemuFwCfgLib/QemuFwCfgPei.c | 117 ++ .../DxeLsRealTimeClockLib.c | 327 ++++ .../DxeLsRealTimeClockLib.inf | 41 + .../LsRealTimeClockLib/LsRealTimeClock.h | 47 + .../PeiLsRealTimeClockLib.c | 31 + .../PeiLsRealTimeClockLib.inf | 29 + .../Library/NorFlashQemuLib/NorFlashQemuLib.c | 140 ++ .../NorFlashQemuLib/NorFlashQemuLib.inf | 43 + .../BaseResetSystemAcpiGed.c | 148 ++ .../BaseResetSystemAcpiGedLib.inf | 36 + .../DxeResetSystemAcpiGed.c | 259 +++ .../DxeResetSystemAcpiGedLib.inf | 41 + .../ResetSystemAcpiLib/ResetSystemAcpiGed.c | 125 ++ .../ResetSystemAcpiLib/ResetSystemAcpiGed.h | 23 + OvmfPkg/LoongArchVirt/LoongArchVirt.fdf.inc | 34 + OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc | 680 +++++++ OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf | 313 ++++ OvmfPkg/LoongArchVirt/PlatformPei/Fv.c | 39 + OvmfPkg/LoongArchVirt/PlatformPei/MemDetect.c | 202 ++ OvmfPkg/LoongArchVirt/PlatformPei/Platform.c | 393 ++++ OvmfPkg/LoongArchVirt/PlatformPei/Platform.h | 128 ++ .../LoongArchVirt/PlatformPei/PlatformPei.inf | 72 + OvmfPkg/LoongArchVirt/Readme.md | 69 + OvmfPkg/LoongArchVirt/Sec/LoongArch64/Start.S | 184 ++ OvmfPkg/LoongArchVirt/Sec/SecMain.c | 506 +++++ OvmfPkg/LoongArchVirt/Sec/SecMain.inf | 53 + OvmfPkg/LoongArchVirt/VarStore.fdf.inc | 67 + UefiCpuPkg/CpuDxe/CpuDxe.inf | 37 +- UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.c | 426 +++++ UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.h | 288 +++ UefiCpuPkg/CpuDxe/LoongArch64/CpuMp.c | 544 ++++++ UefiCpuPkg/CpuDxe/LoongArch64/Exception.c | 159 ++ UefiCpuPkg/Include/Library/CpuMmuInitLib.h | 34 + UefiCpuPkg/Include/Library/CpuMmuLib.h | 55 + .../DxeCpuExceptionHandlerLib.inf | 37 +- .../LoongArch/DxeExceptionLib.c | 198 ++ .../LoongArch/ExceptionCommon.c | 171 ++ .../LoongArch/ExceptionCommon.h | 131 ++ .../LoongArch64/ArchExceptionHandler.c | 268 +++ .../LoongArch64/ExceptionHandlerAsm.S | 366 ++++ .../LoongArch/SecPeiExceptionLib.c | 102 ++ .../PeiCpuExceptionHandlerLib.inf | 16 +- .../SecPeiCpuExceptionHandlerLib.inf | 31 +- .../SmmCpuExceptionHandlerLib.inf | 16 +- .../Library/CpuMmuInitLib/CpuMmuInitLib.inf | 42 + .../Library/CpuMmuInitLib/CpuMmuInitLib.uni | 14 + .../CpuMmuInitLib/LoongArch64/CpuMmuInit.c | 242 +++ .../LoongArch64/TlbExceptionHandle.S | 51 + .../LoongArch64/TlbExceptionHandle.h | 36 + UefiCpuPkg/Library/CpuMmuLib/CpuMmuLib.inf | 38 + UefiCpuPkg/Library/CpuMmuLib/CpuMmuLib.uni | 14 + .../Library/CpuMmuLib/LoongArch64/CpuMmu.c | 614 +++++++ .../Library/CpuMmuLib/LoongArch64/Page.h | 24 + .../CpuMmuLib/LoongArch64/TlbInvalid.S | 24 + .../CpuMmuLib/LoongArch64/TlbInvalid.h | 24 + .../Library/CpuTimerLib/BaseCpuTimerLib.inf | 17 +- .../CpuTimerLib/LoongArch64/CpuTimerLib.c | 251 +++ UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 39 +- .../Library/MpInitLib/LoongArch64/DxeMpLib.c | 480 +++++ .../Library/MpInitLib/LoongArch64/MpLib.c | 1621 +++++++++++++++++ .../Library/MpInitLib/LoongArch64/MpLib.h | 361 ++++ .../Library/MpInitLib/LoongArch64/PeiMpLib.c | 404 ++++ UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 37 +- UefiCpuPkg/UefiCpuPkg.dec | 17 + UefiCpuPkg/UefiCpuPkg.dsc | 7 + 81 files changed, 13586 insertions(+), 79 deletions(-) create mode 100644 OvmfPkg/LoongArchVirt/Drivers/StableTimerDxe/Timer.c create mode 100644 OvmfPkg/LoongArchVirt/Drivers/StableTimerDxe/Timer.h create mode 100644 OvmfPkg/LoongArchVirt/Drivers/StableTimerDxe/TimerDxe.inf create mode 100644 OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.c create mode 100644 OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.inf create mode 100644 OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.uni create mode 100644 OvmfPkg/LoongArchVirt/Library/EarlyFdtSerialPortLib16550/EarlyFdtSerialPortLib16550.c create mode 100644 OvmfPkg/LoongArchVirt/Library/EarlyFdtSerialPortLib16550/EarlyFdtSerialPortLib16550.inf create mode 100644 OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c create mode 100644 OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.inf create mode 100644 OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.c create mode 100644 OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.inf create mode 100644 OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.uni create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.c create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.inf create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/QemuFwCfgLibInternal.h create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/QemuFwCfgPei.c create mode 100644 OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/DxeLsRealTimeClockLib.c create mode 100644 OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/DxeLsRealTimeClockLib.inf create mode 100644 OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/LsRealTimeClock.h create mode 100644 OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/PeiLsRealTimeClockLib.c create mode 100644 OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/PeiLsRealTimeClockLib.inf create mode 100644 OvmfPkg/LoongArchVirt/Library/NorFlashQemuLib/NorFlashQemuLib.c create mode 100644 OvmfPkg/LoongArchVirt/Library/NorFlashQemuLib/NorFlashQemuLib.inf create mode 100644 OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/BaseResetSystemAcpiGed.c create mode 100644 OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/BaseResetSystemAcpiGedLib.inf create mode 100644 OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/DxeResetSystemAcpiGed.c create mode 100644 OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/DxeResetSystemAcpiGedLib.inf create mode 100644 OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/ResetSystemAcpiGed.c create mode 100644 OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/ResetSystemAcpiGed.h create mode 100644 OvmfPkg/LoongArchVirt/LoongArchVirt.fdf.inc create mode 100644 OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc create mode 100644 OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf create mode 100644 OvmfPkg/LoongArchVirt/PlatformPei/Fv.c create mode 100644 OvmfPkg/LoongArchVirt/PlatformPei/MemDetect.c create mode 100644 OvmfPkg/LoongArchVirt/PlatformPei/Platform.c create mode 100644 OvmfPkg/LoongArchVirt/PlatformPei/Platform.h create mode 100644 OvmfPkg/LoongArchVirt/PlatformPei/PlatformPei.inf create mode 100644 OvmfPkg/LoongArchVirt/Readme.md create mode 100644 OvmfPkg/LoongArchVirt/Sec/LoongArch64/Start.S create mode 100644 OvmfPkg/LoongArchVirt/Sec/SecMain.c create mode 100644 OvmfPkg/LoongArchVirt/Sec/SecMain.inf create mode 100644 OvmfPkg/LoongArchVirt/VarStore.fdf.inc create mode 100644 UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.c create mode 100644 UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.h create mode 100644 UefiCpuPkg/CpuDxe/LoongArch64/CpuMp.c create mode 100644 UefiCpuPkg/CpuDxe/LoongArch64/Exception.c create mode 100644 UefiCpuPkg/Include/Library/CpuMmuInitLib.h create mode 100644 UefiCpuPkg/Include/Library/CpuMmuLib.h create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/DxeExceptionLib.c create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.c create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.h create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/LoongArch64/ArchExceptionHandler.c create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/LoongArch64/ExceptionHandlerAsm.S create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/SecPeiExceptionLib.c create mode 100644 UefiCpuPkg/Library/CpuMmuInitLib/CpuMmuInitLib.inf create mode 100644 UefiCpuPkg/Library/CpuMmuInitLib/CpuMmuInitLib.uni create mode 100644 UefiCpuPkg/Library/CpuMmuInitLib/LoongArch64/CpuMmuInit.c create mode 100644 UefiCpuPkg/Library/CpuMmuInitLib/LoongArch64/TlbExceptionHandle.S create mode 100644 UefiCpuPkg/Library/CpuMmuInitLib/LoongArch64/TlbExceptionHandle.h create mode 100644 UefiCpuPkg/Library/CpuMmuLib/CpuMmuLib.inf create mode 100644 UefiCpuPkg/Library/CpuMmuLib/CpuMmuLib.uni create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/CpuMmu.c create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/Page.h create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/TlbInvalid.S create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/TlbInvalid.h create mode 100644 UefiCpuPkg/Library/CpuTimerLib/LoongArch64/CpuTimerLib.c create mode 100644 UefiCpuPkg/Library/MpInitLib/LoongArch64/DxeMpLib.c create mode 100644 UefiCpuPkg/Library/MpInitLib/LoongArch64/MpLib.c create mode 100644 UefiCpuPkg/Library/MpInitLib/LoongArch64/MpLib.h create mode 100644 UefiCpuPkg/Library/MpInitLib/LoongArch64/PeiMpLib.c -- 2.27.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116583): https://edk2.groups.io/g/devel/message/116583 Mute This Topic: https://groups.io/mt/104859849/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-