mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
OvmfPkg/CcExitLib: Use the proper register when filtering MSRs
The MsrExit() routine uses an incorrect register to check for the CAA MSR.
Instead of checking RCX, the input register for RDMSR/WRMSR that holds the
MSR value, it is checking RAX, which results in failure to detect the CAA
MSR request. The check should only be checking the lower 32-bits of the
register (ECX), too.
Change the check in MsrExit() to check the MSR value contained in ECX.
Fixes: 47001ab989 ("Ovmfpkg/CcExitLib: Provide SVSM discovery support")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
This commit is contained in:
parent
956ef6cd8b
commit
856bdc8eec
1 changed files with 3 additions and 1 deletions
|
|
@ -701,6 +701,7 @@ MsrExit (
|
|||
MSR_SVSM_CAA_REGISTER Msr;
|
||||
UINT64 ExitInfo1;
|
||||
UINT64 Status;
|
||||
UINT32 EcxIn;
|
||||
|
||||
ExitInfo1 = 0;
|
||||
|
||||
|
|
@ -708,7 +709,8 @@ MsrExit (
|
|||
// The SVSM CAA MSR is a software implemented MSR and not supported
|
||||
// by the hardware, handle it directly.
|
||||
//
|
||||
if (Regs->Rax == MSR_SVSM_CAA) {
|
||||
EcxIn = (UINT32)(UINTN)Regs->Rcx;
|
||||
if (EcxIn == MSR_SVSM_CAA) {
|
||||
// Writes to the SVSM CAA MSR are ignored
|
||||
if (*(InstructionData->OpCodes + 1) == 0x30) {
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue