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 A27D3D802E7 for ; Wed, 4 Oct 2023 18:48:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4ofTC71TxHWg4AwUheNxVIaoQMHRXu3S5jTftynxfGc=; 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; s=20140610; t=1696445296; v=1; b=HDLI8s3A4SAa8q+7+4phb3d77ehvyIIDYHw4fSSStgR5QBHTli7yXUjgoSWZxWv//RqqX1sm /zvaxa1rmCZ/w7x1OaFhdOWDDtTgS8Kne8r1wKGzzrQSjFSzKkuhCGpRrgEColbFAQsUZcO874W LR/3dR1zynttVhBE0DtVj2/w= X-Received: by 127.0.0.2 with SMTP id FqAzYY7687511xhMPZC6IWPd; Wed, 04 Oct 2023 11:48:16 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.1815.1696445295315303643 for ; Wed, 04 Oct 2023 11:48:15 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="386094262" X-IronPort-AV: E=Sophos;i="6.03,201,1694761200"; d="scan'208,217";a="386094262" X-Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2023 11:48:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="751440929" X-IronPort-AV: E=Sophos;i="6.03,201,1694761200"; d="scan'208,217";a="751440929" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga002.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Oct 2023 11:48:14 -0700 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Wed, 4 Oct 2023 11:48:14 -0700 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Wed, 4 Oct 2023 11:48:13 -0700 X-Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Wed, 4 Oct 2023 11:48:13 -0700 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.174) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Wed, 4 Oct 2023 11:48:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dstqgdEesd4fRN/UxABQBWasGwx4YqLAkOyotERDbLiipAFwX8ozX7py/wltATvQoD5AvQwBtBk9XyHYoY8kYTsLF0dCXDR03dRz0IJnsiXgnHvl6OIzsDV1sqSxt1IUIvNkhQ1sHVD7nD4CsAnGMRDq8jkFWUWcm65dNStQf0T4hnt/sxDlPsdllei8N60hnS3NRZ8pJHYrc2Mwl1cspw26/hq8sTUWFLobUW80axiOaTrfr7G0I3e/wCXcm69lY4o0jXxrIDsQqhbgP8q/yOUFrYj/zxk/14flkULUkOVdIcoGSLQ7dnbTkXFBQ6kTgq0/tL7/dbAUp5z0EzkFCg== 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=qAVF0+zvzl/8VJIkKTJNXrICXSw88s0XQ598Z5AvLmo=; b=MUqd5o1z4ej30Pwo6MT3d4nPdfnLlgesI5wc4MpXm7q+bSmKtq5XU5ZHQV0hnlis8g0OS3DrWh2B//2nXIfHbQqSWb+ZP7dcBr7JDDDr7qGfKFztXJ/RIaFfG7EO0FynOSxylxgTczi22p85/O9VEtXw5sYlvxKg4HgYCk3vVZ9KREYp9fUcR6NRV0mocMF05abQ8uWcDTOpemO/q5OEqi0lJ7CLQNucoO9mzD4NIj7j67Jlu5q5YAaS4LnjzTuQR4vFac1HEvibfJSsN1twd5BY3w/msAAPCK+K+qj43e8fQBIsDrrNe7/7NHf2EJkJCRkj8qTdGygvQa9EaVTWxw== 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 PH8PR11MB6856.namprd11.prod.outlook.com (2603:10b6:510:22b::7) by BL1PR11MB5510.namprd11.prod.outlook.com (2603:10b6:208:31d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.35; Wed, 4 Oct 2023 18:48:10 +0000 X-Received: from PH8PR11MB6856.namprd11.prod.outlook.com ([fe80::2659:597c:90a6:1fc0]) by PH8PR11MB6856.namprd11.prod.outlook.com ([fe80::2659:597c:90a6:1fc0%7]) with mapi id 15.20.6838.024; Wed, 4 Oct 2023 18:48:10 +0000 From: "Andrei Warkentin" To: Tuan Phan , "devel@edk2.groups.io" CC: "Kinney, Michael D" , "Gao, Liming" , "Liu, Zhiguang" , "sunilvl@ventanamicro.com" , "git@danielschaefer.me" , "ardb+tianocore@kernel.org" Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode Thread-Topic: [edk2-devel] [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode Thread-Index: AQHZ9jy/sjC3LlGKskm1fiO2hxCUfbA5+D9QgAAAngCAAAEywA== Date: Wed, 4 Oct 2023 18:48:10 +0000 Message-ID: References: <20231003210021.26834-1-tphan@ventanamicro.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH8PR11MB6856:EE_|BL1PR11MB5510:EE_ x-ms-office365-filtering-correlation-id: fdf35a9e-803a-4462-ce0a-08dbc50a74c9 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: 2/rX62LzEfqf2wD8I1fnuDhG9ROFq96R0ILibvNZsmHR5ukjlZpAU6CT9jK0/BQPQLMMtw9+OCe7Okz5btIlb71npCn68dlnRg0RuDatynJh8TyVOnhisShUtIP5DMUYTYumMVA3Exl8+pc4XQlV4rBxIxJTqJn1+ExEbreUrHkpiYwNr0XXC4CVUfHl3Axpc7lw1atnB0zxBvBfJIXgG3JY6QXwTt8xi1mIR+LCiXtXB1hn1GdSULjiDoCxny6w7myAYJAD+fsx2hfOTUZT0YxVrkx8layHl93YkrcBbaXBPLuAcu8OEIBWSMmfo7O/E0ZmAeCiOK5Ofi6IdzkFLh0loP81SY+FYyTskk+gxNh5vZsz7wLfIdru7fvCtYAsroGXUdMJ+MNWjEn+2A4cq4ym7mitc6nRn7dLJrvS+RjdzVzj5FO1W2d0C6hh6WIdfxV9ifNHAyEGBNSEXTWLDSF9Bzn0kQt8AVp0Uocmd3NGAoHhQOE427jhN808NC1lxdKvduAwDx57TV3PMGhGuZJMojHoaqXEbgIdzmR5fbqAlb3girR/jq92TUoAqzN9vpiU/6nXVzPYQqBYD6ayWf4ehvmAoeTC9Qo5yZIo02Q5NEqP71EzJQC13WuPhlTYA/kAz0NQ2d9b4Xej/mJtNw== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?AaGGdlURLI+DAJW7ISZM2f6giy7mccKzWmlgFExBuQxHmL1NUPk2aq2y+r+M?= =?us-ascii?Q?TTfXx01Ro8zZSH4HzU9ohRh/uECs5bJKEwGEMOO3ALHxrml6POX63gXQ0yXj?= =?us-ascii?Q?sMWgMNWV+id6m3qwqnf4pvMJ3uS2aEoYXBNVzOd1Nt6VfLHH8WHcl5N/JuFp?= =?us-ascii?Q?SgFCYDi3t0SJX8ZsHqLipdNktetkd+J8bo2zGZdLH9cVGQydqFhz1IJkzBU7?= =?us-ascii?Q?BDMLhLPiREep78/cVMjyrxc5ANk+xSKO+5OVBEFrDMmxsiCEHQ0ztH9QtQYe?= =?us-ascii?Q?SZX1oxAg6RfRkwd3Neby8bJYSoSLTMENF+cTt5VhsxqDq4cmvxnX6qqgNrRl?= =?us-ascii?Q?oIs1aMEZ97A+B7hkO2sHCS/1F4n8oVjEf8fRzRbteJ2a5pvl+mj814o0G6nm?= =?us-ascii?Q?4PjrPz8BMnlY9yJqog3/4kJizKC1g1a/dfupjtohnBdJdzJ4dS77DIUIWW6J?= =?us-ascii?Q?CLVkhhJY5+Z5df0NwZu7GfWs8snMM8Qpl/qHWsFPOyW2pL0Amkkk1j3UyA7o?= =?us-ascii?Q?+fKMVEy+B6S+eq6AwOHkpEoSj+k3iuQOR8YQqHC6JwRaf2nieH8qm89JGrAX?= =?us-ascii?Q?y2VtnY83CY6F+cb2qDXLlDAqMJVam6XKdH9ww7FWwsN7u64nGE1QHLBsbwoU?= =?us-ascii?Q?yPiL0WR9wWW8QfOpCSLJFR1JMz7mhwEoc3ckUGB30DIhEXy/FVB6SilxYDs3?= =?us-ascii?Q?wZMhLibnCRbaR5ELbOw5RDL9gtFwBLy1QDK4v/+sSofZ/84IvvMJiIjm5O/W?= =?us-ascii?Q?jlj8trCHXAuobKuzCP3nAvI1XIjOie/f7dUDfeMyGzmc5TTsOpEu/F4H6PKj?= =?us-ascii?Q?GTuBjQsuOWS2m39OGYeGm+6EqCx1M3qm/8FabPmVsp+DplI7ztDdq1i5f87C?= =?us-ascii?Q?tuJQFSWojk3T8LCVI1AKuq+cRhNP5iJM66KGE4bky1t89tOayhB55ALThlGR?= =?us-ascii?Q?v5ehy+MYcT1Gv7kX1bRCY7qKbv6rEeTP7D33y95AWaqCWova18q0iFyQHt94?= =?us-ascii?Q?45O1Rk5zuzZSBC7P/djG+Dpl8v1/Ood2HzT3Cr1/yWM6esHkYvk+Zvb09jdN?= =?us-ascii?Q?VweSUKWs0vdpe1IqA18e5rZLdIL+AWnXwmwc8zaB+OJqLPwUiK60pPfB3JYs?= =?us-ascii?Q?5yyUclvomQNayVCzKIlLLzJ2II1wrzMTJs+L+R9ybvgieiuciXfPwK2JciaK?= =?us-ascii?Q?FnQy+/LG2AjAoi5NLkmzgczNYjur1ySg/JmW9AZCTWxO4xGtsgGYKlyI1RkE?= =?us-ascii?Q?8DgTz78q0YLIAXHSwSpiJnNTD0KCi7Z5GdPYFCskpzdVLBwTFm5NKzqXEqtX?= =?us-ascii?Q?jebPfXJEaPPBkaN72RVZ20VKQExWbzQGEsLa7hLC5V3KdH/9kAH0MTpgiY2B?= =?us-ascii?Q?JexG19clsrEmeFOgLzoU8mAMl5bDf/rBkKyKpUQe04XyfkYNvvUm2x992oyU?= =?us-ascii?Q?nrSsZJJixidjk8HTqojLx8Sn6x9Zoc9OGCXQKMOmUb+/iaZk73orZ+EOtCaf?= =?us-ascii?Q?MVN48eJ7OInnwwOnU6zFFSYHXB3ikc/s+rHQOcSULC+dBRsiPw++0YFCwuYN?= =?us-ascii?Q?XGlzleQvFpgBia/kXFzwMh+46iavp/D/3iF2gBt6qA8+tHUm3bjZ1weqzEqO?= =?us-ascii?Q?Ag=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH8PR11MB6856.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fdf35a9e-803a-4462-ce0a-08dbc50a74c9 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Oct 2023 18:48:10.2396 (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: gz0Do+B6jXIFGU8JmcJCcAcdGy7WctiwnNpYkA1l/33mSuGs0HT/NDdQauQZ4OwGIBnX668XcTi8Wkn9wO3PWjF3JF6XurKzNGv9Hfp2vok= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5510 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,andrei.warkentin@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: BD3ZsWVRcf07x6jY4h5EBi5Qx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_PH8PR11MB6856276AF9E803EFE78E85A283CBAPH8PR11MB6856namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=HDLI8s3A; 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}") --_000_PH8PR11MB6856276AF9E803EFE78E85A283CBAPH8PR11MB6856namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Looks good to me. Reviewed-by: Andrei Warkentin From: Tuan Phan Sent: Wednesday, October 4, 2023 1:44 PM To: devel@edk2.groups.io; Warkentin, Andrei Cc: Kinney, Michael D ; Gao, Liming ; Liu, Zhiguang ; sunilvl@ventanamic= ro.com; git@danielschaefer.me; ardb+tianocore@kernel.org Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD = for SATP mode https://github.com/pttuan/edk2.git branch: tphan/riscv_mmu_new_pcd From: devel@edk2.groups.io > on behalf of Andrei Warkentin > Date: Wednesday, October 4, 2023 at 11:42 AM To: Tuan Phan >, deve= l@edk2.groups.io > Cc: Kinney, Michael D >, Gao, Liming >, Liu, Zhiguang >, sunilvl@ventanamicro.com >, git@danielschaefer.me >, ardb+tianocore@kernel.org > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD = for SATP mode Do you happen to have a link to a Github tree? A > -----Original Message----- > From: Tuan Phan > > Sent: Tuesday, October 3, 2023 4:00 PM > To: devel@edk2.groups.io > Cc: Kinney, Michael D >; Gao, Liming > >; Liu, Zhiguan= g >; > sunilvl@ventanamicro.com; git@danielscha= efer.me; Warkentin, Andrei > >; ardb+tia= nocore@kernel.org; Tuan Phan > > > Subject: [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode > > Introduce a PCD to control the maximum SATP mode that MMU allowed to > use. This PCD helps RISC-V platform set bare or minimum SATA mode during > bring up to debug memory map issue. > > Signed-off-by: Tuan Phan > > --- > UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c | 6 +++++- > UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf | 3 +++ > UefiCpuPkg/UefiCpuPkg.dec | 8 ++++++++ > 3 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c > b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c > index 9cca5fc128af..826a1d32a1d4 100644 > --- a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c > +++ b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c > @@ -36,7 +36,7 @@ > #define PTE_PPN_SHIFT 10 #define RISCV_MMU_PAGE_SHIFT 12 - > STATIC UINTN mModeSupport[] =3D { SATP_MODE_SV57, SATP_MODE_SV48, > SATP_MODE_SV39 };+STATIC UINTN mModeSupport[] =3D { SATP_MODE_SV57, > SATP_MODE_SV48, SATP_MODE_SV39, SATP_MODE_OFF }; STATIC UINTN > mMaxRootTableLevel; STATIC UINTN mBitPerLevel; STATIC UINTN > mTableEntryCount;@@ -590,6 +590,10 @@ RiscVMmuSetSatpMode ( > UINTN Index; EFI_STATUS = Status; + if > (SatpMode > PcdGet32 (PcdCpuRiscVMmuMaxSatpMode)) {+ return > EFI_DEVICE_ERROR;+ }+ switch (SatpMode) { case SATP_MODE_OFF: > return EFI_SUCCESS;diff --git > a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf > b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf > index 9b28a98cb346..51ebe1750e97 100644 > --- a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf > +++ b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf > @@ -25,3 +25,6 @@ > [LibraryClasses] BaseLib++[Pcd]+ > gUefiCpuPkgTokenSpaceGuid.PcdCpuRiscVMmuMaxSatpMode ## > CONSUMESdiff --git a/UefiCpuPkg/UefiCpuPkg.dec > b/UefiCpuPkg/UefiCpuPkg.dec > index 68473fc640e6..79191af18a05 100644 > --- a/UefiCpuPkg/UefiCpuPkg.dec > +++ b/UefiCpuPkg/UefiCpuPkg.dec > @@ -396,6 +396,14 @@ > # @Prompt Access to non-SMRAM memory is restricted to reserved, > runtime and ACPI NVS type after SmmReadyToLock. > gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmRestrictedMemoryAccess|TRUE|B > OOLEAN|0x3213210F +[PcdsFixedAtBuild.RISCV64]+ ## Indicate the > maximum SATP mode allowed.+ # 0 - Bare mode.+ # 8 - 39bit mode.+ # = 9 - > 48bit mode.+ # 10 - 57bit mode.+ > gUefiCpuPkgTokenSpaceGuid.PcdCpuRiscVMmuMaxSatpMode|0|UINT32|0x6 > 0000021+ [PcdsDynamic, PcdsDynamicEx] ## Contains the pointer to a CPU > S3 data buffer of structure ACPI_CPU_DATA. # @Prompt The pointer to a C= PU > S3 data buffer.-- > 2.25.1 -=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 (#109334): https://edk2.groups.io/g/devel/message/109334 Mute This Topic: https://groups.io/mt/101742937/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_PH8PR11MB6856276AF9E803EFE78E85A283CBAPH8PR11MB6856namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Looks good to me.

 

Reviewed-by: Andrei= Warkentin <andrei.warkentin@intel.com>

 

 

From:= Tuan Phan <tphan@ventanamicro.com>
Sent: Wednesday, October 4, 2023 1:44 PM
To: devel@edk2.groups.io; Warkentin, Andrei <andrei.warkentin@int= el.com>
Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Limin= g <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.co= m>; sunilvl@ventanamicro.com; git@danielschaefer.me; ardb+tianocore@kern= el.org
Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce= a PCD for SATP mode

 

https://github.com/pttuan/edk2.git

branch: tphan/riscv= _mmu_new_pcd

 

Do you happen to have a link to a Github tree?

A

> -----Original Message-----
> From: Tuan Phan <
tphan@ve= ntanamicro.com>
> Sent: Tuesday, October 3, 2023 4:00 PM
> To: devel@edk2.groups.io > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.= cn>; Liu, Zhiguang <zhi= guang.liu@intel.com>;
> sunilvl@ventanamicro.com; git@danielschaefer.me; Warkentin, Andrei
> <andrei.warkentin@int= el.com>; ardb+tianocore@kernel.org; Tuan Phan
> <tphan@ventanamicro.com>
> Subject: [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mod= e
>
> Introduce a PCD to control the maximum SATP mode that MMU allowed to > use. This PCD helps RISC-V platform set bare or minimum SATA mode duri= ng
> bring up to debug memory map issue.
>
> Signed-off-by: Tuan Phan <
tphan@ventanamicro.com>
> ---
>  UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c  = | 6 +++++-
>  UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf | 3 +++ >  UefiCpuPkg/UefiCpuPkg.dec      &nb= sp;            =            | 8 ++++++++ >  3 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c
> b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c
> index 9cca5fc128af..826a1d32a1d4 100644
> --- a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c
> +++ b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c
> @@ -36,7 +36,7 @@
>  #define PTE_PPN_SHIFT       &= nbsp; 10 #define RISCV_MMU_PAGE_SHIFT  12 -
> STATIC UINTN  mModeSupport[] =3D { SATP_MODE_SV57, SATP_MODE_SV48= ,
> SATP_MODE_SV39 };+STATIC UINTN  mModeSupport[] =3D { SATP_MODE_SV= 57,
> SATP_MODE_SV48, SATP_MODE_SV39, SATP_MODE_OFF }; STATIC UINTN
> mMaxRootTableLevel; STATIC UINTN  mBitPerLevel; STATIC UINTN
> mTableEntryCount;@@ -590,6 +590,10 @@ RiscVMmuSetSatpMode  (
>    UINTN        = ;            &n= bsp;       Index;   EFI_STATUS = ;            &n= bsp;         Status; +  if
> (SatpMode > PcdGet32 (PcdCpuRiscVMmuMaxSatpMode)) {+  &nb= sp; return
> EFI_DEVICE_ERROR;+  }+   switch (SatpMode) {  = ;   case SATP_MODE_OFF:
> return EFI_SUCCESS;diff --git
> a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf
> b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf
> index 9b28a98cb346..51ebe1750e97 100644
> --- a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf
> +++ b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf
> @@ -25,3 +25,6 @@
>   [LibraryClasses]   BaseLib++[Pcd]+
> gUefiCpuPkgTokenSpaceGuid.PcdCpuRiscVMmuMaxSatpMode  ##
> CONSUMESdiff --git a/UefiCpuPkg/UefiCpuPkg.dec
> b/UefiCpuPkg/UefiCpuPkg.dec
> index 68473fc640e6..79191af18a05 100644
> --- a/UefiCpuPkg/UefiCpuPkg.dec
> +++ b/UefiCpuPkg/UefiCpuPkg.dec
> @@ -396,6 +396,14 @@
>    # @Prompt Access to non-SMRAM memory is restricted t= o reserved,
> runtime and ACPI NVS type after SmmReadyToLock.
> gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmRestrictedMemoryAccess|TRUE|B
> OOLEAN|0x3213210F +[PcdsFixedAtBuild.RISCV64]+  ## Indicate the > maximum SATP mode allowed.+  #  0 - Bare mode.+  # = ; 8 - 39bit mode.+  #  9 -
> 48bit mode.+  #  10 - 57bit mode.+
> gUefiCpuPkgTokenSpaceGuid.PcdCpuRiscVMmuMaxSatpMode|0|UINT32|0x6
> 0000021+ [PcdsDynamic, PcdsDynamicEx]   ## Contains the poin= ter to a CPU
> S3 data buffer of structure ACPI_CPU_DATA.   # @Prompt The p= ointer to a CPU
> S3 data buffer.--
> 2.25.1



_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#109334) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_PH8PR11MB6856276AF9E803EFE78E85A283CBAPH8PR11MB6856namp_--