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 CB12C7803D7 for ; Wed, 4 Oct 2023 18:42:01 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=F3nNzNv7ONCFNlMxEfbhlgvc3cvpprI0/ks2/6na1F0=; 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=1696444920; v=1; b=NH8YMWjnKuCVpFz1piF/ZiN38RgkWjU4XtS/IjYvkeJ8GJeHoBbHk7gfstr3EJUppAhKB+n7 7RtY21MFRYy6Ko4uiiQ2l2af5NioG5UYDqHQtRpHemFSjAwOy7hTwkx//j1W8gYNZIAo8fvDiSK vWhfwYQx2cHGyympd+RRhb0o= X-Received: by 127.0.0.2 with SMTP id ZpcyYY7687511xAsg0gtKDgu; Wed, 04 Oct 2023 11:42:00 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.1626.1696444919422461298 for ; Wed, 04 Oct 2023 11:41:59 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="363541252" X-IronPort-AV: E=Sophos;i="6.03,201,1694761200"; d="scan'208";a="363541252" X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2023 11:41:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="821801460" X-IronPort-AV: E=Sophos;i="6.03,201,1694761200"; d="scan'208";a="821801460" X-Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Oct 2023 11:41:58 -0700 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) 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:41:57 -0700 X-Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) 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.32; Wed, 4 Oct 2023 11:41:57 -0700 X-Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.32 via Frontend Transport; Wed, 4 Oct 2023 11:41:57 -0700 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) by edgegateway.intel.com (134.134.137.100) 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:41:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c/fm0sFTFNvgXamXLzf0QPK3f2N4a8e/3cbJeVa/+VmoratZ9t7IMygupZZF3VWh7cuAFT63wBUyn0cJx1SaSoIJFV5sJBpPc/qjMclMgrNV9HSxCxk+MitEgFQdDTNuBRJEd6hqldr65As2SDaiiQx7XDpBofS8vCfcQmCaCyOr8OQ5ldnUhbGROfCh5AJHhU+xALfMCIaBhHV6RucN56Ljy7vk9HM5fKUOzYWNf+/je00tDo5bBnYbhx7yo7OXiInHYt61IJmnKa3AJti0IO8qRU6EQJvt/jkZW0WU59xODkbnufbcDWg6iTqR43asnqk+Rz3TKzWtqYq6/nGTWA== 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=Dd2ngvpeaNCs9OXugDww0ib/lgjNl3bmst1x/TON+jU=; b=QRx2rk1Ywwsda7dLonsZ4uSm/ag3IJ0plgMqslNSDYBDgaA4F5Bt6f+hSLv9NziPSMTMXJImzYd5kD7oyOZN16mRAf0ZutN9IRkEHUMyVVgeatcj7jOC0WKm7adOXYytPnqEQ5kBFKJ/Qf9KaSalqajspop9gYIEGmjSIfAmp8HGcOSwU8A1SOoU1Loy0ArV47uwcdkkBVSydKK9mWNms0AOnkoqJsMLCGaO2hRD9jA3IaRBNZ21t93QcF5F8vxKnlybZV9EkWDrFX9bEtbzl/J7fiN/8yWrQYZbFQddhna4eG/qCrakBkTGQd6lhpeeoJMpkoVvBgtCFeVaglY4uw== 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 SJ0PR11MB5678.namprd11.prod.outlook.com (2603:10b6:a03:3b8::22) 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:41:44 +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:41:44 +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: [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode Thread-Index: AQHZ9jy/sjC3LlGKskm1fiO2hxCUfbA5+D9Q Date: Wed, 4 Oct 2023 18:41:43 +0000 Message-ID: References: <20231003210021.26834-1-tphan@ventanamicro.com> In-Reply-To: <20231003210021.26834-1-tphan@ventanamicro.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH8PR11MB6856:EE_|SJ0PR11MB5678:EE_ x-ms-office365-filtering-correlation-id: b6741995-bea3-40fc-0f51-08dbc5098e7d 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: DCPhxDeG8658Z+gZdKcYdnMK0RLSS6sSBTzn0Cu3HZ7gbxyJ+HhppvMRCxeucQKk4lSw7VCly33BBxY627SQklIzbHCuy4v4kDnjVeJZTeFGI1AnUZRS9dFWnQVT0iU7WdJxTKqyibHiIHuIBeCbV0ODuKX+z5OAfk95gyh/P5SVF0vJkrYbBspy8xmv8DVcDQOlz0HFoI/gDvBFkN7QAQI/IhA1A0gKmB2auGnfmJ9pqYfe5kWa8P5GIKsvhOqGTANFlPSJU5gVgQxXoEQK5cvHIjNJKF0YVyU1UbAk2O6VCOdP3bHG9RG457BtV2bBO082y02O5I7nD6eGgw450Mqtw081fwModvUBk7TI1GHWOnwfNfrQPXnpR1AA8KPKmaXyGD2TzmsNftK4rYkz84AIX9CZmFC7tW3oyCnusJgppqcgmEiR8cClIbVNWsPcSoyTA8HzUfC9o6YLUSHRI4Zqe+uroijs3Fz5WVpogHToWnYXweLNmg1wn30pE9BosdKdWGZwIwmYPuypcSdPxhjibaAyptp6SAXDhB3x1sr3Z3CGb99m2l0GwI4Z7bOr71nYBHnZuvSiibbGtwrurqXtwZZsCObYRhOYEOjvB6s540G6jnQ4vzSxTmBJ/LVr x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xFr0zNNNUtw9sRchwyLp4Q4SdS3/fRisGf9z5Km5940RHwRMx+fEV6RikkGD?= =?us-ascii?Q?p5tt25D8eLM5V+G3IuqYGxSTiL/+lGgwfptKxRyyuDNaG01s37HUrqDxs+dd?= =?us-ascii?Q?IWh4tG2fcQXn48lm0m3OG6Yt6p/g59vQaAogiUppbdHOm16hjY3M0TfIq+N5?= =?us-ascii?Q?hbDYmLCvzDxAZyC+WBrhKrd7c7VsNQI+/+3E4RGJST+T81Cf7HpJ3ZpvIjoC?= =?us-ascii?Q?PTiGM5PyBhrX/zk/duMpPBDa1Y/AGyDxaDz1zwLFksiMePjTvM9gK624KAwz?= =?us-ascii?Q?lwO/XwdO1dyQe357vGImENkMIAT/QzrzBdkbkzUqj/R1uTTuRbm0tx4cvxwt?= =?us-ascii?Q?jrYeO62krYp+8BxnZZN0xfvoDu0ormzKfy6GZWERaTcqi3JskWVByx0P0C1X?= =?us-ascii?Q?W7iFvo9OZWCLOGhfYdKXcj5NDRC47eEksWYu58vjfH4J5BTmbFZ5PTNYh/1G?= =?us-ascii?Q?86LNV1wj65bXeYKDbFjaP+cTdh9tjTttuT0pVeCVShmaxvSVe2pYnCuyoljt?= =?us-ascii?Q?qa7ZiuEYJsLzbGXY9pnIaGiB0LWUaBnxH90uhT8iqHoaGUKX/+dnMf0ZL3V7?= =?us-ascii?Q?oMQh24B3xaPwjNSh8H+5sblEsa76qlXxkiLtW3rE6X9TWe+kGT2auIv605tL?= =?us-ascii?Q?g5hYw5ni98yzQ4yQVOjco1tOGAYKvFbzgccvF/SZghsAQlA/+Zc9SVgYNd35?= =?us-ascii?Q?8XXqdeMJCnO289SoJatsqfGHUPfTfjEthf/RrgMP6llu7jogjyudsLekTNSi?= =?us-ascii?Q?mlKeCEfcCK2HPbCUOsmM2XiLzsXQYlbs3fpp5UleTUh+wfnUSN8klPrGvZYY?= =?us-ascii?Q?FQovH4Wf8YFgR5skyhgG8M4VnU7GfbGfbN9/oTXbnpXeTwwwDlIeVqoFhVib?= =?us-ascii?Q?veRNZmw3LgW1JSNVFAhDrTKlU7AASY8XXVn0jO3XeZzEZBSb2mSuJ43DupOM?= =?us-ascii?Q?H7QiUcgpphFIpwmvtuYT9NOPNb7FVEn0vGKRBmk7mcHfKr2b5PQdw36Oirtx?= =?us-ascii?Q?wOSzWuyZbEIIi41rzxukQuax/0XlB5BkQjLT7TOLWmtW+2VKLNPQnXZ77OBl?= =?us-ascii?Q?kcxrpqj+5gmkvyktgM+ok3fof+gopBOjIkl3yEimbnDoCWx6b6zDoSVjsaBC?= =?us-ascii?Q?N808egTOKl0UfN1jKE51/McufoOvSgW9Xx/1X/PDfi5ril7UBzP/7LZzTw+g?= =?us-ascii?Q?TZHROs+O9hj7Jl4lSb03ubnJLatR7by7tg0e3dmRGDvd6J1r6wXWunRe80rU?= =?us-ascii?Q?44cuPVspETwJDMSOIgB3WXlOXPTy317ljy0lRA0zOb4PefbTWpaUDctZJDCj?= =?us-ascii?Q?YeA2uEjs123XTxQzO2+SvkGCQhngdFiNaIw82hZFG7qiHVDFOSXqIOfquSDU?= =?us-ascii?Q?E+rL52XUONj8CxK7JzalXTYye1VSZcxJ6LRn8NzQVWmuCoamS/K/xuNrAOTI?= =?us-ascii?Q?fRet2bM/zPQHQcIz9DZcksXYDPBdvYIG91mPioxXIRWoqxKvOa5NVoi98dE5?= =?us-ascii?Q?W/e6s1/egVwi/6fen0lX5aHnjC45pW4aMviCcgDZOJiVjAyFMpiipG4M8/nZ?= =?us-ascii?Q?lCqAdYPFzQ+uW/ST9tP/xRSg6KG3SLGAxS+1HYaLUwBLmEGIPD4pY1iMQnDN?= =?us-ascii?Q?xQ=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: b6741995-bea3-40fc-0f51-08dbc5098e7d X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Oct 2023 18:41:43.8418 (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: q4jAbOX3mqsLOhbAW6R/br/g7HjHNG1FeWdhKPDUZ8rYSxfTE1uSHEWe8+qvV6LeffMQCjVcNmHEq91ORTV72SqeiRSpzLLzveFybNdOgfY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5678 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: 45fiKKgIedHQZW9J3itJipXbx7686176AA= 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=NH8YMWjn; 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 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, Zhiguang ; > sunilvl@ventanamicro.com; git@danielschaefer.me; Warkentin, Andrei > ; ardb+tianocore@kernel.org; Tuan Phan > > Subject: [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode >=20 > 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. >=20 > 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(-) >=20 > 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 (#109331): https://edk2.groups.io/g/devel/message/109331 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-