From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id D40249410C7 for ; Tue, 14 May 2024 05:17:56 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=PaBZ/j2yXyNcNQIAOdHcjhn4yrWGhDmLwSQAF9tpq80=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20240206; t=1715663875; v=1; b=LIzVtFd4Vq4gfhJghxjiH6FnqguSqhejwe3+ouw8Vrb07qlZp6a9cGCjmfdbJouQmofux3Qm d/mlVy2EdgaHGHjhRGHp84GN+YZdloA+Kqkjfp4s4No+gzRjf9FicW+LR6GZiwhoRk5+K/tIc2J oQpKE/x4zYZHbzROZk0S4otqlMtw2QAObN1Pbs0ZExNbT9NijR517yDWVK0+6P2jazfza3Em23h zf6gG4JNssYgFpXSUPP/OYYs6PFJBIb6gnjDD7xMkgRosQ+vwi9B+/d6zLC17vpb1yTdVv3DfF/ DZicPR3w2e9tqezWyDmeOjnXSovLc+4zPLaKxl+k0c/Rw== X-Received: by 127.0.0.2 with SMTP id GWzmYY7687511xS6WnjbkZLz; Mon, 13 May 2024 22:17:55 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mx.groups.io with SMTP id smtpd.web11.8033.1715663874160292212 for ; Mon, 13 May 2024 22:17:54 -0700 X-CSE-ConnectionGUID: 4ckAKQRUSJW3LuQUel1gmQ== X-CSE-MsgGUID: /jpWmsZXQrGEeL5yazK7jw== X-IronPort-AV: E=McAfee;i="6600,9927,11072"; a="34141639" X-IronPort-AV: E=Sophos;i="6.08,159,1712646000"; d="scan'208,217";a="34141639" X-Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2024 22:17:55 -0700 X-CSE-ConnectionGUID: oRZ8CBO1TS6Uaey1HLQBpw== X-CSE-MsgGUID: GbyvHuF+S/iOIwAFI/zJ9g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,159,1712646000"; d="scan'208,217";a="30404139" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa010.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 13 May 2024 22:17:53 -0700 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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; Mon, 13 May 2024 22:17:53 -0700 X-Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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.35 via Frontend Transport; Mon, 13 May 2024 22:17:53 -0700 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 13 May 2024 22:17:53 -0700 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by SJ0PR11MB6743.namprd11.prod.outlook.com (2603:10b6:a03:47c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55; Tue, 14 May 2024 05:17:51 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::41a4:c775:32e6:76a8]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::41a4:c775:32e6:76a8%4]) with mapi id 15.20.7544.052; Tue, 14 May 2024 05:17:51 +0000 From: "Ni, Ray" To: Gerd Hoffmann , "Tan, Dun" CC: "devel@edk2.groups.io" , Laszlo Ersek , "Kumar, Rahul R" , "Wu, Jiaxin" Subject: Re: [edk2-devel] [PATCH 10/18] UefiCpuPkg:Relocate AP to new safe buffer in PeiMpLib Thread-Topic: [PATCH 10/18] UefiCpuPkg:Relocate AP to new safe buffer in PeiMpLib Thread-Index: AQHaosIk7d4/UW13JkuEGzuUOawdRbGVBd6AgAEvLpc= Date: Tue, 14 May 2024 05:17:51 +0000 Message-ID: References: <20240510100827.1903-1-dun.tan@intel.com> <20240510100827.1903-11-dun.tan@intel.com> <23ygznnvg23olq44ztztul76f6sctv3dcqocetesuuixrtxaom@jo7k4ncqdq3b> In-Reply-To: <23ygznnvg23olq44ztztul76f6sctv3dcqocetesuuixrtxaom@jo7k4ncqdq3b> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|SJ0PR11MB6743:EE_ x-ms-office365-filtering-correlation-id: 8e19a6eb-d77b-4c71-ccc4-08dc73d533c7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?IgpWRGyg1CSNr9Ni8oRC009DKddvhlHjBUVUe87OdfxDNrN6CfFGbY9XvgLz?= =?us-ascii?Q?sOkr0KBV8To/2P5wYx0NkNUSOf3wHM8t2/vSk21cydJfUXm7Ad3eUla+Lif8?= =?us-ascii?Q?xGl+Hoy2KPIccCgDYsglrp9KVpEIDBaFeQFIw+zq5RNdhlaSWWcTShCOGFGC?= =?us-ascii?Q?u9bktu/5hSoDByQgBKaucnmrv3OYnUmBjtiFqLd3jc6UjZNUUKtkrh5JSAAR?= =?us-ascii?Q?lfjaCH8oh8tn4j+/RpxCsJ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VKsYzJeW+SP4+GJFho1dABSKowh6OkT342MiAnPGcspKcnjEthCDtcGjEW0V?= =?us-ascii?Q?RPXwaVJ8Z0mnocVVipPx+p5/sh1fThAFpU7i1cbvhQIQrv0Y1Nt85k7bIrvN?= =?us-ascii?Q?yVHehbFfCsNRJDMHWEgyPoyoKh1qD9d2hpOocgiFgAiY4yk+kkHdsxG/zP02?= =?us-ascii?Q?Ti4GVrVrhTvUQsGkQuggx+v1ezQnXMi+4iNzSgrLSUU8Hw=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xASKrzBNx7wiuPC5QoBTdJEG5ymGkdjPEsHOtu/peb8apGUA8vFxrOFYqAPL?= =?us-ascii?Q?iVQXd5gAJXm8yM+Trxzx4FzDA3BPZETueqFugstPXDSSzEW8sRCeie151Blo?= =?us-ascii?Q?T5xuxOVr5Oui+uWSbLfRkQOv9cZ8Tl1uf999WM25483mEni5BzaHxmyDG4CY?= =?us-ascii?Q?BqbSSgi3W/2hAgJCqpEw349NLNQTX4mI6EQk54MvOf2pov6Dz/tLiMLz9qCr?= =?us-ascii?Q?BRdkh2i3k7iuBQeOPEa9U81ZybGisiokGQQfwswwkSlPdlMhtleQB1Yu2Af6?= =?us-ascii?Q?INU70LuyT512Z6ZOPosHr5OF14eNKqKNszfAYbQOBWIWkSeGy4XzX36VmzkK?= =?us-ascii?Q?eCfytauIvnQcMbdYRazESI+DtiqX2HqlOfWJmYa+8v+MBgXPe1e0jBBm5mIm?= =?us-ascii?Q?jPZWOh2h7kBUoHLHzuqVooslpXMKAuErgDkrbP6E8ddvpMVZXqal8zZ4C3H6?= =?us-ascii?Q?ubixER5Ga4kSnnwR1D1rKIi5fiUsBBN7fYO9XgyYwVBZv10Mk311l0f3ONrG?= =?us-ascii?Q?bftJxYI3kYOxc+x0C/YUixXVjOSwdN+8n0VU8RPzqKlf5e/45/z2ZtZIpTql?= =?us-ascii?Q?qUQQrurdYLDhun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= =?us-ascii?Q?hAMhZJYqnsJj7fjwnug9Im3amoVdigwW1/g5+nKwuoLH6eyv1/C/EjEO2a63?= =?us-ascii?Q?Me/K/H+waiiZv7rv2yI=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: 8e19a6eb-d77b-4c71-ccc4-08dc73d533c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 May 2024 05:17:51.3345 (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: NJmIy5we57oIjTuFIENbycP9kFd6PGZ6vufI1PoIJ/KH9B50IELqcrm1Pl8T43y9UUg/sNiaoOZ8Any5qbcAFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB6743 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 Resent-Date: Mon, 13 May 2024 22:17:54 -0700 Resent-From: ray.ni@intel.com Reply-To: devel@edk2.groups.io,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: tx0SkECO3XmcWl1r2sqNLZacx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN6PR11MB8244F24D892B0EA45D7BA5328CE32MN6PR11MB8244namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=LIzVtFd4; 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 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --_000_MN6PR11MB8244F24D892B0EA45D7BA5328CE32MN6PR11MB8244namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Gerd, I agree that the logic might be duplicated in multi places. But even CPU supports 1G paging, caller can decide whether to use 1G paging= or 2M paging, or 4K paging. Using a single API to encapsulate the entire logic may not seem flexible. Maybe, a lib API to detect 1G paging capability can be added to CpuLib. Thanks, Ray ________________________________ From: Gerd Hoffmann Sent: Monday, May 13, 2024 19:07 To: Tan, Dun Cc: devel@edk2.groups.io ; Ni, Ray = ; Laszlo Ersek ; Kumar, Rahul R ; Wu, Jiaxin Subject: Re: [PATCH 10/18] UefiCpuPkg:Relocate AP to new safe buffer in Pei= MpLib Hi, > + if (sizeof (UINTN) =3D=3D sizeof (UINT64)) { > + // > + // Check Page5Level Support or not. > + // > + Cr4.UintN =3D AsmReadCr4 (); > + Page5LevelSupport =3D (Cr4.Bits.LA57 ? TRUE : FALSE); > + > + // > + // Check Page1G Support or not. > + // > + Page1GSupport =3D FALSE; > + AsmCpuid (CPUID_EXTENDED_FUNCTION, &RegEax, NULL, NULL, NULL); > + if (RegEax >=3D CPUID_EXTENDED_CPU_SIG) { > + AsmCpuid (CPUID_EXTENDED_CPU_SIG, NULL, NULL, NULL, &RegEdx.Uint32= ); > + if (RegEdx.Bits.Page1GB !=3D 0) { > + Page1GSupport =3D TRUE; > + } > + } > + > + // > + // Decide Paging Mode according Page5LevelSupport & Page1GSupport. > + // > + if (Page5LevelSupport) { > + PagingMode =3D Page1GSupport ? Paging5Level1GB : Paging5Level; > + } else { > + PagingMode =3D Page1GSupport ? Paging4Level1GB : Paging4Level; > + } > + } else { > + PagingMode =3D PagingPae; > + } I'm wondering whenever CpuPageTableLib should get a function for this? I suspect there a multiple places in edk2 which will need this functionality ... 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 (#118880): https://edk2.groups.io/g/devel/message/118880 Mute This Topic: https://groups.io/mt/106018135/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- --_000_MN6PR11MB8244F24D892B0EA45D7BA5328CE32MN6PR11MB8244namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Gerd,
I agree that the logic might be duplicated in multi places.

But even CPU supports 1G paging, caller can decide whether to use 1G paging= or 2M paging, or 4K paging.
Using a single API to encapsulate the entire logic may not seem flexible.
Maybe, a lib API to detect 1G paging capability can be added to CpuLib.

Thanks,
Ray

From: Gerd Hoffmann <kra= xel@redhat.com>
Sent: Monday, May 13, 2024 19:07
To: Tan, Dun <dun.tan@intel.com>
Cc: devel@edk2.groups.io <devel@edk2.groups.io>; Ni, Ray <r= ay.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>; Kumar, Rahul R= <rahul.r.kumar@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com> Subject: Re: [PATCH 10/18] UefiCpuPkg:Relocate AP to new safe buffer= in PeiMpLib
 
  Hi,

> +  if (sizeof (UINTN) =3D=3D sizeof (UINT64)) {
> +    //
> +    // Check Page5Level Support or not.
> +    //
> +    Cr4.UintN       = ;  =3D AsmReadCr4 ();
> +    Page5LevelSupport =3D (Cr4.Bits.LA57 ? TRUE : FALS= E);
> +
> +    //
> +    // Check Page1G Support or not.
> +    //
> +    Page1GSupport =3D FALSE;
> +    AsmCpuid (CPUID_EXTENDED_FUNCTION, &RegEax, NU= LL, NULL, NULL);
> +    if (RegEax >=3D CPUID_EXTENDED_CPU_SIG) {
> +      AsmCpuid (CPUID_EXTENDED_CPU_SIG, NULL= , NULL, NULL, &RegEdx.Uint32);
> +      if (RegEdx.Bits.Page1GB !=3D 0) {
> +        Page1GSupport =3D TRUE; > +      }
> +    }
> +
> +    //
> +    // Decide Paging Mode according Page5LevelSupport = & Page1GSupport.
> +    //
> +    if (Page5LevelSupport) {
> +      PagingMode =3D Page1GSupport ? Paging5= Level1GB : Paging5Level;
> +    } else {
> +      PagingMode =3D Page1GSupport ? Paging4= Level1GB : Paging4Level;
> +    }
> +  } else {
> +    PagingMode =3D PagingPae;
> +  }

I'm wondering whenever CpuPageTableLib should get a function for this?
I suspect there a multiple places in edk2 which will need this
functionality ...

take care,
  Gerd

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#118880) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MN6PR11MB8244F24D892B0EA45D7BA5328CE32MN6PR11MB8244namp_--