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.7702.1683686941737360264 for ; Tue, 09 May 2023 19:49:01 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=b0Kt06Cf; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683686941; x=1715222941; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=dOBFhy4t6KgzHqPCJ5/nk9qwtXQnNFWl7VGDYtMv3EA=; b=b0Kt06Cf8jiW5xkP97dzpZcWjZvQQBf7215xto3x25+bpw7Q29l1eSAA QJOodq7QJ6Xdt5e5d3T36D8LyjN5mRxY65P6shJrhbAKpof65UjT4ZAOh ukxvih3pq7Za2ruNS9BuWYHKikj62bLo1/Z+gCBBP5G2ZlIk0N1ACwi9o Jn99dLg9pzu2owLcBArTodynUAoWg2JehY66I2El7KVn2HMusMQshZnEu zhrq9vjfjKUHuz7qVZwYZSGJilpDUXODxuu6lA3M8AbxzLdZ78l2UowXW A2B5z3WUUG13sqRd9m8NsXBH4zcJRzzz19zgWCEZ7+M/Z+JbrbELGKJxL Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10705"; a="339349802" X-IronPort-AV: E=Sophos;i="5.99,263,1677571200"; d="scan'208";a="339349802" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2023 19:49:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10705"; a="731991831" X-IronPort-AV: E=Sophos;i="5.99,263,1677571200"; d="scan'208";a="731991831" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga001.jf.intel.com with ESMTP; 09 May 2023 19:49:00 -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.23; Tue, 9 May 2023 19:48:59 -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.23 via Frontend Transport; Tue, 9 May 2023 19:48:59 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) 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.23; Tue, 9 May 2023 19:48:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DMIs4PrgTq4lZtqUvYlEh7FIke1XKDV99dmlE5uAmGKnGD/Og4sE0t2sxxk+qBepB3E5M8BInm6lPvIOthj1iltURroMfXS+N8YkSyIue6jqHZiZyW8P3SB9R8UhIHyt5gZ6A9zpuog/iE+SK8MlkIwyn8qaygRBABGkWOWAknSkzKAGMuBDHrNHlNdCwLig0GH9A2DjhODvVrSCocm/A1hEniudI2J2hVvDT8rPvLX5u4Afur5CGuHujvAmhcD7y6v899Z5WzkHrY9vrC3Egaf42V9vR5vjT4yqiDrXjOfyE/Fe6iMKdEe84WGGa8qhhWXQRpNH5exMw9tq1aPTbQ== 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=zYy0aCYrWXMmkXA1J2wtyM5iR5GQtT8MLp+JUddQDZM=; b=aRTm0tfNaijgIKvDD+hos5LMUaRtHY3BsP5pZpErAzUhiWw9QCHTXydZLgLnDiMTqIZXuG8E76bdReGmRNGy47deL6DIRaW29BiMwyVB2GainJwu5/Wp3qO9keFiOCods75NH7oSZeXHYVu8z8pcXwW57PzEvH8MJFzn0yqYia2kL200hbn7wM8P2QBwIVZDKQqtPgg+GX4uh/eu7yl9C8CfxWizR0zRIvZ6VFUlM04dOehbP8+Idk1kcLuEvKZmaknaqEt+c3u92dLsjMWR/HOWGicjx/XIev/2aB/vWa6LbIMTUPqPpSRCZkouTCInfpVkd+vypi7X0teVhX9Vww== 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 MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by BN9PR11MB5338.namprd11.prod.outlook.com (2603:10b6:408:137::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Wed, 10 May 2023 02:48:52 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::892b:b8e6:bab7:635d]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::892b:b8e6:bab7:635d%5]) with mapi id 15.20.6363.032; Wed, 10 May 2023 02:48:52 +0000 From: "Ni, Ray" To: "devel@edk2.groups.io" , "kraxel@redhat.com" , "Wu, Jiaxin" CC: "Dong, Eric" , "Zeng, Star" , "Kumar, Rahul R" Subject: Re: [edk2-devel] [PATCH v1 1/3] UefiCpuPkg/SecCore: Migrate page table to permanent memory Thread-Topic: [edk2-devel] [PATCH v1 1/3] UefiCpuPkg/SecCore: Migrate page table to permanent memory Thread-Index: AQHZgmBA2axaambWnE2b6Jc8et0F4q9SA0SAgADK0bA= Date: Wed, 10 May 2023 02:48:52 +0000 Message-ID: References: <20230509102253.16632-1-jiaxin.wu@intel.com> <20230509102253.16632-2-jiaxin.wu@intel.com> In-Reply-To: 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: MN6PR11MB8244:EE_|BN9PR11MB5338:EE_ x-ms-office365-filtering-correlation-id: 86ad9f9b-5395-49ed-b4a1-08db510116ea x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MMSn0uaYH7lxYYclHj+y/Tgz9/J29DscpKiovwPF0XS7qq/rYAbBV+7qrcmfawRkzFLPF1j7tAv2JYGOZY86x6tZnfegAhkDiS7SMKm7OvHnMTKewsjFGNWCjiWggQn7c9r2oQntQYzczrbNBzEeI8l3Fo0IA9XvnAESp1N7YxKeVuz5hbFtmbnm0dOxlJQtPAU4w/6USCu8m77nXAHgpn/9E2dHBA45t4OoiH4bUb28zOyA1mfBBF8L35gdfxlCxh6YvAjsJcgMmP9tsOZsaycXVIUfOP+RB0OJp50QakdMo4/pqlPo7b4nDg0dhNnsm7p59maqhtwEx/2Q/BcwezA2Dl4NofCqjnWBGKo0lLXpcBjB8Cp0BCjOGp3+MokJ011TAXg9CLTOGeIkl9QEq7xYfvn4bPxj1hSjVL35KwBrz2GgLrDre++9YwI8RAp2KjDkcW+pOrHyNxNM0PS30GWTRwgvPAyJYBkKrWdDji3KLhcwgLTUay4fI0GK1qcRANge/xPq4aIQoKTgS108BIxraHQjl1IL8ZlQn1Yf8KlESCmuenv16Avj1Mhf6Dh3SJdbLHWs68+0sU0jMKFLabXBCkwW9VWR1CmU7GFCrCczowF/87yM0dxeUCr+04ovOgRQMoquGpHWISQuXuj/EA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN6PR11MB8244.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(366004)(136003)(376002)(396003)(451199021)(66899021)(7696005)(52536014)(38100700002)(33656002)(5660300002)(966005)(8676002)(8936002)(478600001)(54906003)(55016003)(122000001)(316002)(110136005)(82960400001)(71200400001)(41300700001)(6636002)(4326008)(66556008)(66946007)(64756008)(76116006)(66446008)(66476007)(86362001)(2906002)(38070700005)(186003)(83380400001)(26005)(53546011)(9686003)(6506007)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?VESogYtozO0ozfKrSFx+xHndrjUHTWVIgwLQF2O1pGyw9nieV27wi0WAmQ7Q?= =?us-ascii?Q?rAjYypmk2puXg5pB/KU/ESNHRdj6BTPLHTJeQc5FmxeTRR3avEduZqi63WRP?= =?us-ascii?Q?zUgoGK+HORthKl/Y500bEJtw2/fJ8EP4PWD0On/aCIVWgUw7MfBIdjvQyRrc?= =?us-ascii?Q?6AGROHufne4fF17N1tfVdQ8/G4uBSSJmOQN/4FNmvyqcVk8s7tYSnSZzU6mE?= =?us-ascii?Q?Hwcg+AIw/v3+0nc/jBuecBskDlo21c8WvyeOtG7/TfkO6d2YwKvrTLqT0vZM?= =?us-ascii?Q?uujtcvS5oLd9EpfcO23yk2uKq4DbmQc7NBYZYgsRF/ECtDsSEeihaDjEj4PL?= =?us-ascii?Q?fPte3Um9m+uLmNAgaGOM9qAY6KJXoxe2vQ7bzwQU3CbHYq/Jjj3ZVTjvIYnN?= =?us-ascii?Q?StDI64EuG4xmOV7XJ+Up2tRPUwPhnDGRcm6ERTu5acMgrbPKTAb7qOtimW3C?= =?us-ascii?Q?dU4Fn/gmX2pavGqRf+kI1poNHmnqb2rCIAEaLTlcmnoDLUf2jtE5ObohqpMO?= =?us-ascii?Q?jyQOAu9flNJnbKvkQl13sTIzwqm1aCU16PbK+kYv6bEbGFpmVi6Ui3MZXl34?= =?us-ascii?Q?Gni26rfs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kJesKgK?= =?us-ascii?Q?PTGiYraEgXI2Z+/JacBCa0PmJZScH9UJAebCelHzCwZmN+2VglBs4BohEpN0?= =?us-ascii?Q?b/T7Vle1qs8EuG1Alaw=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86ad9f9b-5395-49ed-b4a1-08db510116ea X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2023 02:48:52.3794 (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: J1IiAa9p9FsqA9y60wAux94qImn3UueBnhsL6fnPHomv65dRQ3QVjPT5Xv9IjOYDMuDcKfAh17pVvhwPM7mFHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5338 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Gerd, My understanding is that when code dereferences memory address, the code it= self is responsible for supplying the sign-extended linear address. The page table creation logic still maps the entire linear memory space sup= ported by the CPU. Why do you think covering the half of the space is better? Thanks, Ray > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Gerd > Hoffmann > Sent: Tuesday, May 9, 2023 10:39 PM > To: devel@edk2.groups.io; Wu, Jiaxin > Cc: Dong, Eric ; Ni, Ray ; Zeng, S= tar > ; Kumar, Rahul R > Subject: Re: [edk2-devel] [PATCH v1 1/3] UefiCpuPkg/SecCore: Migrate page > table to permanent memory >=20 > Hi, >=20 > > + if (PagingMode =3D=3D Paging4Level1GB || PagingMode =3D=3D Paging4Le= vel) { > > + // > > + // The max lineaddress bits is 48 for 4 level page table. > > + // > > + VirPhyAddressSize.Bits.PhysicalAddressBits =3D MIN > (VirPhyAddressSize.Bits.PhysicalAddressBits, 48); > > + } >=20 > virtual addresses in long mode are sign-extended. Which means you have > only 47 bits (or 56 bits with 5-level paging) for identity mappings. >=20 > take care, > Gerd >=20 >=20 >=20 >=20 >=20