Non-leaf entry doesn't have PAT bit.
So "& (~IA32_PE_BASE_ADDRESS_MASK_40)" is to make sure PAT bit in the original 
big-leaf entry
is not assigned to the corresponding bit (bit 12) in non-leaf entry.

Can you please add comments to explain why?

With that, Reviewed-by: Ray Ni <ray...@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ni, Ray
> Sent: Thursday, March 23, 2023 8:35 PM
> To: Tan, Dun <dun....@intel.com>; devel@edk2.groups.io
> Cc: Dong, Eric <eric.d...@intel.com>; Kumar, Rahul R
> <rahul.r.ku...@intel.com>; Gerd Hoffmann <kra...@redhat.com>
> Subject: Re: [edk2-devel] [Patch V4 06/21] UefiCpuPkg/CpuPageTableLib: Fix
> issue when splitting leaf entry
> 
> > +      ParentPagingEntry->Uint64 = ((UINTN)(VOID *)PagingEntry) |
> > (ParentPagingEntry->Uint64 & (~IA32_PE_BASE_ADDRESS_MASK_40));
> 
> In this branch, ParentPagingEntry is a leaf entry covering 2M or 1G physical
> address range.
> Then, why not use IA32_PE_BASE_ADDRESS_MASK_39? Because for the two
> types leaf entry, address
> only occupies 39 bits, not 40bits.
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101717): https://edk2.groups.io/g/devel/message/101717
Mute This Topic: https://groups.io/mt/97796379/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to