From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.13563.1681833849612911687 for ; Tue, 18 Apr 2023 09:04:09 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=SSJv3Ids; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: andrei.warkentin@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681833849; x=1713369849; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=VkxIOtxof08Y2QnRVgpoOJvROAgU15TsUbMiCP6p1RI=; b=SSJv3IdsdFcwOMh8Cdnl9+J2Dq0e3EyI9Xq4hS/QCSvISpBnzNV3+SGt Be+9y8hxcTiR93qzqNtXSTSyol+k2L7MegocAqtVQ8BGpjLsOms96KxOv MrLBPNIEARCi2t9MWMgMoghHLoHg78waEZAP6N6U1rBD3fYvXNTdCxE2Q 9lwf+bYTWNyk5noNWz90Fik9TLJan7nvBaXlMIKZzsDUlRUGs+xjT6NGg svnZAZs+UB6f0J6vJDEPa9KG/WsBmY3SFW3akapAiBI9n/8G5VgcJH8Zg CTq9f/d+20xTpk0E1lzUTjJ67ciz4D0nIqF02R/WlJNRhFnYGigMH+BzK Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="410439259" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="410439259" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2023 09:03:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="937304945" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="937304945" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga006.fm.intel.com with ESMTP; 18 Apr 2023 09:03:42 -0700 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.23; Tue, 18 Apr 2023 09:03:42 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.23; Tue, 18 Apr 2023 09:03:42 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.23 via Frontend Transport; Tue, 18 Apr 2023 09:03:42 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.108) 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.23; Tue, 18 Apr 2023 09:03:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JHd2xgAZA0OBviugK0XWPZ/2NoOyckqTZ9rcTsmwKHOC/vlwCEEJ8ifWdB7ho5zFtRO1YRfMdoM8amJWVVmlPaUT7qNJMvPCJT/8RXYbbVKWvJFziX0nz3L3r1o/f8pjrp3ooskgeC9cwolLZbQ8pgTvmzxWPGpjMSUqSpNOwlrJRgod6qI/dqjl+ooddKC8HwuazmQh78zSuzoLVC+YmMXQ+j65cgLKAzpDaDsbAtBydX9GL7A9NXvLoPpfzWnQf5LauXNq6RddOVZb4s3GMFksSdPruS2hSonwGllRrFTTQm/Putez4DCmjDC/VwNylknk94Y03NiYasBP2xTJ9Q== 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=H9+5Gd1mBArIRfZ3bh0iG9i2mKiGHWfI9Qy+pOFDDCU=; b=nHm9AasPepVplAZCbDwlzeo5MXjzMqD+Lx9yIJLAvSf3wCjaDnHuZCBwpFThNw8g7ywUb4tlUvXiCZfmotuBiGoQYnKmBWyG59tAd2LTQFPu6L+3R21k23Qbt+jXfDIlycrFONwAFd78qGI4kJRw8ds25m7AemgZHvLeDpio24dmQgutgJ7ewbYLuOVScp7NA7p8h8zKDg8cYeoRyJu0pFbKOqf43XsJNPz5Dsex/XG7Vd9VXYEDMYHRacV76GsUEgn/Wge53DtykbZIjuHQa+Lei47Ejmg1SmyqPsLf0DYdpd9uAKSktxO1q22p839lFiCh097cjALVPfKHCMHT9A== 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 Received: from PH8PR11MB6856.namprd11.prod.outlook.com (2603:10b6:510:22b::7) by IA1PR11MB7320.namprd11.prod.outlook.com (2603:10b6:208:424::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Tue, 18 Apr 2023 16:03:38 +0000 Received: from PH8PR11MB6856.namprd11.prod.outlook.com ([fe80::f794:46bc:90a:c3a3]) by PH8PR11MB6856.namprd11.prod.outlook.com ([fe80::f794:46bc:90a:c3a3%6]) with mapi id 15.20.6298.045; Tue, 18 Apr 2023 16:03:38 +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" Subject: Re: [PATCH v2 0/6] RISC-V MMU support Thread-Topic: [PATCH v2 0/6] RISC-V MMU support Thread-Index: AQHZbwMkzjc90rCmckmt2T9SvT78KK8xQHwA Date: Tue, 18 Apr 2023 16:03:37 +0000 Message-ID: References: <20230414185815.2994-1-tphan@ventanamicro.com> In-Reply-To: <20230414185815.2994-1-tphan@ventanamicro.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH8PR11MB6856:EE_|IA1PR11MB7320:EE_ x-ms-office365-filtering-correlation-id: 8780909a-dc66-4b2c-7ca1-08db40267892 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DqkTx+6ZozZjMddGuuol/CMwUBYUmJZq7R2/7VBf7Mm0TE549bZnCpe3J4L4A5Y/qoDJKq5DZbRoeF9jVKg3FnLh+BndMutlGvvTmO4po+l0jfe1R4PlMvQ/9Ulkt3G5a5KI55/1r6elhLHXtIdf4QLd5p+7WNLCDvikr4bBf8xWV5BTu1+gC6oGGsYEUuWhRbggEysCDl83hhRPg2n5HnYZQxsUxc/23IejB6G/6i6CdZtbf/JwqJmeuzSORXpofHaY94Gi9Ly3z5Knl3HJq8cCbNAa9Gv4tC2mgZLLN7CjarFjt8PbvI+iXtTwyFzWndjpyNyviNsjKZkY0QVtlD1LpsUXp9lciN9EI2szqub0vjC1nVQSXiLBaLI2EL++F3orCQLsN8mJM8wG75mHx4Rj5gkEoZimmAuctlV5Ju72kW48riqbQ8fqpeKs7G3tQGgL7Erd8unFD5xo+cWH4JmXxyxJLPTMvHFMw3H81qPygtX59FPIMIS6HspDx2WFPEddYiy7q7KxovsehRZ9LVZGEhQUxcKfRQqn9MaWmtWPAqNvbZlIjWsppxCD0bYeeiuYAzELHOXu0Jh+lI4G/E7Mqux0wZlp6Q+f59uUWLe95w72V3jzzBnsaF87IuyQ x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR11MB6856.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199021)(5660300002)(71200400001)(7696005)(76116006)(66556008)(66476007)(2906002)(4326008)(66946007)(64756008)(66446008)(19627235002)(33656002)(86362001)(8936002)(38070700005)(122000001)(41300700001)(38100700002)(478600001)(52536014)(316002)(8676002)(82960400001)(55016003)(54906003)(9686003)(110136005)(26005)(6506007)(53546011)(186003)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UQQAIlL7Rg3WgZLyZAxEmZsUyjnOWNLG2JkTRBamu+IlPHF1YRM8Z+XyTwOE?= =?us-ascii?Q?to91MJsEmjvEbWG0EBkNbztTMkcabS9Pc7bewznZ9z2UhNd08kWCLoxpfjg3?= =?us-ascii?Q?gbK/zuktt1PQLokMSEv2QOaEiphpsvIWZqLBOTpqE1pewqrf2K3eYmrDspVx?= =?us-ascii?Q?/a9/qVDIHgCZFPjBbO3j1bPXrevZo6Zf05TC9Of29K8JpZWdqeTrPUeviRlz?= =?us-ascii?Q?e4Fy/CpJLeoD1S3HtReLk7WlJlh+X0c6z6FSYnxi0z4d9JTper33+ZAschxu?= =?us-ascii?Q?l+2Y9BLJftNKm2dUdToHaEHWw8TgCENBGFlyUHqHYzQPXvxOsKB7KUJWr1st?= =?us-ascii?Q?4VkaUctSLJl59jb2XsAQXCexMQbnHHvDgAqFx5Bt0OgeuMkBV7a03m+AlQLp?= =?us-ascii?Q?+CupQYvf+fZZ1QlF7BkfZVrK54DEx85c2NcEnHYV9nb29EE7EDV92ot3J0Nb?= =?us-ascii?Q?fCreL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YSM+jkC1kyIuu?= =?us-ascii?Q?rRZi5YPAVyzD25KK1tzolNjKDU7G8XUETMM8zWPHOcve++ugUaITnap2u0RU?= =?us-ascii?Q?rL0f/KUwweFiteHdFJeLErYAcL35JA33yfaKofKtgfb0Y3Z3ezPEqjwNe3l1?= =?us-ascii?Q?SLWcDfOelWvqjVg5URfxxP7ETaREYB0dIev+wQjMi/fyb6Os5VrNoXgbucL2?= =?us-ascii?Q?AfQ7lgW2Lvox10FnWpjRGDT6Ypm9WW6JPct3fN1Kj+76TdsEQV/dzQAycYvl?= =?us-ascii?Q?og=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: 8780909a-dc66-4b2c-7ca1-08db40267892 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2023 16:03:37.8769 (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: mrB56SYPsw0B/2WqGEiQhXYyDw/D7UKNPApIdzRa9Sv+7vNjK3uPKxg9WK5PPJ+G2VgFZYn9s4TWXd3iNM3gCcCTveVDt45GDVkq2OJ1a4Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB7320 Return-Path: andrei.warkentin@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Tuan, Do you mind sharing the GitHub branch as well? It would help with the revie= w immensely. A > -----Original Message----- > From: Tuan Phan > Sent: Friday, April 14, 2023 1:58 PM > To: devel@edk2.groups.io > Cc: Kinney, Michael D ; Gao, Liming > ; Liu, Zhiguang ; > sunilvl@ventanamicro.com; git@danielschaefer.me; Warkentin, Andrei > ; Tuan Phan > Subject: [PATCH v2 0/6] RISC-V MMU support >=20 > RISC-V: Add MMU support >=20 > This series adds MMU support for RISC-V. Only SV39/48/57 modes are > supported and tested. The MMU is required to support setting page > attribute which is the first basic step to support security booting on RI= SC-V. >=20 > There are three parts: > 1. Add MMU base library. MMU will be enabled during CpuDxe initialization= . > 2. Fix OvmfPkg/VirtNorFlashDxe that failed to add flash base address to G= CD > if already done. > 3. Fix all resources should be populated in HOB or added to GCD by driver > before accessing when MMU enabled. >=20 > Changes in v2: > - Move MMU core to a library. > - Setup SATP mode as highest possible that HW supports. >=20 > Tuan Phan (6): > MdePkg/BaseLib: RISC-V: Support getting satp register value > MdePkg/Register: RISC-V: Add satp mode bits shift definition > UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode > OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size > OvmfPkg/VirtNorFlashDxe: Not add memory space if it exists > OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform > devices >=20 > MdePkg/Include/Library/BaseLib.h | 5 + > MdePkg/Include/Library/BaseRiscVMmuLib.h | 39 ++ > .../Include/Register/RiscV64/RiscVEncoding.h | 7 +- > MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S | 8 + > .../Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c | 569 > ++++++++++++++++++ > .../BaseRiscVMmuLib/BaseRiscVMmuLib.inf | 25 + > MdePkg/Library/BaseRiscVMmuLib/RiscVMmuCore.S | 31 + > .../VirtNorFlashStaticLib.c | 3 +- > OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc | 1 + > OvmfPkg/RiscVVirt/Sec/Memory.c | 18 +- > OvmfPkg/RiscVVirt/Sec/Platform.c | 62 ++ > OvmfPkg/RiscVVirt/Sec/SecMain.inf | 1 + > OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c | 25 +- > UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c | 9 +- > UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h | 2 + > UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf | 2 + > 16 files changed, 776 insertions(+), 31 deletions(-) create mode 100644 > MdePkg/Include/Library/BaseRiscVMmuLib.h > create mode 100644 > MdePkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c > create mode 100644 > MdePkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf > create mode 100644 MdePkg/Library/BaseRiscVMmuLib/RiscVMmuCore.S >=20 > -- > 2.25.1