From nobody Sat Feb 7 07:11:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+100665+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100665+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1677826290; cv=none; d=zohomail.com; s=zohoarc; b=DbFx2tcERq1wWmWyQOGXhMa3N2AvgTRR2WUU5jWV2FDs101cgiOVoEG36995MZz0vKjZd7gFAEg5oj7/sctAopkOovyc3+hDQKmOI7gP53tg9uuWjUgni/xg3Rt74+TF9HAHUDqPFrqU/68nbLm4F/kq+lT688nCxqzSFnqsiKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677826290; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=lMrykFpH7m09J3QU1I1Io4s93OWjHS7tqiU8G7jMmsU=; b=Ar2Sa8z9NHdBzhnJFvgSsrIrM+IMh3roB8K+Bh2dGFaGoVSapteTdXJo/J5oqejIJd4CQtW5hB+5enkXGIGuSxS53eQSgMmhsViYxrebkD+2yT5s9O1rFQBEEdlUBTMTNKP5i/SJMy8wdXyWM6AnnVdKtsLe1zJzYcYrAc8RQ/0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100665+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1677826290002520.1399567921763; Thu, 2 Mar 2023 22:51:30 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8qMgYY1788612xvNKfLD3vex; Thu, 02 Mar 2023 22:51:29 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.17712.1677826288365160765 for ; Thu, 02 Mar 2023 22:51:28 -0800 X-Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-157-f2yIYlcmMfOjOeyPBoloKw-1; Fri, 03 Mar 2023 01:51:21 -0500 X-MC-Unique: f2yIYlcmMfOjOeyPBoloKw-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 860233806108; Fri, 3 Mar 2023 06:51:20 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 37D662166B26; Fri, 3 Mar 2023 06:51:20 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 07EAD18009B1; Fri, 3 Mar 2023 07:51:16 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Gerd Hoffmann , Jian J Wang , Jiewen Yao , =?UTF-8?q?Marvin=20H=C3=A4user?= , James Bottomley , Michael Roth , Hao A Wu , Michael D Kinney , Oliver Steffen , Min Xu , Liming Gao , Ray Ni , Tom Lendacky , Erdem Aktas , Zhiguang Liu , Pawel Polawski , Jordan Justen Subject: [edk2-devel] [PATCH 2/5] OvmfPkg: Rename IS_ALIGNED macros to avoid name collisions Date: Fri, 3 Mar 2023 07:51:12 +0100 Message-Id: <20230303065115.406020-3-kraxel@redhat.com> In-Reply-To: <20230303065115.406020-1-kraxel@redhat.com> References: <20230303065115.406020-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kraxel@redhat.com X-Gm-Message-State: ZcHJwkoCBoC9PcJYSm7qzx2xx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1677826289; bh=w8gvAGW4hRaGCd5K/wMiR+6wCQie6WueQcXZ400kqRU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=uuw5qtqDykExFQjEtTw9mNC5SwkOqjX2CKUcfyZDQ9xFftUOW+hgLOEkm4ePSCN36E/ XreXq5D67k87QwSDPmHdK/0LzlN/h5XsqZjHo1WDbB/DqmV7ew36ADKRlWGHG1vj3SNwa YTPJeVsgFOTaED34FcB0UOhULKyd1Lr1s5I= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1677826290707100002 Content-Type: text/plain; charset="utf-8"; x-default="true" This patch is a preparation for the patches that follow. The subsequent patches will introduce and integrate new alignment-related macros, which collide with existing definitions in OvmfPkg. Temporarily rename them to avoid build failure, till they can be substituted with the new, shared definitions. Signed-off-by: Gerd Hoffmann Reviewed-by: Jiewen Yao Reviewed-by: Michael D Kinney --- OvmfPkg/AmdSevDxe/AmdSevDxe.c | 6 +++--- .../BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c b/OvmfPkg/AmdSevDxe/AmdSevDxe.c index a726498e2792..71a1eaaf0a1d 100644 --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c @@ -44,7 +44,7 @@ STATIC BOOLEAN mAcceptAllMemoryAtEBS =3D TRUE; =20 STATIC EFI_EVENT mAcceptAllMemoryEvent =3D NULL; =20 -#define IS_ALIGNED(x, y) ((((x) & ((y) - 1)) =3D=3D 0)) +#define IS_ALIGNED_(x, y) ((((x) & ((y) - 1)) =3D=3D 0)) =20 STATIC EFI_STATUS @@ -60,8 +60,8 @@ AmdSevMemoryAccept ( // multiple of SIZE_4KB. Use an assert instead of returning an erros sin= ce // 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 !=3D 0); =20 MemEncryptSevSnpPreValidateSystemRam ( diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInt= ernal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeIntern= al.c index 4d684964d838..f35bba5deb46 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c @@ -20,7 +20,7 @@ =20 #include "SnpPageStateChange.h" =20 -#define IS_ALIGNED(x, y) ((((x) & (y - 1)) =3D=3D 0)) +#define IS_ALIGNED_(x, y) ((((x) & (y - 1)) =3D=3D 0)) #define PAGES_PER_LARGE_ENTRY 512 =20 STATIC @@ -150,7 +150,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) >=3D SIZE_2MB)) { RmpPageSize =3D PvalidatePageSize2MB; --=20 2.39.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#100665): https://edk2.groups.io/g/devel/message/100665 Mute This Topic: https://groups.io/mt/97357269/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-