Reviewed-by: Jiewen Yao <jiewen....@intel.com>

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kin...@intel.com>
> Sent: Wednesday, March 22, 2023 5:41 AM
> To: Gerd Hoffmann <kra...@redhat.com>; devel@edk2.groups.io
> Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>; Wang, Jian J
> <jian.j.w...@intel.com>; Yao, Jiewen <jiewen....@intel.com>; Marvin
> Häuser <mhaeu...@posteo.de>; James Bottomley <j...@linux.ibm.com>;
> Michael Roth <michael.r...@amd.com>; Wu, Hao A <hao.a...@intel.com>;
> Oliver Steffen <ostef...@redhat.com>; Xu, Min M <min.m...@intel.com>;
> Gao, Liming <gaolim...@byosoft.com.cn>; Ni, Ray <ray...@intel.com>; Tom
> Lendacky <thomas.lenda...@amd.com>; Aktas, Erdem
> <erdemak...@google.com>; Liu, Zhiguang <zhiguang....@intel.com>; Pawel
> Polawski <ppola...@redhat.com>; Justen, Jordan L
> <jordan.l.jus...@intel.com>; Kinney, Michael D
> <michael.d.kin...@intel.com>
> Subject: RE: [PATCH 5/5] OvmfPkg: Consume new alignment-related macros
> 
> Reviewed-by: Michael D Kinney <michael.d.kin...@intel.com>
> 
> > -----Original Message-----
> > From: Gerd Hoffmann <kra...@redhat.com>
> > Sent: Thursday, March 2, 2023 10:51 PM
> > To: devel@edk2.groups.io
> > Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>; Gerd Hoffmann
> <kra...@redhat.com>; Wang, Jian J <jian.j.w...@intel.com>; Yao,
> > Jiewen <jiewen....@intel.com>; Marvin Häuser <mhaeu...@posteo.de>;
> James Bottomley <j...@linux.ibm.com>; Michael Roth
> > <michael.r...@amd.com>; Wu, Hao A <hao.a...@intel.com>; Kinney,
> Michael D <michael.d.kin...@intel.com>; Oliver Steffen
> > <ostef...@redhat.com>; Xu, Min M <min.m...@intel.com>; Gao, Liming
> <gaolim...@byosoft.com.cn>; Ni, Ray <ray...@intel.com>; Tom
> > Lendacky <thomas.lenda...@amd.com>; Aktas, Erdem
> <erdemak...@google.com>; Liu, Zhiguang <zhiguang....@intel.com>; Pawel
> Polawski
> > <ppola...@redhat.com>; Justen, Jordan L <jordan.l.jus...@intel.com>
> > Subject: [PATCH 5/5] OvmfPkg: Consume new alignment-related macros
> >
> > This patch substitutes the macros that were renamed in the second
> > patch with the new, shared alignment macros.
> >
> > Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
> > ---
> >  OvmfPkg/AmdSevDxe/AmdSevDxe.c                               | 6 ++----
> >  .../BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c   | 3 +--
> >  2 files changed, 3 insertions(+), 6 deletions(-)
> >
> > diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c
> b/OvmfPkg/AmdSevDxe/AmdSevDxe.c
> > index 71a1eaaf0a1d..9b0d0e92b6f7 100644
> > --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c
> > +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c
> > @@ -44,8 +44,6 @@ STATIC BOOLEAN  mAcceptAllMemoryAtEBS = TRUE;
> >
> >  STATIC EFI_EVENT  mAcceptAllMemoryEvent = NULL;
> >
> > -#define IS_ALIGNED_(x, y)  ((((x) & ((y) - 1)) == 0))
> > -
> >  STATIC
> >  EFI_STATUS
> >  EFIAPI
> > @@ -60,8 +58,8 @@ AmdSevMemoryAccept (
> >    // multiple of SIZE_4KB. Use an assert instead of returning an erros 
> > since
> >    // this is an EDK2-internal protocol.
> >    //
> > -  ASSERT (IS_ALIGNED_ (StartAddress, SIZE_4KB));
> > -  ASSERT (IS_ALIGNED_ (Size, SIZE_4KB));
> > +  ASSERT (IS_ALIGNED (StartAddress, SIZE_4KB));
> > +  ASSERT (IS_ALIGNED (Size, SIZE_4KB));
> >    ASSERT (Size != 0);
> >
> >    MemEncryptSevSnpPreValidateSystemRam (
> > diff --git
> a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeIntern
> al.c
> >
> b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeIntern
> al.c
> > index f35bba5deb46..7a8878b1a9c2 100644
> > ---
> a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeIntern
> al.c
> > +++
> b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeIntern
> al.c
> > @@ -20,7 +20,6 @@
> >
> >  #include "SnpPageStateChange.h"
> >
> > -#define IS_ALIGNED_(x, y)  ((((x) & (y - 1)) == 0))
> >  #define PAGES_PER_LARGE_ENTRY  512
> >
> >  STATIC
> > @@ -150,7 +149,7 @@ BuildPageStateBuffer (
> >      //
> >      // Is this a 2MB aligned page? Check if we can use the Large RMP entry.
> >      //
> > -    if (UseLargeEntry && IS_ALIGNED_ (BaseAddress, SIZE_2MB) &&
> > +    if (UseLargeEntry && IS_ALIGNED (BaseAddress, SIZE_2MB) &&
> >          ((EndAddress - BaseAddress) >= SIZE_2MB))
> >      {
> >        RmpPageSize = PvalidatePageSize2MB;
> > --
> > 2.39.2



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


Reply via email to