Hi Ray,

The Address could be not 4k align, "& 
IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS_MASK" is to clear the low 12 bit to 
avoid impact the attribute.
I think it is needed

Thanks
Zhiguang

> -----Original Message-----
> From: Ni, Ray <ray...@intel.com>
> Sent: Wednesday, March 15, 2023 2:43 PM
> To: Tan, Dun <dun....@intel.com>; devel@edk2.groups.io
> Cc: Liu, Zhiguang <zhiguang....@intel.com>; Dong, Eric
> <eric.d...@intel.com>; Kumar, Rahul R <rahul.r.ku...@intel.com>
> Subject: RE: [Patch V2 14/14] UefiCpuPkg: Modify UnitTest code since tested
> API is changed
> 
> > @@ -413,8 +422,9 @@ CompareEntrysforOnePoint (
> >    //
> >    for (Index = 0; Index < MapCount; Index++) {
> >      if ((Address >= Map[Index].LinearAddress) && (Address <
> > (Map[Index].LinearAddress + Map[Index].Length))) {
> > -      AttributeInMap.Uint64                    = 
> > (Map[Index].Attribute.Uint64 &
> > mSupportedBit.Uint64);
> > -      AttributeInMap.Bits.PageTableBaseAddress = ((Address -
> > Map[Index].LinearAddress) >> 12) +
> > Map[Index].Attribute.Bits.PageTableBaseAddress;
> > +      AttributeInMap.Uint64  = (Map[Index].Attribute.Uint64 &
> > mSupportedBit.Uint64);
> > +      AttributeInMap.Uint64 &=
> > (~IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS_MASK);
> > +      AttributeInMap.Uint64 |= (Address - Map[Index].LinearAddress +
> > IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS
> > (&Map[Index].Attribute)) &
> > IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS_MASK;
> 
> 1. "& IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS_MASK" is not
> needed.


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


Reply via email to