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 7ABA8940D21 for ; Thu, 11 Jan 2024 01:56:33 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=AE6w/VXO2WMnHBi8GHLY+dXGm9NoytRygRPfTtBs9wY=; 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=1704938192; v=1; b=TX3jNmAOIR93job5oldZ5payX8Js5TxNSmwnlaDBls5u822GoBqggAW3jiQjWUpsDXbGROw2 nUBiUugktdsHF6pun340DImdkyilf3WgQyKDXinzmqgp0zw3NDaTJ71JUp4zVZMWZGv+JCPqf7N 6HymvLZQsYYuY6LG7xex6gXI= X-Received: by 127.0.0.2 with SMTP id dEvfYY7687511xOgYokexMnU; Wed, 10 Jan 2024 17:56:32 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by mx.groups.io with SMTP id smtpd.web10.2280.1704938191472769025 for ; Wed, 10 Jan 2024 17:56:31 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="12195952" X-IronPort-AV: E=Sophos;i="6.04,185,1695711600"; d="scan'208";a="12195952" X-Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2024 17:56:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,185,1695711600"; d="scan'208";a="24461965" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmviesa001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Jan 2024 17:56:19 -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.35; Wed, 10 Jan 2024 17:56:18 -0800 X-Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) 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.35; Wed, 10 Jan 2024 17:56:17 -0800 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.35 via Frontend Transport; Wed, 10 Jan 2024 17:56:17 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) 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.35; Wed, 10 Jan 2024 17:56:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M5pfcIBu43kzia+PHrW9u/C3sxVdiDWTTfarb2kMPpTc4/GaOVDKxTvL+NxFtIv4FL18npUPL+j96C0LDqH1NjXM9kySslyGOACMg6HN49a3tQ5IzdXV1MWuTN7eNlri2zkaIyZn6f4V2YPpaAhb2Q6k/W0nasFia/eHaorveXMp6Q98BHenKoiX/2vpwTi65TAILfZ7qSZgoiAq7YurcSDq6tj1eaTResJzgiejK/fXZcspTKNFcqJVaXCaQvkPwGQiNL5+m8HCee2HX5NommQhpuTK9PYX/lvQwtOAirjW3qEyZsh5VpOSVnKUVW0KrnO37SACVIba5tmWj253Qg== 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=BxRSTgRVWA8wJjbwAQQECX0EoV48SeRJ1771XIkkKAI=; b=QlBUOTPVDNsQfs3NzfRLTIBEpxyNyafjZWk5ppQf2SBETUl4Evef2R8y4xeV0rIIEHfm7LMGqWK9TKGa+z3xOJmfKRrlAxCm+cHYn+hI+4UVt81KvzoivuL330PCj0Wl3XPgjfbEFoB4dkZjey+7ZwlDAF1YDrMAuCb8WY6xNOFXgFieldRu4ltloB4qjSccbzlf0H7rWoh8DkdtdscMd63htJOqrhAU7oup2S15ZqWOudwcE7xvs81IYU6XqhU/8ofBbANJ/vmIRseDVGoxZXqcpmwxVC31QOaSPHGD6FpWr5GRf/VBILrkZiDwkNwYGNwM4/0WV0pEJzYsy3IzHQ== 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 BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by PH7PR11MB6524.namprd11.prod.outlook.com (2603:10b6:510:210::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23; Thu, 11 Jan 2024 01:56:10 +0000 X-Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::aced:fdb2:cf39:5641]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::aced:fdb2:cf39:5641%6]) with mapi id 15.20.7181.015; Thu, 11 Jan 2024 01:56:09 +0000 From: "duntan" To: Gerd Hoffmann CC: "devel@edk2.groups.io" , "Ni, Ray" , Laszlo Ersek , "Kumar, Rahul R" Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg:Limit PhysicalAddressBits in speicial case Thread-Topic: [PATCH] UefiCpuPkg:Limit PhysicalAddressBits in speicial case Thread-Index: AQHaQ7NiFYd6s7/n006aYYcMoDsTfbDT2tAg Date: Thu, 11 Jan 2024 01:56:09 +0000 Message-ID: References: <20240110080544.1350-1-dun.tan@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN9PR11MB5483:EE_|PH7PR11MB6524:EE_ x-ms-office365-filtering-correlation-id: 4a53adc1-58ef-4774-6c29-08dc12487b75 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: I5oDyzX0OrlYJvFlJmZKGesQcsyGs7hVYt8iWhLZln2vhDV8lUerSTGlB9psbqlq/e9QpnsK/rfXrQBrDjkd/SxcBYshcFhoJiu7LBgJmogMmjInCzL/kMWSZ1CKEyiUxgTZt8D2mg+ceGylnE5JsOS56UfFtgt2t7TaGhqeKBmgmwxvLK1vzgO8eGez4skhDY0EzpqvU85L0t+M7gMcKPR8RQtmRAIVEjoQjv1u+BDm2TjeOdWY8X1qVVyGCd15qjlgCeYcfKIlhgJntEBQA2LZ/DbNnW6dv0BazlrK5W3zyky7gxvvTsvrgSMjmPI29pxO/ahnie9zNnCMBo36PDS1XAI38+I5J5OmlOtJQKN+rAwiTCgRA7YayCa7De1GltJ0wPo6rjjEAE80SU6GCWJezVEb8uysyyBuSqWFppvGxyoJ3Eas8UQ9AtzSQtxxSSLQVv+OXBxX/JKQTahIE/Lo6vJAPjooFpfxQ5zQNtPYXjDStLqiqcLQRWleBc7Pjy6vBYM3QrHjnwFRJIjC010hhagJ88ZFtnvRssdrgzL6Xc/ZcKSoIlaqffuZNQ+sYfr7brxw5/+02smNYni2hctDnKULYjMaQN5h96btk7P2ykuXc5Y7nm9Ne0nqki8OQ9zemSIS5ts42MaN5gFdhVq1pattaXPkb/WKg1gZGDA= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?FfD7LoQp9q8IRKB0Edzy/U7D+aheIKtmWXHH11I1FFfjyrZTtwrOiVZWxjSv?= =?us-ascii?Q?mguM9RpSrqYuHI14A1x14bo5n02ZOiiX1it6Ka69DgapbQn2O/KBIk9wQuW/?= =?us-ascii?Q?JyuYCOaU2Rk44/olfq+b72Ke9LWpZJhlFpiSk6SEW/2YvYzcIu92KXkrztp+?= =?us-ascii?Q?rE/LTqfGw6lO6RrLLVI5jKVdRdmDB08FaRYyhveaXe7Ce+1JK2OKuhJTqyby?= =?us-ascii?Q?ZSfJ/TeD6xyVLvUmJXmVEwJB5twvyZgwmeEKWe7J+/eJkDXQP0ojbLIBSCk+?= =?us-ascii?Q?uN+EHMdtkWiHTiYSzNy8g1WtLZRRNZkIGJAsbF+I1ftfgXIfw8B+8CShwk/S?= =?us-ascii?Q?vKECX5/iK4djos2eAG9lrf3iGAW5DIWx6SxGyC0ip286IrdtRF0lWc4Yqg5a?= =?us-ascii?Q?CB40PPyAsbOMNim9cW1zGhSc5+ns33IYTOK+efMJcnbfgD2NS5i9Wo8e63zE?= =?us-ascii?Q?BDZ4dWesuU8v44IaYH+fgjQ6Y5dkxByH2x8li9G5AFV5ZCiN4EDiDHT/Xnef?= =?us-ascii?Q?OBfO25/aLVwowShyLD1vytqlIsitb2duXOj0+Oldtw+qOO7SqABrrXLsXkPq?= =?us-ascii?Q?hnFfttP60EuERzf+WmdSf+lYmQIvPoGysot2RN2j1CGCvG2LYRAHM6mtyeOX?= =?us-ascii?Q?jF0eNg//+P0mixNdjWh3LQXzJ7kLWmP2w0EyY5nzwR7H/y8sQywrWq8AsAt+?= =?us-ascii?Q?5soQ1qqIYQ4VSGUaJRTPzZC1glKZmma/0JcwP9f9Asz+whYAIYdgalX3pvqN?= =?us-ascii?Q?rn2oBlMbDh5hrwqhP5+uU+JMMFqgqnHdHCQaN9FO03EbvPoHTY/i2NOnMzBv?= =?us-ascii?Q?DvgRmbr+ECn6FG06zNxcP2IQrdeSbuilIorfwta2YB5Kb8oVJG7+N/nIL0hR?= =?us-ascii?Q?7o33t2mCvP8ZmAb0kWcHtxOaD8rfbeCn4Cb2PqLQlf7gchERm3YPf8/RIAVV?= =?us-ascii?Q?G7bpZZTWENt79/ZmRyUG+TbiPW1u5ZBcTFkww+If/fnyhgFR5ULTtt/QTqUM?= =?us-ascii?Q?79dBuYk50bKyXJmvs4sQdBJkLkT7UdYkvGUmWDJ46Zl8VB5hOfs7dxVOwdjr?= =?us-ascii?Q?SnlI8p107JUyLZhz9Nd/KfoZWPoqSMJd8TZ5dxw+f7HBwlqO/QJO7A2reU4/?= =?us-ascii?Q?kXxL89xDScMTZ+uFhuYxhsWtude035DnaH4aj2XvY2aD2SbSvCJyxb7ejBQo?= =?us-ascii?Q?yj0DAT+PQ87pwfCXW4L4E7MU/DKER6Slmwpv+trIb+OImBtlkIruuQvX5tsq?= =?us-ascii?Q?Kyhnsw8Af8jSQcY6SU7PaWY/qLrtDWFelxDNZA4ElepA52esv4SIkYuNew6I?= =?us-ascii?Q?SfRdf6n8BSeLvqtJPuiDusERCMMd3IzA/1xAkLw03DCRI8eWARNvEoWHEDU9?= =?us-ascii?Q?qb4uaxj7u1vU9kC4kwNloo4SObp+E4Yuj5cjx7cqkUo8I7j5QKncSzjAinSr?= =?us-ascii?Q?p3gRsaiq6LRc+F0/o0a3CibI5Rx5b71l/wv7OY4Hn68FFR1lleXmlKXJLmbZ?= =?us-ascii?Q?9xnXReKMVI3V/oYTM2uQi93SOO1RtW7HwvsFA93/SCimPOGtbM8Y+jiZRwkX?= =?us-ascii?Q?AziouTmNLOPNzAJCznk=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: 4a53adc1-58ef-4774-6c29-08dc12487b75 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2024 01:56:09.7641 (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: j1L8IlQiWS1RWRErtpq6Sdnr7xHBDUCZ35MIf7wuxVUA+cS+UD7XOiD//B2Vlq6LywQx2J9bKrrMTUpGL1Q94w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6524 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,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: RrhHeVrHOp5SqpadxSh7eTEWx7686176AA= 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=TX3jNmAO; 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 Hi Gerd, Thanks for your comments. I agree with your opinion. Will change the code a= nd related comments in V2 patch. Thanks, Dun -----Original Message----- From: Gerd Hoffmann =20 Sent: Wednesday, January 10, 2024 6:55 PM To: Tan, Dun Cc: devel@edk2.groups.io; Ni, Ray ; Laszlo Ersek ; Kumar, Rahul R Subject: Re: [PATCH] UefiCpuPkg:Limit PhysicalAddressBits in speicial case On Wed, Jan 10, 2024 at 04:05:44PM +0800, Dun Tan wrote: > When creating smm page table, limit maximum supported physical address=20 > bits returned by > CalculateMaximumSupportAddress() to 48 if 5-Level Paging is disabled. > When 5-Level Paging is disabled and the PhysicalAddressBits retrived=20 > from CPU HOB or CpuId is bigger than 48, only [0, 2^48 -1] range in=20 > 52-bit physical address is mapped in page table. I think this is wrong. Virtual addresses are sign-extended, i.e. the virtu= al address space without 5-level paging is: 0x0000000000000000 -> 0x00007fffffffffff and 0xffff800000000000 -> 0xffffffffffffffff Therefore identity-mapping works for [0, 2^47-1] only. take care, Gerd -=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 (#113567): https://edk2.groups.io/g/devel/message/113567 Mute This Topic: https://groups.io/mt/103637402/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-