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 3DF1FD800C4 for ; Tue, 7 Nov 2023 03:32:05 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4kM+byKmlCSnF0KLxmsQHtOiJQAc3tQ3aJ99udensJ0=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699327923; v=1; b=MzayhiOwEn6iwKt+JUUCF7VQquecoaefnW67rZxLyHqiZZiHFI1B5OGZYrge51Q19aOWH11u q7NsV6nf0vgv2GF1/spqG1tBJe1NLQQDqDDyUYVjrGZLYYc8zHQbl5A4Vf01KucnUNFva/Ouxgb mzoIaapNB03NOE5jJtvp3Dnw= X-Received: by 127.0.0.2 with SMTP id AnwoYY7687511xSJDxVqZzLC; Mon, 06 Nov 2023 19:32:03 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.2771.1699327923411527926 for ; Mon, 06 Nov 2023 19:32:03 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="368756378" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="368756378" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 19:31:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="906270639" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="906270639" X-Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 06 Nov 2023 19:31:40 -0800 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 6 Nov 2023 19:31:39 -0800 X-Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 6 Nov 2023 19:31:32 -0800 X-Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Mon, 6 Nov 2023 19:31:32 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Mon, 6 Nov 2023 19:31:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D5vVYh4nlvwFKbbHdBbRVdxChGKQSIah4iC6DWGSeogV7V2jKCAS4nmQyUZVvpKRaxWVop7+wPODLrrCBmYiiC/OYOCHtIXxMBQTvqdjoCOFxS2TP+zl4zKqmdi907C2fOuYTxws+d7IlA7ZRuMDvD2mj+vEf6Nu7KGzNMwdg6V2aAlueZL/ZwqAbhdcNjYxfvROHIWinwWjCUxpy/c+JarZDylziDJWE5WbJwEr4hrjqsAHZkTfcLZi13N9I7OzHi+K+P6jZoGYX7oe7Gx3GjDp8YpC+Ztz0abgmWcw26p1tnG0tc/p/eJ1hvR89qDKh3vJtrcANv0vqlSQsv0X+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wRcV0RkzemL7FQurYRmTR1cFOYoz4k0i68JfuI/LyKs=; b=FfwrpE53CZt+mAt+qXeX3E8eDVDPhFmPwDGhZNnrKN9WNI8XB78M0pEhk8XOHU+Hr1+3GJgkA9BRNgnlYVnjyhZyeoCSl8A8dJt9YaVEL61Pc7B7EnY5gedfxrOQ5l2pXJP5i4oInnzauCquH58Oz/1fll23qIjRujhTGcXy9+fTlOjENSrp6jsNLs+R0X1cwjW/rlmvG23AB4+9add6Datm3BjYt8OqcRfr1bUKEthVVTtew/qcLfTh+Mmn4rRnQ3I/d8/4yqSeD4P6OY7ZefzoKZXjuNFSul6kekpBg7BO2wPKAlMgKsDfo7OA8ABb0N7N6G9F/aCoU/mRx2c2tA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com (2603:10b6:303:6d::19) by DM8PR11MB5606.namprd11.prod.outlook.com (2603:10b6:8:3c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Tue, 7 Nov 2023 03:31:15 +0000 X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::a2a0:3c59:8d07:7f]) by CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::a2a0:3c59:8d07:7f%6]) with mapi id 15.20.6954.028; Tue, 7 Nov 2023 03:31:15 +0000 From: "Michael D Kinney" To: Chao Li , "devel@edk2.groups.io" CC: "Gao, Liming" , "Liu, Zhiguang" , "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH v2 03/30] MdePkg: Add LoongArch64 exception function set into BaseLib Thread-Topic: [PATCH v2 03/30] MdePkg: Add LoongArch64 exception function set into BaseLib Thread-Index: AQHaEGEdWrPh9itckUuOFPHssQU7FbBuNPDw Date: Tue, 7 Nov 2023 03:31:15 +0000 Message-ID: References: <20231106032521.2251143-1-lichao@loongson.cn> <20231106032648.2267748-1-lichao@loongson.cn> In-Reply-To: <20231106032648.2267748-1-lichao@loongson.cn> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR11MB4929:EE_|DM8PR11MB5606:EE_ x-ms-office365-filtering-correlation-id: 0fb83833-8d0d-476e-d95f-08dbdf41ff95 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: TWHuJVzZX+cnvR8jNig+2b7D9I/U+WGHGi2oxo1WSwBix4Mcb6O41NrAWWZllIJ0kwOD13BdV8JKBFM+7VBij+s/sCqWD4ErQUjrdH5uJAf9Bu+h/BjD4A59rA6wmS4yGdUJJFUayzYjMaGO0eHUh1GD+UbfF2AjUkCsZRs5Lbh4s8pOQfFwWx5u3BpZJTc1lHeT2V9jqqP5vnHy8+TjB1Kb2VYONJKaH2d7jYG5IenSl0ubxFBxDS31Bx/IRWf3aoS/87OcSsxTerGbVBqlM8NHdCqoECmzbjgRb9yi48HvaBiE1qhb1dd5FJlCOBtZIoBVNMoqyF9t7b3we6sWtPHoWW7jViXlY26NMilNkQWxifOs6hFq9gT084o6eOkrzjUI5CYfR9ogLovxA5t1SOWyXu2bZAeg+ZQkucj/KiGpcVQ5OK96pp2kZ8RZBy6Svf/zY6iKkkFDUZ2U+TjY+CdN1zY5ctleCCBRXR+7x+tdMwZCYhBln0JANN1jL0gbTMesPeIJjsC9HU8xUhGrTWGiFfGzgqP3rk9zX3U1fVk5uD99/qmY1MZMTRgOh0koAxEDBA0PcqEh572LzXu6VoUYhfEDh4bYAPR1LHJBZRg= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?aC3mswsqwEln7iS4XWSCKIzM6k4bRXHxxMk9tmpgJeEpd1GKvB6j4kN8oxhf?= =?us-ascii?Q?pu8rHT7MQ51Qqk+ZSLrF1bNDT9tzAczgtfthTvD/eHJvrrhsqnMLX7k1wvTO?= =?us-ascii?Q?EQpmhol0cYXWz0f2XDLZWAFtDOlnqrjFQd5gFTugUIVVfXpR9DCGyZ9mOs/M?= =?us-ascii?Q?oA0l5BUueen1EVYTpc9khEB0NIuuRE1cOCG4qE832Q8hbsQJ9+XShgNhY7h5?= =?us-ascii?Q?NfaMlydcaZt2CSu3gJrJO/zdosaeOBWgKARy45tNGBQC8FMw7085vXvOftJt?= =?us-ascii?Q?idpESMbkZ+cUYBEF082vx2wWLj3gSCd5WNcKF6t1/3MTXfD1BQ1oF8hrGlwZ?= =?us-ascii?Q?/SwWOPvapFNcS1h5vwv5xa5atzjch5bkJx4s/kpWWCwbwk7HVAi84WarzVpG?= =?us-ascii?Q?GYLvc9T9BPOdjl7Lv7PqDxCaOHvUqj+qITM82Wm3moOXgPQR7Zif2z9yEcYU?= =?us-ascii?Q?GPUPIn6W5hZB4i9ki0fyAwenQxkKqGLv1XZTxP0j809rSPA1jCliUTEaXhR4?= =?us-ascii?Q?6IN4YoufzAQ/TZ8EwWKIxkG8kR+gcr+hgeHjD5g7b5chESeIDdgKLRL3HS5g?= =?us-ascii?Q?WZK2HxedX4DdEPNhGrf4B/5B691nr2yUHiNLad/+n8in40LhyOYE5rEjceoN?= =?us-ascii?Q?u0zfJm4kecfi0MPhNDzhLQWaAo9HAl8xYZg/Z7YFPJ+S6SGs2QaWVTzXUnzQ?= =?us-ascii?Q?xceeqpkDOPRBDD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7V6uqRNpam?= =?us-ascii?Q?gQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4929.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fb83833-8d0d-476e-d95f-08dbdf41ff95 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2023 03:31:15.6551 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bl1rjiNKSYhO8ztfZYXIMTqnAMZ+gqcMUf2pe2uGGeeD2rmuyp2JoK+DWknmBb+xjAJL7Stv/tbJodedhpGyzDqdGMa4wBrs1yp8TFrve4I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5606 X-OriginatorOrg: intel.com 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,michael.d.kinney@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: hOGVOC8iCAOTjHKHIhM8kZamx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=MzayhiOw; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Acked-by: Michael D Kinney > -----Original Message----- > From: Chao Li > Sent: Sunday, November 5, 2023 7:27 PM > To: devel@edk2.groups.io > Cc: Kinney, Michael D ; Gao, Liming > ; Liu, Zhiguang > Subject: [PATCH v2 03/30] MdePkg: Add LoongArch64 exception function > set into BaseLib >=20 > Adding SetExceptionBaseAddress and SetTlbRebaseAddress functions > for LoongArch64. >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4584 >=20 > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Signed-off-by: Chao Li > --- > MdePkg/Include/Library/BaseLib.h | 20 +++++++++ > MdePkg/Library/BaseLib/BaseLib.inf | 1 + > .../BaseLib/LoongArch64/ExceptionBase.S | 41 > +++++++++++++++++++ > 3 files changed, 62 insertions(+) > create mode 100644 MdePkg/Library/BaseLib/LoongArch64/ExceptionBase.S >=20 > diff --git a/MdePkg/Include/Library/BaseLib.h > b/MdePkg/Include/Library/BaseLib.h > index 5d7067ee85..a9a69c734c 100644 > --- a/MdePkg/Include/Library/BaseLib.h > +++ b/MdePkg/Include/Library/BaseLib.h > @@ -229,6 +229,26 @@ typedef struct { >=20 > #define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8 >=20 > +/* > + * Set the exception base address for LoongArch. > + * > + * @param ExceptionBaseAddress The exception base address, must be > aligned greater than or qeual to 4K . > + */ > +VOID > +SetExceptionBaseAddress ( > + IN UINT64 > + ); > + > +/* > + * Set the TlbRebase address for LoongArch. > + * > + * @param TlbRebaseAddress The TlbRebase address, must be aligned > greater than or qeual to 4K . > + */ > +VOID > +SetTlbRebaseAddress ( > + IN UINT64 > + ); > + > #endif // defined (MDE_CPU_LOONGARCH64) >=20 > // > diff --git a/MdePkg/Library/BaseLib/BaseLib.inf > b/MdePkg/Library/BaseLib/BaseLib.inf > index 03c7b02e82..a18fe5efb4 100644 > --- a/MdePkg/Library/BaseLib/BaseLib.inf > +++ b/MdePkg/Library/BaseLib/BaseLib.inf > @@ -419,6 +419,7 @@ > LoongArch64/CpuPause.S | GCC > LoongArch64/SetJumpLongJump.S | GCC > LoongArch64/SwitchStack.S | GCC > + LoongArch64/ExceptionBase.S | GCC >=20 > [Packages] > MdePkg/MdePkg.dec > diff --git a/MdePkg/Library/BaseLib/LoongArch64/ExceptionBase.S > b/MdePkg/Library/BaseLib/LoongArch64/ExceptionBase.S > new file mode 100644 > index 0000000000..36c6ca7ca8 > --- /dev/null > +++ b/MdePkg/Library/BaseLib/LoongArch64/ExceptionBase.S > @@ -0,0 +1,41 @@ > +#-------------------------------------------------------------------- > ---------- > +# > +# LoongArch set exception base address operations > +# > +# Copyright (c) 2023, Loongson Technology Corporation Limited. All > rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +#-------------------------------------------------------------------- > ---------- > + > +#include > +#include > + > +ASM_GLOBAL ASM_PFX(SetExceptionBaseAddress) > +ASM_GLOBAL ASM_PFX(SetTlbRebaseAddress) > + > +#/** > +# Set the exception base address for LoongArch. > +# > +# @param ExceptionBaseAddress The exception base address, must be > aligned greater than or qeual to 4K . > +#**/ > +ASM_PFX(SetExceptionBaseAddress): > + csrrd $t0, LOONGARCH_CSR_ECFG > + li.d $t1, ~(BIT16 | BIT17 | BIT18) > + and $t0, $t0, $t1 > + csrwr $t0, LOONGARCH_CSR_ECFG > + > + move $t0, $a0 > + csrwr $t0, LOONGARCH_CSR_EBASE > + jirl $zero, $ra, 0 > + > +#/** > +# Set the TlbRebase address for LoongArch. > +# > +# @param TlbRebaseAddress The TlbRebase address, must be aligned > greater than or qeual to 4K . > +#**/ > +ASM_PFX(SetTlbRebaseAddress): > + move $t0, $a0 > + csrwr $t0, LOONGARCH_CSR_TLBREBASE > + jirl $zero, $ra, 0 > +.end > -- > 2.27.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110794): https://edk2.groups.io/g/devel/message/110794 Mute This Topic: https://groups.io/mt/102413847/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-