public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH 0/2] SEV-SNP guest support fixes
@ 2023-11-06 22:45 Lendacky, Thomas via groups.io
  2023-11-06 22:45 ` [edk2-devel] [PATCH 1/2] UefiCpuPkg/MpInitLib: Use AsmCpuidEx() for CPUID_EXTENDED_TOPOLOGY leaf Lendacky, Thomas via groups.io
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Lendacky, Thomas via groups.io @ 2023-11-06 22:45 UTC (permalink / raw)
  To: devel
  Cc: Eric Dong, Ray Ni, Rahul Kumar, Gerd Hoffmann, Ard Biesheuvel,
	Michael Roth

This patch series provides fixes around AP startup and sorting:

- The CPUID_EXTENDED_TOPOLOGY CPUID leaf takes a sub-leaf as input. The
  current SEV-SNP support is attempting to retrieve the this leaf with
  sub-leaf 0, but is calling AsmCpuid(), which does not clear ECX before
  invoking the CPUID instruction. Therefore, because of the calling
  convention, the leaf value becomes the sub-leaf value and ends up
  returning incorrect information. Change the call from AsmCpuid() to
  AsmCpuidEx().

- When sorting the CPUs by APIC ID, the VMSA associated with the vCPU
  should follow the APIC ID. Update the sorting code to swap the VMSA
  pointer during the sort.

---

These patches are based on commit:
da219919538b ("BaseTools: GenFw: auto-set nxcompat flag")

Tom Lendacky (2):
  UefiCpuPkg/MpInitLib: Use AsmCpuidEx() for CPUID_EXTENDED_TOPOLOGY
    leaf
  UefiCpuPkg/MpInitLib: Copy SEV-ES save area pointer during APIC ID
    sorting

 UefiCpuPkg/Library/MpInitLib/AmdSev.c | 9 ++++++++-
 UefiCpuPkg/Library/MpInitLib/MpLib.c  | 8 +++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

-- 
2.42.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110766): https://edk2.groups.io/g/devel/message/110766
Mute This Topic: https://groups.io/mt/102432041/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-01-21  3:00 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-06 22:45 [edk2-devel] [PATCH 0/2] SEV-SNP guest support fixes Lendacky, Thomas via groups.io
2023-11-06 22:45 ` [edk2-devel] [PATCH 1/2] UefiCpuPkg/MpInitLib: Use AsmCpuidEx() for CPUID_EXTENDED_TOPOLOGY leaf Lendacky, Thomas via groups.io
2023-11-28 10:31   ` Ni, Ray
2023-11-06 22:45 ` [edk2-devel] [PATCH 2/2] UefiCpuPkg/MpInitLib: Copy SEV-ES save area pointer during APIC ID sorting Lendacky, Thomas via groups.io
2023-11-28 10:33   ` Ni, Ray
     [not found] ` <17952A20A9E21541.12603@groups.io>
2023-11-06 23:15   ` [edk2-devel] [PATCH 1/2] UefiCpuPkg/MpInitLib: Use AsmCpuidEx() for CPUID_EXTENDED_TOPOLOGY leaf Lendacky, Thomas via groups.io
2023-11-07  1:19     ` Michael D Kinney
2023-11-28 14:35     ` Lendacky, Thomas via groups.io
     [not found]     ` <179BD02AA4207037.22216@groups.io>
2024-01-17 21:26       ` Lendacky, Thomas via groups.io
2024-01-18 23:10         ` Michael D Kinney
2024-01-19 10:00           ` Ni, Ray
2024-01-19 23:16             ` Michael D Kinney
2024-01-19 23:48               ` Ni, Ray
2024-01-20  1:49                 ` Michael D Kinney
2024-01-20  6:48                   ` Ni, Ray
2024-01-20 16:03                     ` Lendacky, Thomas via groups.io
2024-01-21  3:00                       ` Ni, Ray
2023-11-07  9:55 ` [edk2-devel] [PATCH 0/2] SEV-SNP guest support fixes Gerd Hoffmann
2023-11-17 21:43   ` Lendacky, Thomas via groups.io
2023-11-27 19:00     ` Lendacky, Thomas via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox