Skip to content

Commit

Permalink
OvmfPkg/ResetVector: Fix SNP CPUID table processing results for ECX/EDX
Browse files Browse the repository at this point in the history
The current support within the boot SNP CPUID table processing mistakenly
swaps the ECX and EDX results. It does not have an effect at this time
because current CPUID results checking does not check ECX or EDX. However,
any future CPUID checks that need to check ECX or EDX may have erroneous
behavior.

Fix the assembler code to save ECX and EDX to the proper locations.

Fixes: 34819f2 ("OvmfPkg/ResetVector: use SEV-SNP-validated CPUID values")
Signed-off-by: Tom Lendacky <[email protected]>
Reviewed-by: Michael Roth <[email protected]>
  • Loading branch information
tlendacky authored and mergify[bot] committed Feb 3, 2024
1 parent a1b98c8 commit cd6f215
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OvmfPkg/ResetVector/Ia32/AmdSev.asm
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,9 @@ SnpCpuidEntryFound:
mov [esp + VC_CPUID_RESULT_EAX], eax
mov eax, [ecx + SNP_CPUID_ENTRY_EBX]
mov [esp + VC_CPUID_RESULT_EBX], eax
mov eax, [ecx + SNP_CPUID_ENTRY_EDX]
mov [esp + VC_CPUID_RESULT_ECX], eax
mov eax, [ecx + SNP_CPUID_ENTRY_ECX]
mov [esp + VC_CPUID_RESULT_ECX], eax
mov eax, [ecx + SNP_CPUID_ENTRY_EDX]
mov [esp + VC_CPUID_RESULT_EDX], eax
jmp VmmDoneSnpCpuid

Expand Down

0 comments on commit cd6f215

Please sign in to comment.