From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.50654.1680255702525029197 for ; Fri, 31 Mar 2023 02:41:43 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=PW9WKbCS; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: dun.tan@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680255702; x=1711791702; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ULKzstHmXJSDRtT03WFIIbLagjJcYwbjjhwEKNHchnw=; b=PW9WKbCSUvq4AZqrPA7zrrecRQfGAi4PN7/Tos4OpaQdAEgz8xoq3T+c U4xOT+eKvVtwuu3LyOY1/TxCdNx925KCynhDhBQr3dY9UeEkO1T5UCg/t 6ae6Y859tWTiKv3REM6Fb7cXpss6M3dVyNOwgnCUxks8Bnh0/+vY5G+rR isvOeOOE8wTtZp9W1e3akAbK2D6WxLGi/nnzgjyNyamUpSbDPROFLp9mz uUfjxFksUCMQ/GTea8VSLZ9b9tgciNtVkiBXqnJ/AwZE1K+Eb32TAyjmS CsOBflOBpl0Mdo6XuMEFKavsqITr/XNIlpP324wFFBU/JIeN8u/vh2NZ/ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="329942320" X-IronPort-AV: E=Sophos;i="5.98,307,1673942400"; d="scan'208";a="329942320" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2023 02:41:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="808981858" X-IronPort-AV: E=Sophos;i="5.98,307,1673942400"; d="scan'208";a="808981858" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga004.jf.intel.com with ESMTP; 31 Mar 2023 02:41:41 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 31 Mar 2023 02:41:41 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.21 via Frontend Transport; Fri, 31 Mar 2023 02:41:41 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.175) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Fri, 31 Mar 2023 02:41:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EQ8sydLYm+V5l4k2zoYkE+Xkqqy+QHWYSnm3TK0gw8m47NqYLXoz5ja9Pid2nZlXv/4XqJrk571U8yOqenKYEvggA7KRI+enkivEFKxeoCyrNKf0TDnNeHW2GhhNDgWLi3+U4+aDSwYX8/JHpDb9xDLJ98dlILj8CCzpjjBKQsec4Gy480gF9I0CEceKyzEy18RrtSn3ajkX8FYI9/yJkyH7NHxxsiZybzSvYpHNOyxSDAL9qQfaIl+AyG7LYM42wj09so8N3dIg8Bm/xXM/C96O+CKTnRnygJrxH8+FPZ6Anky1oiDSLNBg73HaoA5zf4nhHnzgje0L5tzN0qOxOg== 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=Yt9OeaxKNCoaFsiUryeT+Z8E76RSGzlnO3rBgc3G8yU=; b=jz22eez1hMM5AH0AwPebYjlPe7S2FFhq7KtpeaNFZuY7bPu4QsfMFlWf1Z3kIV+P+B0PIcwq2ATXknVj0OHVA1UId6KPV1Uk01OneMLAUDeaA7l5xjkKou3BIjBwDCNlDpCzzLUSI9yLAeUFRuEyiJ9Q7/LRi0lqwFuMFLWNG/P8qokwE5vfVnEQFOnPGCjJzgahRBF7XE8W1yhRK1Rx3T4A6aiebdjybbntoREdK+GPhiwgNBh+ONSSgmPTE7VkIGgrOwOMEExjb6S2HjuSMvIeVYA9JPnzRDW34LncOWlwylVsFaniEER/6B2kNrUnUIaUl3QVidBn5vPFNVtfpw== 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 BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by IA1PR11MB8150.namprd11.prod.outlook.com (2603:10b6:208:44c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22; Fri, 31 Mar 2023 09:41:39 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::2ac6:e032:8994:2e12]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::2ac6:e032:8994:2e12%4]) with mapi id 15.20.6254.022; Fri, 31 Mar 2023 09:41:38 +0000 From: "duntan" To: "devel@edk2.groups.io" , Tom Lendacky CC: "Ni, Ray" Subject: Re: [edk2-devel] [Patch V2 0/8] Create page table by CpuPageTableLib in DxeIpl Thread-Topic: [edk2-devel] [Patch V2 0/8] Create page table by CpuPageTableLib in DxeIpl Thread-Index: AQHZY7RZkyyq0+r/CkeCBOilYLfNH68UoVeQ Date: Fri, 31 Mar 2023 09:41:38 +0000 Message-ID: References: <17517763F19F09A0.27612@groups.io> In-Reply-To: <17517763F19F09A0.27612@groups.io> Accept-Language: zh-CN, 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: BN9PR11MB5483:EE_|IA1PR11MB8150:EE_ x-ms-office365-filtering-correlation-id: be6abe4f-f18f-4ea3-f862-08db31cc205e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /iwpXyigO5OqTgmv/Z3TiovEDxVGl5iIIAV8hB3KRL3zqYNimGe3PgVsNeeXKmd6xgAWiC8ylNp+kiyn0kEvNUuc1ZnDAOTKxQlPfFlS8OPKE/AfHTDWkfDD9IdD8cUsX1+E2GH0kXZttzQ8ZcxrdtE+k6WS5xHMoCQtT554mB9/fUGJxmbdg9of/3pfs35cbwg+We3SrCFYChKeABRED/5N0uFLhH6lJIyTGlEgY9/vSdptfv6fXJYhMyMtFDNUZjEPcRK1kF+mpKQnDCmQ/DVhHLvSEZ/j1uODVhDi140nsPWlOFhieWipSsgWVlhGe2jWTkttw7U4T9LHAjoP7vAyHHvrIrQCuuK2RE9flewbRDiSrO5gJDa6XDQ7AiWAtYewX1D2eP8Tv0lFL99jfDGylAdSVQEtOW7+nb5lp5To9OFxvJA5MhPlHt5UAXMsKm8Yf2ghwmDYagG1BVKdGMz36aAghOwV7oKNWvA6+sm7OjJd0qCxxtmR9Gm/LJCau5rcLXEjQLdJn6iVnFGczOhu3GKJeCg1VuhRvqxmCxE+DP2QLyhiYwtipKt8wYJTFnJvVI8jqw+3TDAUoyNxv7WK5oHjqYAWAMpgGMcmQPD6xk2ZN3Vj4zDMT5jV7bF6VyYJZmn6q42RtqHYiVXMog== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5483.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(39860400002)(346002)(136003)(396003)(366004)(451199021)(66899021)(2906002)(66946007)(4326008)(52536014)(66476007)(76116006)(41300700001)(8936002)(8676002)(19627235002)(64756008)(110136005)(316002)(66556008)(7696005)(66446008)(71200400001)(55016003)(478600001)(33656002)(966005)(82960400001)(6506007)(107886003)(9686003)(186003)(26005)(122000001)(83380400001)(53546011)(38070700005)(86362001)(5660300002)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?EffnYZeFTegMU0HXigqP9q8o7JoLFAQ/BKAE5QGvbp9j0VLIdwsPEy6oieTb?= =?us-ascii?Q?XqbZII7LdmDuAGkeZsqy8rb1r5xo1sLQvfmb8bHAsuQbTc+dn8PAHlDFcvPI?= =?us-ascii?Q?PITnlysOhOEQlREeu1kFLkzGnCDYbNDJfAkJa4ua4Gs3sSQsH6DJPLgc9k2F?= =?us-ascii?Q?4KGTu7aKd7JuzQHUlzLe9DLtK3Py7+Rih93ZmeDmM7U4tW4PxdlMkVs1tlO1?= =?us-ascii?Q?Q7rY4qKvBiPiBG2dz7O/iNyuQ997w4Mkl3UCqMN39Bp9vYkVidCwTDrb6Tiz?= =?us-ascii?Q?vWYTEH8WjMX0JecCqgPKm5Fa4+fF14HXxYIvUcsw7YKt5Fs/12o9nbOd+xsj?= =?us-ascii?Q?yyNkUdlfTu/MecsNHT3neihZI6cTEiNki0OCbkij5ByZefa/uxPcpfAJHC6e?= =?us-ascii?Q?9P9MAuLXEaX9KTg9eASGyN2hK/f0FuSShLpW/xo9lH2T/kJwg8TGPW3ItwWr?= =?us-ascii?Q?lMDw8b0Nis/vgm88jUNpakAWvRr6E2DtYXnad/lCtHi3xmtSMezQVuD1jQqJ?= =?us-ascii?Q?MwLxLZBV/2zknZzItwXaw7Sn1KDB3lGRtuHjHDwTKybuuD+eX1vc+S9A2N9I?= =?us-ascii?Q?RU0p7KeLtRlB0lz2QH78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us-ascii?Q?70u7nHSf+dMcC/lCQ7e4t8ka9JZhSmFrQsjzKvRQF+T0Ov0MB+h+hsJD2TyE?= =?us-ascii?Q?5gNBMQQsMLuQ8YyxH2c=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: be6abe4f-f18f-4ea3-f862-08db31cc205e X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Mar 2023 09:41:38.9071 (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: Hx1wDubwpcqb9YU2ioFWXu/9BLlglu4Q+NJRl40vSxE9vqDtEauXWg/gURBJ0e/sJ1HzeGRMljDVI7c3hJYGSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB8150 Return-Path: dun.tan@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Tom, Reccentlly I sent this patch set to change DxeIpl code to use CpuPageTableL= ib to create page table. I have done some test on Intel CPU to make sure th= at the page table created by DxeIpl before the change is the same as the pa= ge table created by DxeIpl after the change. But there was a remaining case= that I didn't cover. The case is that PcdPteMemoryEncryptionAddressOrMask,= PcdGhcbBase and PcdGhcbSize are not zero(when memory encryption is enabled= on AMD processors supporting the SEV feature).=20 So could you please help do a test on AMD processor to make sure that the S= EV feature still works good with this pacth set? Thanks,=20 Dun -----Original Message----- From: devel@edk2.groups.io On Behalf Of duntan Sent: Friday, March 31, 2023 5:34 PM To: devel@edk2.groups.io Subject: [edk2-devel] [Patch V2 0/8] Create page table by CpuPageTableLib i= n DxeIpl In this V2 patch set: 1.Remove the unneeded patch for ArmVirtPkg 2.In this patch 'Create page tab= le by CpuPageTableLib', change the input parameter name from Is32BitPageTab= le to Is64BitPageTable and add a line of "MapAttribute.Bits.Present =3D 0" = before set a range to non-present. 3.In this patch 'Refinement to the code to set PageTable as RO', add a line= of "MapAttribute.Bits.ReadWrite =3D 0" before set a range to ReadOnly. Dun Tan (8): EmulatorPkg: Add CpuPageTableLib required by DxeIpl in DSC IntelFsp2Pkg: Add CpuPageTableLib required by DxeIpl in DSC MdeModulePkg: Add CpuPageTableLib required by DxeIpl in DSC OvmfPkg: Add CpuPageTableLib required by DxeIpl in DSC file MdeModulePkg: Add UefiCpuPkg.dec to pass DependencyCheck MdeModulePkg/DxeIpl: Create page table by CpuPageTableLib MdeModulePkg/DxeIpl: Remove duplicated code to enable NX MdeModulePkg/DxeIpl: Refinement to the code to set PageTable as RO EmulatorPkg/EmulatorPkg.dsc | 3 ++- IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc | 3 ++- MdeModulePkg/Core/DxeIplPeim/DxeIpl.h | 3 ++- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 4 +++- MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c | 112 ++++---------------= ---------------------------------------------------------------------------= ------------------ MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c | 5 +++-- MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 711 +++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ----------------- MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.h | 182 ++++++++++---------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ------------- MdeModulePkg/MdeModulePkg.ci.yaml | 5 +++-- MdeModulePkg/MdeModulePkg.dsc | 3 ++- OvmfPkg/AmdSev/AmdSevX64.dsc | 2 +- OvmfPkg/Bhyve/BhyveX64.dsc | 3 ++- OvmfPkg/CloudHv/CloudHvX64.dsc | 2 +- OvmfPkg/Microvm/MicrovmX64.dsc | 2 +- OvmfPkg/OvmfPkgIa32.dsc | 3 ++- OvmfPkg/OvmfPkgIa32X64.dsc | 2 +- OvmfPkg/OvmfPkgX64.dsc | 2 +- OvmfPkg/OvmfXen.dsc | 2 +- 18 files changed, 200 insertions(+), 849 deletions(-) -- 2.31.1.windows.1