diff options
author | Tom Lendacky <thomas.lendacky@amd.com> | 2024-02-02 13:18:37 -0600 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-02-03 17:42:54 +0000 |
commit | cd6f2152237713d12723a55aa258c7ae91577dff (patch) | |
tree | 2f9ed4122dbef1bb8ac127b0140a7a73b59b615f /OvmfPkg | |
parent | a1b98c8f845c165572937149a46e12ca36960617 (diff) | |
download | edk2-cd6f2152237713d12723a55aa258c7ae91577dff.tar.gz edk2-cd6f2152237713d12723a55aa258c7ae91577dff.tar.bz2 edk2-cd6f2152237713d12723a55aa258c7ae91577dff.zip |
OvmfPkg/ResetVector: Fix SNP CPUID table processing results for ECX/EDX
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: 34819f2caccb ("OvmfPkg/ResetVector: use SEV-SNP-validated CPUID values")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Michael Roth <michael.roth@amd.com>
Diffstat (limited to 'OvmfPkg')
-rw-r--r-- | OvmfPkg/ResetVector/Ia32/AmdSev.asm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/OvmfPkg/ResetVector/Ia32/AmdSev.asm b/OvmfPkg/ResetVector/Ia32/AmdSev.asm index 3abc8300c4..043c88a7ab 100644 --- a/OvmfPkg/ResetVector/Ia32/AmdSev.asm +++ b/OvmfPkg/ResetVector/Ia32/AmdSev.asm @@ -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
|