mirror of https://github.com/acidanthera/audk.git
OvmfPkg/BaseMemEncryptLib: Fix error check from AsmRmpAdjust()
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4654 The AsmRmpAdjust() function returns a UINT32, however in SevSnpIsVmpl0() the return value is checked with EFI_ERROR() when it should just be compared to 0. Fix the error check. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Michael Roth <michael.roth@amd.com> Cc: Min Xu <min.m.xu@intel.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
This commit is contained in:
parent
61185f1d50
commit
c212fec9cf
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
SEV-SNP Page Validation functions.
|
SEV-SNP Page Validation functions.
|
||||||
|
|
||||||
Copyright (c) 2021 AMD Incorporated. All rights reserved.<BR>
|
Copyright (c) 2021 - 2024, AMD Incorporated. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ SevSnpIsVmpl0 (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT64 Rdx;
|
UINT64 Rdx;
|
||||||
EFI_STATUS Status;
|
UINT32 Status;
|
||||||
|
|
||||||
//
|
//
|
||||||
// There is no straightforward way to query the current VMPL level.
|
// There is no straightforward way to query the current VMPL level.
|
||||||
|
@ -44,7 +44,7 @@ SevSnpIsVmpl0 (
|
||||||
Rdx = 1;
|
Rdx = 1;
|
||||||
|
|
||||||
Status = AsmRmpAdjust ((UINT64)gVmpl0Data, 0, Rdx);
|
Status = AsmRmpAdjust ((UINT64)gVmpl0Data, 0, Rdx);
|
||||||
if (EFI_ERROR (Status)) {
|
if (Status != 0) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue