From: "Zhiguang Liu" <zhiguang.liu@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"kraxel@redhat.com" <kraxel@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>
Cc: "Dong, Eric" <eric.dong@intel.com>, "Ni, Ray" <ray.ni@intel.com>,
"Kumar, Rahul R" <rahul.r.kumar@intel.com>,
"De, Debkumar" <debkumar.de@intel.com>,
"West, Catharine" <catharine.west@intel.com>
Subject: Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg: Support 5 level page table in ResetVector
Date: Fri, 14 Apr 2023 07:09:05 +0000 [thread overview]
Message-ID: <PH0PR11MB5048E2FCA19ABCB4E60C4BA090999@PH0PR11MB5048.namprd11.prod.outlook.com> (raw)
In-Reply-To: <2oe66me7kd474drxptj6rcjxh7bf25cnq7sunvrvtizgkfetyo@vmiqncl6r32b>
Hi Gerd
Sorry for responding late.
Using 5level paging when the below two conditions are both true:
1. CPU support 5level paging
2. Platform choose to use 5level paging. (by specifing macro USE_5_LEVEL_PAGE_TABLE)
There is an assumption that if platform choose to use 5level paging, then 5level paging should be supported by CPU. (Platform should know its CPU capability)
So condition#1 is actually depends on condition#2.
The condition#2 is decided at build time.
If Platform choose to use 4level paging at build time, we can save 4K space by not creating the 5 level page.
We can check the Cr4. LA57 to know if 4G - 12k is 4level or 5level paging when debugging after reset vector.
In a word, current way can save 4K space in flash when using 4level paging.
Please let me know if you have any other concern or consideration about this. Thanks.
Thanks
Zhiguang
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Gerd
> Hoffmann
> Sent: Monday, April 3, 2023 7:56 PM
> To: Liu, Zhiguang <zhiguang.liu@intel.com>
> Cc: devel@edk2.groups.io; Dong, Eric <eric.dong@intel.com>; Ni, Ray
> <ray.ni@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; De,
> Debkumar <debkumar.de@intel.com>; West, Catharine
> <catharine.west@intel.com>
> Subject: Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg: Support 5 level page
> table in ResetVector
>
> On Mon, Apr 03, 2023 at 05:28:14PM +0800, Zhiguang Liu wrote:
> > Use a macro USE_5_LEVEL_PAGE_TABLE to determine whether to create
> > 5 level page table. Whether creating it or not, the highest level page
> > table address is fixed.
>
> Can we create the 5level page table unconditionally?
>
> We should have the PML5 table @ fixed at 4G - 12k and the PML4 table fixed
> at 4G - 16k then. Then ideally check processor capabilities and decide at
> runtime whenever to use 4level or 5level paging.
>
> thanks,
> Gerd
>
>
>
>
>
next prev parent reply other threads:[~2023-04-14 7:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 9:28 [PATCH 2/2] UefiCpuPkg: Support 5 level page table in ResetVector Zhiguang Liu
2023-04-03 11:55 ` Gerd Hoffmann
2023-04-14 7:09 ` Zhiguang Liu [this message]
2023-04-14 10:04 ` [edk2-devel] " Gerd Hoffmann
2023-04-15 5:02 ` Ni, Ray
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=PH0PR11MB5048E2FCA19ABCB4E60C4BA090999@PH0PR11MB5048.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox