From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.groups.io (mail04.groups.io [45.79.224.9]) by spool.mail.gandi.net (Postfix) with ESMTPS id 15986AC0A85 for ; Tue, 16 Apr 2024 02:43:09 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=v2/MzHPs9IW02+JI1Jn6OgONn+T1UHjOBGyGZlf9oBU=; 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:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1713235388; v=1; b=N0MfJo3rd9aZv2pYbDEOwLLi9j+hs+Ov1BeEhudCbK7pAlnT1Z+I5BISr7jc9Gegz9PZokIb Fli8ux9kIQoevwFXGbnMjnaLCkTZGHI+TyewObKwDrVW4PPce61GktMeJ4a/hIZJhjdeReBorCG 0ARj176lZe9dRHGFtnP/vv/4d4BLM6HDYElJLzquJlnLzrOL/lCD0ITefO/I4yHccN/k8Elw78W XyiLrTIAvUVbEQJ6LU//4u3vy3cCvu7tJa23njhTRqTzS4sY99c9stQK6P+oE/WDQqVStgI1bC9 etjflVS6C/olbxVuajPhXK3SQSNV6MAx6ZWK1qSyXZD4w== X-Received: by 127.0.0.2 with SMTP id fI2zYY7687511xtFO8OPeZp8; Mon, 15 Apr 2024 19:43:08 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web10.11028.1713235387281327830 for ; Mon, 15 Apr 2024 19:43:08 -0700 X-Received: from loongson.cn (unknown [10.2.9.245]) by gateway (Coremail) with SMTP id _____8CxZbm25R1mxBMoAA--.9956S3; Tue, 16 Apr 2024 10:43:02 +0800 (CST) X-Received: from code-server.gen (unknown [10.2.9.245]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxJBGz5R1mJF58AA--.30252S2; Tue, 16 Apr 2024 10:42:59 +0800 (CST) From: "Chao Li" To: devel@edk2.groups.io Cc: Ray Ni , Rahul Kumar , Gerd Hoffmann , Sami Mujawar , Sunil V L , Bibo Mao , Dongyan Qian Subject: [edk2-devel] [PATCH v4 00/13] Part 2 patch set to add LoongArch support into UefiCpuPkg Date: Tue, 16 Apr 2024 10:42:51 +0800 Message-Id: <20240416024251.3173738-1-lichao@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8CxJBGz5R1mJF58AA--.30252S2 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQAJCGYc5WsGFwAHsi 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 Resent-Date: Mon, 15 Apr 2024 19:43:08 -0700 Resent-From: lichao@loongson.cn Reply-To: devel@edk2.groups.io,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: dR9g8qmM30zf1I2LRsw3Hq2cx7686176AA= 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=N0MfJo3r; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.9 as permitted sender) smtp.mailfrom=bounce@groups.io This patch set adjusted some order in UefiCpuPig alphabetically, added LoongArch libraries and drivers into UefiCpuPkg, it is a continuation of the first patch series v8 submitted at https://edk2.groups.io/g/devel/message/114526. And also separated from https://edk2.groups.io/g/devel/message/116583. This series only contents the changes for UefiCpuPkg. Patch1-Patch4: Reorder some INF files located in UefiCpuPkg alphabetically. Patch5-Patch13: Added Timer, CpuMmuLib, CpuMmuInitLib, MpInitLib, CpuDxe for LoongArch, and added some PCD and header files requested by the above libraries and drivers. Modfied modules: UefiCpuPkg BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4726 BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4734 PR: https://github.com/tianocore/edk2/pull/5483 V1 -> V2: 1. Removed PcdCpuMmuIsEnabled. 2. Removed API GetMemoryRegionAttributes API as it is no longer needed. 3. Patch3, added two empty line in DXE and PEI INF files. 4. Patch5, added the Status check in GetTimeInnanoSecond function. 5. Separated into two series, this is series one, and the second one is OvmfPkg. V2 -> V3: 1. Remove CpuMmuInitLib. 2. Added a new GUID HOB named PROCESSOR_RESOURCE_HOG_GUID. 3. Following Ray suggest, adjust CpuMmuLib API, rename the API name. 4. Rename the PcdCpuExceptionVectorBaseAddress to PcdLoongArch64ExceptionVectorBaseAddress. 5. Enable CpuMmio2Dxe in LoongArch. V3 -> V4: Patch 10, use flexible arrays in PROCESSOR_RESOURCE_DATA. Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Sami Mujawar Cc: Sunil V L Cc: Bibo Mao Cc: Dongyan Qian Chao Li (13): 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 PcdLoongArchExceptionVectorBaseAddress UefiCpuPkg: Add CpuMmuLib to UefiCpuPkg UefiCpuPkg: Add a new GUID to store the processors resource UefiCpuPkg: Add multiprocessor library for LoongArch64 UefiCpuPkg: Add CpuDxe driver for LoongArch64 UefiCpuPkg/UefiCpuPkg.dsc: Add CpuMmio2Dxe.inf to LoongArch64 field UefiCpuPkg/CpuDxe/CpuDxe.inf | 39 +- UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.c | 514 ++++++ UefiCpuPkg/CpuDxe/LoongArch64/CpuDxe.h | 288 +++ UefiCpuPkg/CpuDxe/LoongArch64/CpuMp.c | 544 ++++++ UefiCpuPkg/CpuDxe/LoongArch64/Exception.c | 159 ++ .../Include/Guid/ProcessorResourceHob.h | 29 + UefiCpuPkg/Include/Library/CpuMmuLib.h | 41 + .../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 +- UefiCpuPkg/Library/CpuMmuLib/CpuMmuLib.inf | 39 + UefiCpuPkg/Library/CpuMmuLib/CpuMmuLib.uni | 14 + .../Library/CpuMmuLib/LoongArch64/CpuMmu.c | 784 ++++++++ .../Library/CpuMmuLib/LoongArch64/Page.h | 33 + .../LoongArch64/TlbExceptionHandle.S | 51 + .../LoongArch64/TlbExceptionHandle.h | 36 + .../CpuMmuLib/LoongArch64/TlbInvalid.S | 24 + .../CpuMmuLib/LoongArch64/TlbInvalid.h | 24 + .../Library/CpuTimerLib/BaseCpuTimerLib.inf | 17 +- .../CpuTimerLib/LoongArch64/CpuTimerLib.c | 250 +++ UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 42 +- .../Library/MpInitLib/LoongArch64/DxeMpLib.c | 480 +++++ .../Library/MpInitLib/LoongArch64/MpLib.c | 1626 +++++++++++++++++ .../Library/MpInitLib/LoongArch64/MpLib.h | 350 ++++ .../Library/MpInitLib/LoongArch64/PeiMpLib.c | 381 ++++ UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 40 +- UefiCpuPkg/UefiCpuPkg.dec | 13 + UefiCpuPkg/UefiCpuPkg.dsc | 7 + 35 files changed, 7082 insertions(+), 79 deletions(-) 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/Guid/ProcessorResourceHob.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/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/TlbExceptionHandle.S create mode 100644 UefiCpuPkg/Library/CpuMmuLib/LoongArch64/TlbExceptionHandle.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 (#117824): https://edk2.groups.io/g/devel/message/117824 Mute This Topic: https://groups.io/mt/105550140/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-