Hi Gerd, Thanks for your comments. I agree with your opinion. Will change the code and related comments in V2 patch.
Thanks, Dun -----Original Message----- From: Gerd Hoffmann <kra...@redhat.com> Sent: Wednesday, January 10, 2024 6:55 PM To: Tan, Dun <dun....@intel.com> Cc: devel@edk2.groups.io; Ni, Ray <ray...@intel.com>; Laszlo Ersek <ler...@redhat.com>; Kumar, Rahul R <rahul.r.ku...@intel.com> 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 > bits returned by > CalculateMaximumSupportAddress() to 48 if 5-Level Paging is disabled. > When 5-Level Paging is disabled and the PhysicalAddressBits retrived > from CPU HOB or CpuId is bigger than 48, only [0, 2^48 -1] range in > 52-bit physical address is mapped in page table. I think this is wrong. Virtual addresses are sign-extended, i.e. the virtual 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 -=-=-=-=-=-=-=-=-=-=-=- 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/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-