From 08a6528bac384a7a8baa7e77075dea3291ac36fc Mon Sep 17 00:00:00 2001 From: duntan Date: Mon, 8 Jan 2024 13:08:04 +0800 Subject: UefiCpuPkg: Check lower 24 bits of ProcessorNumber Check lower 24 bits of ProcessorNumber instead of the value of ProcessorNumber in the API MpInitLibGetProcessorInfo() of MpInitLibUp instance. Lower 24 bits of ProcessorNumber contains the actual processor number. The BIT24 of input ProcessorNumber might be set to indicate if the EXTENDED_PROCESSOR_INFORMATION will be retrived. Signed-off-by: Dun Tan Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Min Xu Message-Id: <20240108050804.1718-3-dun.tan@intel.com> Reviewed-by: Laszlo Ersek Reviewed-by: Ray Ni --- UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'UefiCpuPkg/Library') diff --git a/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c b/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c index d4f8611af8..35590fb4e7 100644 --- a/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c +++ b/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c @@ -107,7 +107,10 @@ MpInitLibGetProcessorInfo ( return EFI_INVALID_PARAMETER; } - if (ProcessorNumber != 0) { + // + // Lower 24 bits contains the actual processor number. + // + if ((ProcessorNumber & (BIT24 - 1)) != 0) { return EFI_NOT_FOUND; } -- cgit v1.2.3