From 12d3d60f51550a7166f8f3e758866b53b9a88e73 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 22 Mar 2023 00:02:42 -0700 Subject: 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 Reviewed-by: Michael D Kinney Reviewed-by: Jiewen Yao Acked-by: Tom Lendacky --- OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OvmfPkg/Library') diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c index f35bba5deb..7a8878b1a9 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.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; -- cgit v1.2.3