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 972EF780091 for ; Tue, 7 Nov 2023 03:31:37 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=7h93xVfCZrXwCOgzgDst5oKtG8pTGHe4paLEYvgdPdE=; 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=1699327896; v=1; b=aUnuj1p4XD80LKhNl3FVOLnJxVrNRHs6wcgXh7l4Ekp9K8yoa0DQ1LNRBAyFhYfJU0dBj1uy aFwvR4/so0aYbLAx3Ql6PZ3ulkcmjr3HrKFCU0QNKm0XRJVKKFErzHOhb4v7GqXveJfXFbF5dxW W8FsK+ag2aBaa1xs51FbbL7g= X-Received: by 127.0.0.2 with SMTP id MZtbYY7687511xigneIhwkpq; Mon, 06 Nov 2023 19:31:36 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.2757.1699327895623848250 for ; Mon, 06 Nov 2023 19:31:35 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="453731744" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="453731744" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 19:31:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="791669184" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="791669184" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga008.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 06 Nov 2023 19:31:34 -0800 X-Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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:34 -0800 X-Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX612.amr.corp.intel.com (10.22.229.25) 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:33 -0800 X-Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx602.amr.corp.intel.com (10.22.229.15) 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:33 -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:33 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RdJC6u+YmxOpiM3cF9MbY5lliaJRhiYD/ZS+GqmKne29Qzyi3p+r5aOwORQ2VDpjtVgU1d9GnSavrNuficCxtZgRktWf9VLe4bWt4GLqFhNFoVEmNiH7LgqV2xXEi2bcrtcFZK9tptColAJ4bXrA6uP6UoZ0m1cYvsxleS3Zfkr5th5culy6OeA4upB5E+qusGrpa1XI1Ep+hQCkrdMZgUib+F65Io+b1oQ4XteER+dhYej51fh7zsXabT7YDMsNNgH08nZqDA9rdZUrgyChMSEFAnJM1lIWjHEJ69WzCAh73Q6xhmgN6OcsqB9nfcqZfmBEdM+nGINCRyCo6t3kjw== 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=wuxfTc5LqLi0t096miKovqXJd/tefAIbZDMEO+sAzuQ=; b=PBxFPviS2KCYPX7k8v189/kuwjd6KkYhfFFUOijbSdbEXJk62z8CKFhaBIJJzC76OMSEiOOwPIBIu3MzaVx7/d8hOi8zR2Nn+/LySkQOzuUH1gbzaCeeZRqMq7NaPMUYrRP9Rm+3f+jPuC8I1iUsL7C3s75JABNNRoBoL3a5ldzjIySZQJKQ2SJosDFfRLyZSTLuI7fGiyBr2ArY3spdDZFUpRHrquxB1to9Rdd7rgZ9FD3bnAvsU8T7jN69+za79CTzVxPbxcM3YeKEI/s2ERBdwjtckLgWWNwQ8YaV8YqNlxebt2QuGAHgbWdzHiPNVDGJVySc4qWeRX+l5hfnqA== 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:25 +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:25 +0000 From: "Michael D Kinney" To: "devel@edk2.groups.io" , "lichao@loongson.cn" CC: "Gao, Liming" , "Liu, Zhiguang" , "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH v2 04/30] MdePkg: Add LoongArch64 local interrupt function set into BaseLib Thread-Topic: [edk2-devel] [PATCH v2 04/30] MdePkg: Add LoongArch64 local interrupt function set into BaseLib Thread-Index: AQHaEGEiTVnKfIzZ+U6VmQBEETGMPLBuNPxQ Date: Tue, 7 Nov 2023 03:31:25 +0000 Message-ID: References: <20231106032521.2251143-1-lichao@loongson.cn> <20231106032657.2268149-1-lichao@loongson.cn> In-Reply-To: <20231106032657.2268149-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: 0e9cc599-2b6c-4de6-fd86-08dbdf420548 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: DkQlKLuAQKXnS3v26ObIhJrP1H9OekJqh7LqTkmSXehUY+ZEjVoMc2b47G2hwwjLGN+TErZTTiygWP12KMMeUg3aKLe7udjiFGBI/e3iNtjhw7GORMaZQP3QuLiTD9kbN4F3d1tD9pOkEmzDWnI/WLsxNts86nywvYl4LFcMGRVWngimwmGFgYHojYIoBug4oWfBVNJqsuRhv6Ww3wsn0YiE85ICS0OaGq/rp3pnF9Tf9aeo6nsa7KhbVJXVQSwzpPtlYBuzJKjzYA8T0au4FK5z1hk6ujJir7xgYQcwDfTrdxhTAeVEzczyOqRXP9XeCRroVEI97jdVnoLjBco2TByhKUSycEnvluHJIpJGVDtfMeL+2n1OHip+Gt34pXFCaPhGunpjT5nplMHiH8jYa8m+sfUYAOJ+/j0E1XW6I/ANnZWEBTV6y2tLPO4Bn5Y0iFSPPl/+uVV/3uOztg3Gg74NPX5LgJOBlE4JyIrB2fJbVZAzavhp0ccythwMi4zN41L2KUOOPfuSCPfU/8ZJqBa/kO6O46umW0nHfEFhQniooZNCsvg48rJLczFr2JHvF/RtufmNVbCX1GOhCTdMwTFFmIPFw8DBug5FRyv3JnigQSjznSvWNngDf33+GJIaMLqkyOZ4h6peId3vwTr2IQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?B9pL8ix6QgySWdduseC8+zoeD+ZIicrTczP4mRjaK8PXTPcJtmgsC/u2VqjR?= =?us-ascii?Q?vKQQLQa/3Lr9t1w7qGSiveBlyUkQMMb6bTm4dcE4M86zLwdfF27yu+hw5q52?= =?us-ascii?Q?G0spMvtInkrD7IfF4PQKW/i+UStuLrEYDVDxZwLKHBv70OXhBbOzaQBEF3eC?= =?us-ascii?Q?NNZHQV2B0LhxLZPonZkjrhV2AqoQ35Q0pILY/4g1OL4jH/gzErgt+S2787sf?= =?us-ascii?Q?WCiiEni9h05q531wqTyIZLiktOGhdoi+U86Aiv7/BsW/7sOy//TJBGO8EAJ3?= =?us-ascii?Q?X6gjvrg79By5EnHiECo2pMkKCQQQfDoK7EsYsAqyxz01LDqGPMYV4CXE9jdN?= =?us-ascii?Q?yya7kTNnSizJHRh9j+weCdhPhBqu4TZ5JdElCTUZnPUT6CBM0kedbvWFE6Ry?= =?us-ascii?Q?6kDJaiwW5DLIL3uqUK+crRa9JFwwfIeSvRLXceXABYs0RAA78x7O393S7ioi?= =?us-ascii?Q?lq06CsW2ECCzizlUewjmn+nXmbX8SZbMVqAnHIpbl1rQzc78bALTPa6TcLcp?= =?us-ascii?Q?tJl3dROf+AGLOYHJW/qb159Bm+Q1kk/0fxCZZtWiK75cRq+y5Pk1H5vz4Kcv?= =?us-ascii?Q?jT3UN2y7JXMevMaAZxrU/5+cczi1ag8tlQ9rNtZG5cpTF9/1qG9nqyVGlwLk?= =?us-ascii?Q?nog1JdbSAIPbW5AQwQ3XeO7O9J/h2X790Z6l+3bhFah7DQ5iDphq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QOdbPiKFgsF9Gu+tI1NXeChy?= =?us-ascii?Q?yw=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: 0e9cc599-2b6c-4de6-fd86-08dbdf420548 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2023 03:31:25.2235 (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: 1tteOfE5oJEYr/8ke0Bb/4MTruzcI5c6Nj8pF/JtiRdqA9N3JRE7evSNtyBkSQAYUyhB24IKOXMVfdZKEgXQlgNa0C9S9wOQ5RmYpZIcdag= 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: f9Li5zgBhzpPKkVC9pdZfTAwx7686176AA= 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=aUnuj1p4; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=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 Acked-by: Michael D Kinney > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Chao Li > Sent: Sunday, November 5, 2023 7:27 PM > To: devel@edk2.groups.io > Cc: Kinney, Michael D ; Gao, Liming > ; Liu, Zhiguang > Subject: [edk2-devel] [PATCH v2 04/30] MdePkg: Add LoongArch64 local > interrupt function set into BaseLib >=20 > Adding LoongArch local interrupt function set, which is used to > control > the opening or closing of the local interrupt when the global > interrupt > is enabled. >=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 +++++++++++++++++ > .../BaseLib/LoongArch64/DisableInterrupts.S | 22 ++++++++++++++---- > - > .../BaseLib/LoongArch64/EnableInterrupts.S | 22 ++++++++++++++---- > - > 3 files changed, 54 insertions(+), 10 deletions(-) >=20 > diff --git a/MdePkg/Include/Library/BaseLib.h > b/MdePkg/Include/Library/BaseLib.h > index a9a69c734c..93a014cd49 100644 > --- a/MdePkg/Include/Library/BaseLib.h > +++ b/MdePkg/Include/Library/BaseLib.h > @@ -249,6 +249,26 @@ SetTlbRebaseAddress ( > IN UINT64 > ); >=20 > +/** > + Enables local CPU interrupts. > + > + @param Needs to enable local interrupt bit. > +**/ > +VOID > +EnableLocalInterrupts ( > + IN UINT16 > + ); > + > +/** > + Disables local CPU interrupts. > + > + @param Needs to disable local interrupt bit. > +**/ > +VOID > +DisableLocalInterrupts ( > + IN UINT16 > + ); > + > #endif // defined (MDE_CPU_LOONGARCH64) >=20 > // > diff --git a/MdePkg/Library/BaseLib/LoongArch64/DisableInterrupts.S > b/MdePkg/Library/BaseLib/LoongArch64/DisableInterrupts.S > index 0f228339af..5de10e9e7a 100644 > --- a/MdePkg/Library/BaseLib/LoongArch64/DisableInterrupts.S > +++ b/MdePkg/Library/BaseLib/LoongArch64/DisableInterrupts.S > @@ -1,21 +1,33 @@ > #-------------------------------------------------------------------- > ---------- > # > -# LoongArch interrupt disable > +# LoongArch interrupt disable operations > # > -# Copyright (c) 2022, Loongson Technology Corporation Limited. All > rights reserved.
> +# Copyright (c) 2023, Loongson Technology Corporation Limited. All > rights reserved.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > #-------------------------------------------------------------------- > ---------- >=20 > +#include > +#include > + > +ASM_GLOBAL ASM_PFX(DisableLocalInterrupts) > ASM_GLOBAL ASM_PFX(DisableInterrupts) >=20 > #/** > -# Disables CPU interrupts. > +# Disables local CPU interrupts. > +# > +# @param Needs to disable local interrupt bit. > #**/ > +ASM_PFX(DisableLocalInterrupts): > + csrxchg $zero, $a0, LOONGARCH_CSR_ECFG > + jirl $zero, $ra, 0 >=20 > +#/** > +# Disables global CPU interrupts. > +#**/ > ASM_PFX(DisableInterrupts): > - li.w $t0, 0x4 > - csrxchg $zero, $t0, 0x0 > + li.w $t0, BIT2 > + csrxchg $zero, $t0, LOONGARCH_CSR_CRMD > jirl $zero, $ra, 0 > .end > diff --git a/MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S > b/MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S > index 3c34fb2cdd..73adcd7b0c 100644 > --- a/MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S > +++ b/MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S > @@ -1,21 +1,33 @@ > #-------------------------------------------------------------------- > ---------- > # > -# LoongArch interrupt enable > +# LoongArch interrupt enable operations > # > -# Copyright (c) 2022, Loongson Technology Corporation Limited. All > rights reserved.
> +# Copyright (c) 2023, Loongson Technology Corporation Limited. All > rights reserved.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > #-------------------------------------------------------------------- > ---------- >=20 > +#include > +#include > + > +ASM_GLOBAL ASM_PFX(EnableLocalInterrupts) > ASM_GLOBAL ASM_PFX(EnableInterrupts) >=20 > #/** > -# Enables CPU interrupts. > +# Enables local CPU interrupts. > +# > +# @param Needs to enable local interrupt bit. > #**/ > +ASM_PFX(EnableLocalInterrupts): > + csrxchg $a0, $a0, LOONGARCH_CSR_ECFG > + jirl $zero, $ra, 0 >=20 > +#/** > +# Enables global CPU interrupts. > +#**/ > ASM_PFX(EnableInterrupts): > - li.w $t0, 0x4 > - csrxchg $t0, $t0, 0x0 > + li.w $t0, BIT2 > + csrxchg $t0, $t0, LOONGARCH_CSR_CRMD > jirl $zero, $ra, 0 > .end > -- > 2.27.0 >=20 >=20 >=20 >=20 >=20 -=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 (#110789): https://edk2.groups.io/g/devel/message/110789 Mute This Topic: https://groups.io/mt/102413849/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-