]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/apic/ioapic: Rename skip_ioapic_setup
authorThomas Gleixner <tglx@linutronix.de>
Tue, 8 Aug 2023 22:03:41 +0000 (15:03 -0700)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 9 Aug 2023 18:58:16 +0000 (11:58 -0700)
Another variable name which is confusing at best. Convert to bool.

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/io_apic.h
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/io_apic.c
arch/x86/xen/smp_pv.c

index 437aa8d00e53742125fdaa7221bbb71ff1d28430..51c782600e0260054ffab6121a0afbcede078de0 100644 (file)
@@ -109,8 +109,8 @@ extern int mp_irq_entries;
 /* MP IRQ source entries */
 extern struct mpc_intsrc mp_irqs[MAX_IRQ_SOURCES];
 
-/* 1 if "noapic" boot option passed */
-extern int skip_ioapic_setup;
+/* True if "noapic" boot option passed */
+extern bool ioapic_is_disabled;
 
 /* 1 if "noapic" boot option passed */
 extern int noioapicquirk;
@@ -129,7 +129,7 @@ extern unsigned long io_apic_irqs;
  * assignment of PCI IRQ's.
  */
 #define io_apic_assign_pci_irqs \
-       (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs)
+       (mp_irq_entries && !ioapic_is_disabled && io_apic_irqs)
 
 struct irq_cfg;
 extern void ioapic_insert_resources(void);
@@ -179,6 +179,7 @@ extern void print_IO_APICs(void);
 #define IO_APIC_IRQ(x)         0
 #define io_apic_assign_pci_irqs 0
 #define setup_ioapic_ids_from_mpc x86_init_noop
+#define nr_ioapics             (0)
 static inline void ioapic_insert_resources(void) { }
 static inline int arch_early_ioapic_init(void) { return 0; }
 static inline void print_IO_APICs(void) {}
index 21b542a6866cf74b303f099ce42f6341186e5a27..38a52983082907c5e52b8887b685caa3ce585af9 100644 (file)
@@ -1275,7 +1275,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
        /*
         * if "noapic" boot option, don't look for IO-APICs
         */
-       if (skip_ioapic_setup) {
+       if (ioapic_is_disabled) {
                pr_info("Skipping IOAPIC probe due to 'noapic' option.\n");
                return -ENODEV;
        }
index a9dd9038f59c1f86ebaa729e776d3f37afc79821..cffec1fe84869dd132643bff043d9367af33c488 100644 (file)
@@ -1691,7 +1691,7 @@ static void setup_local_APIC(void)
         * TODO: set up through-local-APIC from through-I/O-APIC? --macro
         */
        value = apic_read(APIC_LVT0) & APIC_LVT_MASKED;
-       if (!cpu && (pic_mode || !value || skip_ioapic_setup)) {
+       if (!cpu && (pic_mode || !value || ioapic_is_disabled)) {
                value = APIC_DM_EXTINT;
                apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n", cpu);
        } else {
@@ -1956,7 +1956,7 @@ void __init enable_IR_x2apic(void)
        unsigned long flags;
        int ret, ir_stat;
 
-       if (skip_ioapic_setup) {
+       if (ioapic_is_disabled) {
                pr_info("Not enabling interrupt remapping due to skipped IO-APIC setup\n");
                return;
        }
@@ -2956,11 +2956,11 @@ early_param("nolapic_timer", parse_nolapic_timer);
 static int __init apic_set_verbosity(char *arg)
 {
        if (!arg)  {
-#ifdef CONFIG_X86_64
-               skip_ioapic_setup = 0;
+               if (IS_ENABLED(CONFIG_X86_32))
+                       return -EINVAL;
+
+               ioapic_is_disabled = false;
                return 0;
-#endif
-               return -EINVAL;
        }
 
        if (strcmp("debug", arg) == 0)
index 4241dc243aa88d019b28cb3cd114a24e3c93679e..48975d53e845ed5d492b27ca38c8453f51b19ee4 100644 (file)
@@ -178,7 +178,7 @@ int mp_bus_id_to_type[MAX_MP_BUSSES];
 
 DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES);
 
-int skip_ioapic_setup;
+bool ioapic_is_disabled __ro_after_init;
 
 /**
  * disable_ioapic_support() - disables ioapic support at runtime
@@ -189,7 +189,7 @@ void disable_ioapic_support(void)
        noioapicquirk = 1;
        noioapicreroute = -1;
 #endif
-       skip_ioapic_setup = 1;
+       ioapic_is_disabled = true;
 }
 
 static int __init parse_noapic(char *str)
@@ -831,7 +831,7 @@ static int __acpi_get_override_irq(u32 gsi, bool *trigger, bool *polarity)
 {
        int ioapic, pin, idx;
 
-       if (skip_ioapic_setup)
+       if (ioapic_is_disabled)
                return -1;
 
        ioapic = mp_find_ioapic(gsi);
@@ -1366,7 +1366,7 @@ void __init enable_IO_APIC(void)
        int i8259_apic, i8259_pin;
        int apic, pin;
 
-       if (skip_ioapic_setup)
+       if (ioapic_is_disabled)
                nr_ioapics = 0;
 
        if (!nr_legacy_irqs() || !nr_ioapics)
@@ -2399,7 +2399,7 @@ void __init setup_IO_APIC(void)
 {
        int ioapic;
 
-       if (skip_ioapic_setup || !nr_ioapics)
+       if (ioapic_is_disabled || !nr_ioapics)
                return;
 
        io_apic_irqs = nr_legacy_irqs() ? ~PIC_IRQS : ~0UL;
@@ -2715,7 +2715,7 @@ void __init io_apic_init_mappings(void)
                                       "address found in MPTABLE, "
                                       "disabling IO/APIC support!\n");
                                smp_found_config = 0;
-                               skip_ioapic_setup = 1;
+                               ioapic_is_disabled = true;
                                goto fake_ioapic_page;
                        }
 #endif
index cef78b8c89f4456acc8d1f5f261320c41a319a2f..c6b42c66c60c5807157af3c801aa427ee5b8f629 100644 (file)
@@ -210,7 +210,7 @@ static void __init xen_pv_smp_prepare_cpus(unsigned int max_cpus)
 {
        unsigned cpu;
 
-       if (skip_ioapic_setup) {
+       if (ioapic_is_disabled) {
                char *m = (max_cpus == 0) ?
                        "The nosmp parameter is incompatible with Xen; " \
                        "use Xen dom0_max_vcpus=1 parameter" :