UefiCpuPkg/Library/MpInitLib/AmdSev.c | 9 ++++++++- UefiCpuPkg/Library/MpInitLib/MpLib.c | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-)
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/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
On Mon, Nov 06, 2023 at 04:45:29PM -0600, Tom Lendacky wrote: > 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. Series: Acked-by: Gerd Hoffmann <kraxel@redhat.com> -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110831): https://edk2.groups.io/g/devel/message/110831 Mute This Topic: https://groups.io/mt/102432041/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
On 11/7/23 03:55, Gerd Hoffmann wrote: > On Mon, Nov 06, 2023 at 04:45:29PM -0600, Tom Lendacky wrote: >> 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. > > Series: > Acked-by: Gerd Hoffmann <kraxel@redhat.com> > Eric/Ray/Rahul, Have you had a chance to review this series? These bug fixes would be good to get in for the next/latest release... Thanks, Tom -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111416): https://edk2.groups.io/g/devel/message/111416 Mute This Topic: https://groups.io/mt/102432041/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
On 11/17/23 15:43, Tom Lendacky wrote: > > > On 11/7/23 03:55, Gerd Hoffmann wrote: >> On Mon, Nov 06, 2023 at 04:45:29PM -0600, Tom Lendacky wrote: >>> 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. >> >> Series: >> Acked-by: Gerd Hoffmann <kraxel@redhat.com> >> > > Eric/Ray/Rahul, > > Have you had a chance to review this series? These bug fixes would be good > to get in for the next/latest release... Eric/Ray/Rahul, Any feedback? If not, can you Ack them so they can be merged... they already missed the edk2-stable202311 tag. Thanks, Tom > > Thanks, > Tom -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111756): https://edk2.groups.io/g/devel/message/111756 Mute This Topic: https://groups.io/mt/102432041/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2024 Red Hat, Inc.