BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4654
Similar to the Page State Change optimization added previously, also take into account the possiblity of using the SVSM for PVALIDATE instructions. Conditionally adjust the maximum number of entries based on how many entries the SVSM calling area can support. Signed-off-by: Tom Lendacky <thomas.lenda...@amd.com> --- OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c index 4e1225d12797..7060cd61b21c 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c @@ -18,6 +18,7 @@ #include <Register/Amd/Ghcb.h> #include <Register/Amd/Msr.h> +#include <Register/Amd/Svsm.h> #include "SnpPageStateChange.h" @@ -78,6 +79,7 @@ BuildPageStateBuffer ( UINTN Index; UINTN IndexMax; UINTN PscIndexMax; + UINTN SvsmIndexMax; // Clear the page state structure SetMem (Info, InfoSize, 0); @@ -96,6 +98,11 @@ BuildPageStateBuffer ( IndexMax = MIN (IndexMax, PscIndexMax); } + SvsmIndexMax = (IndexMax / SVSM_PVALIDATE_MAX_ENTRY) * SVSM_PVALIDATE_MAX_ENTRY; + if (SvsmIndexMax > 0) { + IndexMax = MIN (IndexMax, SvsmIndexMax); + } + // // Populate the page state entry structure // -- 2.42.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115854): https://edk2.groups.io/g/devel/message/115854 Mute This Topic: https://groups.io/mt/104512975/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-