x86/apic: Use a proper define for invalid ACPI CPU ID
authorThomas Gleixner <tglx@linutronix.de>
Tue, 13 Feb 2024 21:05:21 +0000 (22:05 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 15 Feb 2024 21:07:41 +0000 (22:07 +0100)
The ACPI ID for CPUs is preset with U32_MAX which is completely non
obvious. Use a proper define for it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Link: https://lore.kernel.org/r/20240212154640.177504138@linutronix.de
arch/x86/include/asm/apic.h
arch/x86/kernel/apic/apic.c
arch/x86/xen/enlighten_hvm.c

index ba219d6c851e9ed63aeed4bfba8428166132e17b..109f9808e0bda2484f12940b5d17b22b5ffc8dae 100644 (file)
@@ -48,7 +48,10 @@ static inline void x86_32_probe_apic(void) { }
 
 extern u32 cpuid_to_apicid[];
 
+#define CPU_ACPIID_INVALID     U32_MAX
+
 #ifdef CONFIG_X86_LOCAL_APIC
+
 extern int apic_verbosity;
 extern int local_apic_timer_c2_ok;
 
index 68767a9dd3d149b9704a98a8bd0b1ba9b5f2f5b7..fa11e2585e2070f91792d6e3612655aef0a1ae15 100644 (file)
@@ -111,7 +111,7 @@ static inline bool apic_accessible(void)
  * Map cpu index to physical APIC ID
  */
 DEFINE_EARLY_PER_CPU_READ_MOSTLY(u32, x86_cpu_to_apicid, BAD_APICID);
-DEFINE_EARLY_PER_CPU_READ_MOSTLY(u32, x86_cpu_to_acpiid, U32_MAX);
+DEFINE_EARLY_PER_CPU_READ_MOSTLY(u32, x86_cpu_to_acpiid, CPU_ACPIID_INVALID);
 EXPORT_EARLY_PER_CPU_SYMBOL(x86_cpu_to_apicid);
 EXPORT_EARLY_PER_CPU_SYMBOL(x86_cpu_to_acpiid);
 
index 3f8c34707c50014d9364f0430728446e35059d8f..99a68fa71dbe403af34705d5425d886f1d6e49be 100644 (file)
@@ -168,7 +168,7 @@ static int xen_cpu_up_prepare_hvm(unsigned int cpu)
         */
        xen_uninit_lock_cpu(cpu);
 
-       if (cpu_acpi_id(cpu) != U32_MAX)
+       if (cpu_acpi_id(cpu) != CPU_ACPIID_INVALID)
                per_cpu(xen_vcpu_id, cpu) = cpu_acpi_id(cpu);
        else
                per_cpu(xen_vcpu_id, cpu) = cpu;