]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/apic: Add max_apic_id member
authorThomas Gleixner <tglx@linutronix.de>
Tue, 8 Aug 2023 22:04:10 +0000 (15:04 -0700)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 9 Aug 2023 18:58:31 +0000 (11:58 -0700)
There is really no point to have a callback which compares numbers.

Add a field which allows each APIC to store the maximum APIC ID supported
and fill it in for all APIC incarnations.

The next step will remove the callback.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Tested-by: Juergen Gross <jgross@suse.com> # Xen PV (dom0 and unpriv. guest)
arch/x86/include/asm/apic.h
arch/x86/kernel/apic/apic_flat_64.c
arch/x86/kernel/apic/apic_noop.c
arch/x86/kernel/apic/apic_numachip.c
arch/x86/kernel/apic/bigsmp_32.c
arch/x86/kernel/apic/probe_32.c
arch/x86/kernel/apic/x2apic_cluster.c
arch/x86/kernel/apic/x2apic_phys.c
arch/x86/kernel/apic/x2apic_uv_x.c
arch/x86/xen/apic.c

index 5a01d51a2970669b99aaad7a5246c0eb94063855..42d3240f4f899469f3eff70fb516199b5343dfc8 100644 (file)
@@ -277,6 +277,9 @@ struct apic {
        u64     (*icr_read)(void);
        void    (*icr_write)(u32 low, u32 high);
 
+       /* The limit of the APIC ID space. */
+       u32     max_apic_id;
+
        /* Probe, setup and smpboot functions */
        int     (*probe)(void);
        int     (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
index 1da865f9c65716272cdfbb5398a5ec553221ecd7..b5e85bb021a168aef4d6c4d3700e286793e862ac 100644 (file)
@@ -94,6 +94,7 @@ static struct apic apic_flat __ro_after_init = {
        .cpu_present_to_apicid          = default_cpu_present_to_apicid,
        .phys_pkg_id                    = flat_phys_pkg_id,
 
+       .max_apic_id                    = 0xFE,
        .get_apic_id                    = flat_get_apic_id,
        .set_apic_id                    = set_apic_id,
 
@@ -170,6 +171,7 @@ static struct apic apic_physflat __ro_after_init = {
        .cpu_present_to_apicid          = default_cpu_present_to_apicid,
        .phys_pkg_id                    = flat_phys_pkg_id,
 
+       .max_apic_id                    = 0xFE,
        .get_apic_id                    = flat_get_apic_id,
        .set_apic_id                    = set_apic_id,
 
index 36c1e287ad0513b3bbb8750b18198e2db827debc..d49c10d31318b94992e0af9f9ff064633b8a38bd 100644 (file)
@@ -80,6 +80,7 @@ struct apic apic_noop __ro_after_init = {
 
        .phys_pkg_id                    = noop_phys_pkg_id,
 
+       .max_apic_id                    = 0xFE,
        .get_apic_id                    = noop_get_apic_id,
        .set_apic_id                    = NULL,
 
index e879dbb576960065e95ab7dad9ec8f6f97698f85..43cbc24dbdfdd624a49d17af923e828ac99bcaea 100644 (file)
@@ -239,6 +239,7 @@ static const struct apic apic_numachip1 __refconst = {
        .cpu_present_to_apicid          = default_cpu_present_to_apicid,
        .phys_pkg_id                    = numachip_phys_pkg_id,
 
+       .max_apic_id                    = UINT_MAX,
        .get_apic_id                    = numachip1_get_apic_id,
        .set_apic_id                    = numachip1_set_apic_id,
 
@@ -278,6 +279,7 @@ static const struct apic apic_numachip2 __refconst = {
        .cpu_present_to_apicid          = default_cpu_present_to_apicid,
        .phys_pkg_id                    = numachip_phys_pkg_id,
 
+       .max_apic_id                    = UINT_MAX,
        .get_apic_id                    = numachip2_get_apic_id,
        .set_apic_id                    = numachip2_set_apic_id,
 
index 32984bfb3ce6b158b4ed65cd3144a43d1f6ae242..5f7a94b97e17055fee9207c1c9e9cdd32aa2197f 100644 (file)
@@ -91,6 +91,7 @@ static struct apic apic_bigsmp __ro_after_init = {
        .cpu_present_to_apicid          = default_cpu_present_to_apicid,
        .phys_pkg_id                    = bigsmp_phys_pkg_id,
 
+       .max_apic_id                    = 0xFE,
        .get_apic_id                    = bigsmp_get_apic_id,
        .set_apic_id                    = NULL,
 
index a861a773ce5c13c48da2139928379bec3212d39d..7c4b5f716bb63f707714a322165a70d0c5d0f6da 100644 (file)
@@ -47,6 +47,7 @@ static struct apic apic_default __ro_after_init = {
        .cpu_present_to_apicid          = default_cpu_present_to_apicid,
        .phys_pkg_id                    = default_phys_pkg_id,
 
+       .max_apic_id                    = 0xFE,
        .get_apic_id                    = default_get_apic_id,
        .set_apic_id                    = NULL,
 
index afd26764047a4b3bf62d740a499799c9d473d6a8..036dd1c3a60bd931129c33adeec19bbab232cd42 100644 (file)
@@ -239,6 +239,7 @@ static struct apic apic_x2apic_cluster __ro_after_init = {
        .cpu_present_to_apicid          = default_cpu_present_to_apicid,
        .phys_pkg_id                    = x2apic_phys_pkg_id,
 
+       .max_apic_id                    = UINT_MAX,
        .get_apic_id                    = x2apic_get_apic_id,
        .set_apic_id                    = x2apic_set_apic_id,
 
index c40d19b140bc550d47ae85174adcbffd8978ecca..d6495acaf6afc354e2a2bdb046749d5f30e4bef5 100644 (file)
@@ -163,6 +163,7 @@ static struct apic apic_x2apic_phys __ro_after_init = {
        .cpu_present_to_apicid          = default_cpu_present_to_apicid,
        .phys_pkg_id                    = x2apic_phys_pkg_id,
 
+       .max_apic_id                    = UINT_MAX,
        .get_apic_id                    = x2apic_get_apic_id,
        .set_apic_id                    = x2apic_set_apic_id,
 
index a8ed237bcde7e1112e9c03459a8566d331c3d15c..7d4eaa889e6444a0938e47a4f108dcfeb193184e 100644 (file)
@@ -822,6 +822,7 @@ static struct apic apic_x2apic_uv_x __ro_after_init = {
        .cpu_present_to_apicid          = default_cpu_present_to_apicid,
        .phys_pkg_id                    = uv_phys_pkg_id,
 
+       .max_apic_id                    = UINT_MAX,
        .get_apic_id                    = x2apic_get_apic_id,
        .set_apic_id                    = set_apic_id,
 
index 0f71b2e79c76ffa714f4fc56dec988dfbe765fe3..572814b29c6d079f28d13e23db1e8044b2ca45bd 100644 (file)
@@ -138,6 +138,7 @@ static struct apic xen_pv_apic = {
        .cpu_present_to_apicid          = xen_cpu_present_to_apicid,
        .phys_pkg_id                    = xen_phys_pkg_id, /* detect_ht */
 
+       .max_apic_id                    = UINT_MAX,
        .get_apic_id                    = xen_get_apic_id,
        .set_apic_id                    = xen_set_apic_id, /* Can be NULL on 32-bit. */