summaryrefslogtreecommitdiff
path: root/0026-UefiCpuPkg-MpInitLib-fix-apic-mode-for-cpu-hotplug.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-01 14:44:22 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-01 14:44:22 +0000
commit641da27ad73e8f09c40e8b093dcf824c0ee4d02a (patch)
tree5c8e4f5928100c6dd587e063b7b1de59d2236845 /0026-UefiCpuPkg-MpInitLib-fix-apic-mode-for-cpu-hotplug.patch
parentbac9f1a06357b69667a40f0cb2ab674767947337 (diff)
automatic import of edk2openeuler24.03_LTSopeneuler23.09
Diffstat (limited to '0026-UefiCpuPkg-MpInitLib-fix-apic-mode-for-cpu-hotplug.patch')
-rw-r--r--0026-UefiCpuPkg-MpInitLib-fix-apic-mode-for-cpu-hotplug.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/0026-UefiCpuPkg-MpInitLib-fix-apic-mode-for-cpu-hotplug.patch b/0026-UefiCpuPkg-MpInitLib-fix-apic-mode-for-cpu-hotplug.patch
new file mode 100644
index 0000000..97dd035
--- /dev/null
+++ b/0026-UefiCpuPkg-MpInitLib-fix-apic-mode-for-cpu-hotplug.patch
@@ -0,0 +1,49 @@
+From 3d02fb6da82331176952e480160223136679ce74 Mon Sep 17 00:00:00 2001
+From: Gerd Hoffmann <kraxel@redhat.com>
+Date: Tue, 28 Feb 2023 15:47:00 +0100
+Subject: [PATCH] UefiCpuPkg/MpInitLib: fix apic mode for cpu hotplug
+
+RH-Author: Gerd Hoffmann <kraxel@redhat.com>
+RH-MergeRequest: 42: UefiCpuPkg/MpInitLib: fix apic mode for cpu hotplug
+RH-Bugzilla: 2124143
+RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
+RH-Commit: [1/1] 5168501c31541a57aaeb3b3bd7c3602205eb7cdf (kraxel/centos-edk2)
+
+In case the number of CPUs can in increase beyond 255
+due to CPU hotplug choose x2apic mode.
+
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+
+patch_name: edk2-UefiCpuPkg-MpInitLib-fix-apic-mode-for-cpu-hotplug.patch
+present_in_specfile: true
+location_in_specfile: 38
+---
+ UefiCpuPkg/Library/MpInitLib/MpLib.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
+index d724456502..c478878bb0 100644
+--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
++++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
+@@ -534,7 +534,9 @@ CollectProcessorCount (
+ //
+ // Enable x2APIC mode if
+ // 1. Number of CPU is greater than 255; or
+- // 2. There are any logical processors reporting an Initial APIC ID of 255 or greater.
++ // 2. The platform exposed the exact *boot* CPU count to us in advance, and
++ // more than 255 logical processors are possible later, with hotplug; or
++ // 3. There are any logical processors reporting an Initial APIC ID of 255 or greater.
+ //
+ X2Apic = FALSE;
+ if (CpuMpData->CpuCount > 255) {
+@@ -542,6 +544,10 @@ CollectProcessorCount (
+ // If there are more than 255 processor found, force to enable X2APIC
+ //
+ X2Apic = TRUE;
++ } else if ((PcdGet32 (PcdCpuBootLogicalProcessorNumber) > 0) &&
++ (PcdGet32 (PcdCpuMaxLogicalProcessorNumber) > 255))
++ {
++ X2Apic = TRUE;
+ } else {
+ CpuInfoInHob = (CPU_INFO_IN_HOB *)(UINTN)CpuMpData->CpuInfoInHob;
+ for (Index = 0; Index < CpuMpData->CpuCount; Index++) {