public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Ard Biesheuvel" <ardb+tianocore@kernel.org>,
	"Wang, Jian J" <jian.j.wang@intel.com>,
	"Marvin Häuser" <mhaeuser@posteo.de>,
	"James Bottomley" <jejb@linux.ibm.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Wu, Hao A" <hao.a.wu@intel.com>,
	"Oliver Steffen" <osteffen@redhat.com>,
	"Xu, Min M" <min.m.xu@intel.com>,
	"Gao, Liming" <gaoliming@byosoft.com.cn>,
	"Ni, Ray" <ray.ni@intel.com>,
	"Tom Lendacky" <thomas.lendacky@amd.com>,
	"Aktas, Erdem" <erdemaktas@google.com>,
	"Liu, Zhiguang" <zhiguang.liu@intel.com>,
	"Pawel Polawski" <ppolawsk@redhat.com>,
	"Justen, Jordan L" <jordan.l.justen@intel.com>
Subject: Re: [PATCH 5/5] OvmfPkg: Consume new alignment-related macros
Date: Tue, 21 Mar 2023 23:30:31 +0000	[thread overview]
Message-ID: <MW4PR11MB5872C1AD012A907E96213CAC8C819@MW4PR11MB5872.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CO1PR11MB49293B6A0149EF75BDE2AD68D2819@CO1PR11MB4929.namprd11.prod.outlook.com>

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

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Wednesday, March 22, 2023 5:41 AM
> To: Gerd Hoffmann <kraxel@redhat.com>; devel@edk2.groups.io
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Wang, Jian J
> <jian.j.wang@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Marvin
> Häuser <mhaeuser@posteo.de>; James Bottomley <jejb@linux.ibm.com>;
> Michael Roth <michael.roth@amd.com>; Wu, Hao A <hao.a.wu@intel.com>;
> Oliver Steffen <osteffen@redhat.com>; Xu, Min M <min.m.xu@intel.com>;
> Gao, Liming <gaoliming@byosoft.com.cn>; Ni, Ray <ray.ni@intel.com>; Tom
> Lendacky <thomas.lendacky@amd.com>; Aktas, Erdem
> <erdemaktas@google.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Pawel
> Polawski <ppolawsk@redhat.com>; Justen, Jordan L
> <jordan.l.justen@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Subject: RE: [PATCH 5/5] OvmfPkg: Consume new alignment-related macros
> 
> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
> 
> > -----Original Message-----
> > From: Gerd Hoffmann <kraxel@redhat.com>
> > Sent: Thursday, March 2, 2023 10:51 PM
> > To: devel@edk2.groups.io
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Gerd Hoffmann
> <kraxel@redhat.com>; Wang, Jian J <jian.j.wang@intel.com>; Yao,
> > Jiewen <jiewen.yao@intel.com>; Marvin Häuser <mhaeuser@posteo.de>;
> James Bottomley <jejb@linux.ibm.com>; Michael Roth
> > <michael.roth@amd.com>; Wu, Hao A <hao.a.wu@intel.com>; Kinney,
> Michael D <michael.d.kinney@intel.com>; Oliver Steffen
> > <osteffen@redhat.com>; Xu, Min M <min.m.xu@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Ni, Ray <ray.ni@intel.com>; Tom
> > Lendacky <thomas.lendacky@amd.com>; Aktas, Erdem
> <erdemaktas@google.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Pawel
> Polawski
> > <ppolawsk@redhat.com>; Justen, Jordan L <jordan.l.justen@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 <kraxel@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


  reply	other threads:[~2023-03-21 23:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03  6:51 [PATCH 0/5] MdePkg/Base.h: Introduce various alignment-related macros Gerd Hoffmann
2023-03-03  6:51 ` [PATCH 1/5] MdeModulePkg: Rename IS_ALIGNED macros to avoid name collisions Gerd Hoffmann
2023-03-21  2:01   ` Wu, Hao A
2023-03-21 21:40   ` [edk2-devel] " Michael D Kinney
2023-03-03  6:51 ` [PATCH 2/5] OvmfPkg: " Gerd Hoffmann
2023-03-21 21:40   ` [edk2-devel] " Michael D Kinney
2023-03-21 23:30     ` Yao, Jiewen
2023-03-03  6:51 ` [PATCH 3/5] MdePkg/Base.h: Introduce various alignment-related macros Gerd Hoffmann
2023-03-21 21:37   ` Michael D Kinney
2023-03-21 21:59     ` Marvin Häuser
2023-03-21 22:28       ` Michael D Kinney
2023-03-21 22:43         ` Marvin Häuser
2023-03-21 22:50           ` Michael D Kinney
2023-03-22  0:09             ` Ni, Ray
2023-03-03  6:51 ` [PATCH 4/5] MdeModulePkg: Consume new " Gerd Hoffmann
2023-03-21  2:01   ` Wu, Hao A
2023-03-21 21:39   ` Michael D Kinney
2023-03-03  6:51 ` [PATCH 5/5] OvmfPkg: " Gerd Hoffmann
2023-03-21 21:40   ` Michael D Kinney
2023-03-21 23:30     ` Yao, Jiewen [this message]
2023-03-03 15:12 ` [PATCH 0/5] MdePkg/Base.h: Introduce various " Lendacky, Thomas
2023-03-20 10:04 ` Gerd Hoffmann

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=MW4PR11MB5872C1AD012A907E96213CAC8C819@MW4PR11MB5872.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