]> www.infradead.org Git - users/dwmw2/linux.git/commit
arch/x86: Provide the CPU number in the wakeup AP callback
authorRoman Kisel <romank@linux.microsoft.com>
Wed, 7 May 2025 18:22:26 +0000 (11:22 -0700)
committerWei Liu <wei.liu@kernel.org>
Fri, 23 May 2025 16:30:56 +0000 (16:30 +0000)
commit43cb39ad260a168abf6da3a48f394afff92d436b
tree0f6d3729bc472fc2958f7bd6d9d856f1a4990681
parent86c48271e0d60c82665e9fd61277002391efcef7
arch/x86: Provide the CPU number in the wakeup AP callback

When starting APs, confidential guests and paravisor guests
need to know the CPU number, and the pattern of using the linear
search has emerged in several places. With N processors that leads
to the O(N^2) time complexity.

Provide the CPU number in the AP wake up callback so that one can
get the CPU number in constant time.

Suggested-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20250507182227.7421-3-romank@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20250507182227.7421-3-romank@linux.microsoft.com>
arch/x86/coco/sev/core.c
arch/x86/hyperv/hv_vtl.c
arch/x86/hyperv/ivm.c
arch/x86/include/asm/apic.h
arch/x86/include/asm/mshyperv.h
arch/x86/kernel/acpi/madt_wakeup.c
arch/x86/kernel/apic/apic_noop.c
arch/x86/kernel/apic/apic_numachip.c
arch/x86/kernel/apic/x2apic_uv_x.c
arch/x86/kernel/smpboot.c