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 <dun.tan@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Min Xu <min.m.xu@intel.com>
---
UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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;
}
--
2.31.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113356): https://edk2.groups.io/g/devel/message/113356
Mute This Topic: https://groups.io/mt/103592279/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Reviewed-by: Ray Ni <ray.ni@intel.com>
Thanks,
Ray
> -----Original Message-----
> From: Tan, Dun <dun.tan@intel.com>
> Sent: Monday, January 8, 2024 1:08 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>; Kumar,
> Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com>;
> Xu, Min M <min.m.xu@intel.com>
> Subject: [Patch V3 2/2] 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 <dun.tan@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Min Xu <min.m.xu@intel.com>
> ---
> UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> 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;
> }
>
> --
> 2.31.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113434): https://edk2.groups.io/g/devel/message/113434
Mute This Topic: https://groups.io/mt/103592279/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2025 Red Hat, Inc.