aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2016-04-04 16:25:00 -0400
committerIngo Molnar <mingo@kernel.org>2016-04-13 05:37:41 -0400
commit93984fbd4e33cc861d5b49caed02a02cbfb01340 (patch)
tree2afd13ced553563eebd2701401ea6dac0b3b4d66
parent59e21e3d00e6bc23186763c3e0bf11baf8924124 (diff)
x86/cpufeature: Replace cpu_has_apic with boot_cpu_has() usage
Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: iommu@lists.linux-foundation.org Cc: linux-pm@vger.kernel.org Cc: oprofile-list@lists.sf.net Link: http://lkml.kernel.org/r/1459801503-15600-8-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/events/core.c2
-rw-r--r--arch/x86/include/asm/cpufeature.h1
-rw-r--r--arch/x86/include/asm/irq_work.h2
-rw-r--r--arch/x86/kernel/acpi/boot.c8
-rw-r--r--arch/x86/kernel/apic/apic.c20
-rw-r--r--arch/x86/kernel/apic/apic_noop.c4
-rw-r--r--arch/x86/kernel/apic/io_apic.c2
-rw-r--r--arch/x86/kernel/apic/ipi.c2
-rw-r--r--arch/x86/kernel/apic/vector.c2
-rw-r--r--arch/x86/kernel/cpu/amd.c4
-rw-r--r--arch/x86/kernel/cpu/intel.c2
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_intel.c2
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c2
-rw-r--r--arch/x86/kernel/devicetree.c2
-rw-r--r--arch/x86/kernel/smpboot.c2
-rw-r--r--arch/x86/oprofile/nmi_int.c2
-rw-r--r--arch/x86/pci/xen.c2
-rw-r--r--drivers/cpufreq/longhaul.c2
-rw-r--r--drivers/iommu/irq_remapping.c2
19 files changed, 32 insertions, 33 deletions
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
index 041e442a3e28..54c17455600e 100644
--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -1518,7 +1518,7 @@ x86_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu)
1518 1518
1519static void __init pmu_check_apic(void) 1519static void __init pmu_check_apic(void)
1520{ 1520{
1521 if (cpu_has_apic) 1521 if (boot_cpu_has(X86_FEATURE_APIC))
1522 return; 1522 return;
1523 1523
1524 x86_pmu.apic = 0; 1524 x86_pmu.apic = 0;
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 8f58cd215f6d..c532961c7439 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -118,7 +118,6 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
118 set_bit(bit, (unsigned long *)cpu_caps_set); \ 118 set_bit(bit, (unsigned long *)cpu_caps_set); \
119} while (0) 119} while (0)
120 120
121#define cpu_has_apic boot_cpu_has(X86_FEATURE_APIC)
122#define cpu_has_fxsr boot_cpu_has(X86_FEATURE_FXSR) 121#define cpu_has_fxsr boot_cpu_has(X86_FEATURE_FXSR)
123#define cpu_has_xsave boot_cpu_has(X86_FEATURE_XSAVE) 122#define cpu_has_xsave boot_cpu_has(X86_FEATURE_XSAVE)
124#define cpu_has_xsaves boot_cpu_has(X86_FEATURE_XSAVES) 123#define cpu_has_xsaves boot_cpu_has(X86_FEATURE_XSAVES)
diff --git a/arch/x86/include/asm/irq_work.h b/arch/x86/include/asm/irq_work.h
index d0afb05c84fc..f70604125286 100644
--- a/arch/x86/include/asm/irq_work.h
+++ b/arch/x86/include/asm/irq_work.h
@@ -5,7 +5,7 @@
5 5
6static inline bool arch_irq_work_has_interrupt(void) 6static inline bool arch_irq_work_has_interrupt(void)
7{ 7{
8 return cpu_has_apic; 8 return boot_cpu_has(X86_FEATURE_APIC);
9} 9}
10 10
11#endif /* _ASM_IRQ_WORK_H */ 11#endif /* _ASM_IRQ_WORK_H */
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 8c2f1ef6ca23..2522e564269e 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -136,7 +136,7 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)
136{ 136{
137 struct acpi_table_madt *madt = NULL; 137 struct acpi_table_madt *madt = NULL;
138 138
139 if (!cpu_has_apic) 139 if (!boot_cpu_has(X86_FEATURE_APIC))
140 return -EINVAL; 140 return -EINVAL;
141 141
142 madt = (struct acpi_table_madt *)table; 142 madt = (struct acpi_table_madt *)table;
@@ -951,7 +951,7 @@ static int __init early_acpi_parse_madt_lapic_addr_ovr(void)
951{ 951{
952 int count; 952 int count;
953 953
954 if (!cpu_has_apic) 954 if (!boot_cpu_has(X86_FEATURE_APIC))
955 return -ENODEV; 955 return -ENODEV;
956 956
957 /* 957 /*
@@ -979,7 +979,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
979 int ret; 979 int ret;
980 struct acpi_subtable_proc madt_proc[2]; 980 struct acpi_subtable_proc madt_proc[2];
981 981
982 if (!cpu_has_apic) 982 if (!boot_cpu_has(X86_FEATURE_APIC))
983 return -ENODEV; 983 return -ENODEV;
984 984
985 /* 985 /*
@@ -1125,7 +1125,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
1125 if (acpi_disabled || acpi_noirq) 1125 if (acpi_disabled || acpi_noirq)
1126 return -ENODEV; 1126 return -ENODEV;
1127 1127
1128 if (!cpu_has_apic) 1128 if (!boot_cpu_has(X86_FEATURE_APIC))
1129 return -ENODEV; 1129 return -ENODEV;
1130 1130
1131 /* 1131 /*
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 0b6509f1a4fe..60078a67d7e3 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1085,7 +1085,7 @@ void lapic_shutdown(void)
1085{ 1085{
1086 unsigned long flags; 1086 unsigned long flags;
1087 1087
1088 if (!cpu_has_apic && !apic_from_smp_config()) 1088 if (!boot_cpu_has(X86_FEATURE_APIC) && !apic_from_smp_config())
1089 return; 1089 return;
1090 1090
1091 local_irq_save(flags); 1091 local_irq_save(flags);
@@ -1134,7 +1134,7 @@ void __init init_bsp_APIC(void)
1134 * Don't do the setup now if we have a SMP BIOS as the 1134 * Don't do the setup now if we have a SMP BIOS as the
1135 * through-I/O-APIC virtual wire mode might be active. 1135 * through-I/O-APIC virtual wire mode might be active.
1136 */ 1136 */
1137 if (smp_found_config || !cpu_has_apic) 1137 if (smp_found_config || !boot_cpu_has(X86_FEATURE_APIC))
1138 return; 1138 return;
1139 1139
1140 /* 1140 /*
@@ -1445,7 +1445,7 @@ static void __x2apic_disable(void)
1445{ 1445{
1446 u64 msr; 1446 u64 msr;
1447 1447
1448 if (!cpu_has_apic) 1448 if (!boot_cpu_has(X86_FEATURE_APIC))
1449 return; 1449 return;
1450 1450
1451 rdmsrl(MSR_IA32_APICBASE, msr); 1451 rdmsrl(MSR_IA32_APICBASE, msr);
@@ -1632,7 +1632,7 @@ void __init enable_IR_x2apic(void)
1632 */ 1632 */
1633static int __init detect_init_APIC(void) 1633static int __init detect_init_APIC(void)
1634{ 1634{
1635 if (!cpu_has_apic) { 1635 if (!boot_cpu_has(X86_FEATURE_APIC)) {
1636 pr_info("No local APIC present\n"); 1636 pr_info("No local APIC present\n");
1637 return -1; 1637 return -1;
1638 } 1638 }
@@ -1711,14 +1711,14 @@ static int __init detect_init_APIC(void)
1711 goto no_apic; 1711 goto no_apic;
1712 case X86_VENDOR_INTEL: 1712 case X86_VENDOR_INTEL:
1713 if (boot_cpu_data.x86 == 6 || boot_cpu_data.x86 == 15 || 1713 if (boot_cpu_data.x86 == 6 || boot_cpu_data.x86 == 15 ||
1714 (boot_cpu_data.x86 == 5 && cpu_has_apic)) 1714 (boot_cpu_data.x86 == 5 && boot_cpu_has(X86_FEATURE_APIC)))
1715 break; 1715 break;
1716 goto no_apic; 1716 goto no_apic;
1717 default: 1717 default:
1718 goto no_apic; 1718 goto no_apic;
1719 } 1719 }
1720 1720
1721 if (!cpu_has_apic) { 1721 if (!boot_cpu_has(X86_FEATURE_APIC)) {
1722 /* 1722 /*
1723 * Over-ride BIOS and try to enable the local APIC only if 1723 * Over-ride BIOS and try to enable the local APIC only if
1724 * "lapic" specified. 1724 * "lapic" specified.
@@ -2233,19 +2233,19 @@ int __init APIC_init_uniprocessor(void)
2233 return -1; 2233 return -1;
2234 } 2234 }
2235#ifdef CONFIG_X86_64 2235#ifdef CONFIG_X86_64
2236 if (!cpu_has_apic) { 2236 if (!boot_cpu_has(X86_FEATURE_APIC)) {
2237 disable_apic = 1; 2237 disable_apic = 1;
2238 pr_info("Apic disabled by BIOS\n"); 2238 pr_info("Apic disabled by BIOS\n");
2239 return -1; 2239 return -1;
2240 } 2240 }
2241#else 2241#else
2242 if (!smp_found_config && !cpu_has_apic) 2242 if (!smp_found_config && !boot_cpu_has(X86_FEATURE_APIC))
2243 return -1; 2243 return -1;
2244 2244
2245 /* 2245 /*
2246 * Complain if the BIOS pretends there is one. 2246 * Complain if the BIOS pretends there is one.
2247 */ 2247 */
2248 if (!cpu_has_apic && 2248 if (!boot_cpu_has(X86_FEATURE_APIC) &&
2249 APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) { 2249 APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) {
2250 pr_err("BIOS bug, local APIC 0x%x not detected!...\n", 2250 pr_err("BIOS bug, local APIC 0x%x not detected!...\n",
2251 boot_cpu_physical_apicid); 2251 boot_cpu_physical_apicid);
@@ -2426,7 +2426,7 @@ static void apic_pm_activate(void)
2426static int __init init_lapic_sysfs(void) 2426static int __init init_lapic_sysfs(void)
2427{ 2427{
2428 /* XXX: remove suspend/resume procs if !apic_pm_state.active? */ 2428 /* XXX: remove suspend/resume procs if !apic_pm_state.active? */
2429 if (cpu_has_apic) 2429 if (boot_cpu_has(X86_FEATURE_APIC))
2430 register_syscore_ops(&lapic_syscore_ops); 2430 register_syscore_ops(&lapic_syscore_ops);
2431 2431
2432 return 0; 2432 return 0;
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c
index 331a7a07c48f..13d19ed58514 100644
--- a/arch/x86/kernel/apic/apic_noop.c
+++ b/arch/x86/kernel/apic/apic_noop.c
@@ -100,13 +100,13 @@ static void noop_vector_allocation_domain(int cpu, struct cpumask *retmask,
100 100
101static u32 noop_apic_read(u32 reg) 101static u32 noop_apic_read(u32 reg)
102{ 102{
103 WARN_ON_ONCE((cpu_has_apic && !disable_apic)); 103 WARN_ON_ONCE(boot_cpu_has(X86_FEATURE_APIC) && !disable_apic);
104 return 0; 104 return 0;
105} 105}
106 106
107static void noop_apic_write(u32 reg, u32 v) 107static void noop_apic_write(u32 reg, u32 v)
108{ 108{
109 WARN_ON_ONCE(cpu_has_apic && !disable_apic); 109 WARN_ON_ONCE(boot_cpu_has(X86_FEATURE_APIC) && !disable_apic);
110} 110}
111 111
112struct apic apic_noop = { 112struct apic apic_noop = {
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index fdb0fbfb1197..84e33ff5a6d5 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1454,7 +1454,7 @@ void native_disable_io_apic(void)
1454 ioapic_write_entry(ioapic_i8259.apic, ioapic_i8259.pin, entry); 1454 ioapic_write_entry(ioapic_i8259.apic, ioapic_i8259.pin, entry);
1455 } 1455 }
1456 1456
1457 if (cpu_has_apic || apic_from_smp_config()) 1457 if (boot_cpu_has(X86_FEATURE_APIC) || apic_from_smp_config())
1458 disconnect_bsp_APIC(ioapic_i8259.pin != -1); 1458 disconnect_bsp_APIC(ioapic_i8259.pin != -1);
1459} 1459}
1460 1460
diff --git a/arch/x86/kernel/apic/ipi.c b/arch/x86/kernel/apic/ipi.c
index 28bde88b0085..2a0f225afebd 100644
--- a/arch/x86/kernel/apic/ipi.c
+++ b/arch/x86/kernel/apic/ipi.c
@@ -230,7 +230,7 @@ int safe_smp_processor_id(void)
230{ 230{
231 int apicid, cpuid; 231 int apicid, cpuid;
232 232
233 if (!cpu_has_apic) 233 if (!boot_cpu_has(X86_FEATURE_APIC))
234 return 0; 234 return 0;
235 235
236 apicid = hard_smp_processor_id(); 236 apicid = hard_smp_processor_id();
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index ad59d70bcb1a..26d3ccc63e40 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -943,7 +943,7 @@ static int __init print_ICs(void)
943 print_PIC(); 943 print_PIC();
944 944
945 /* don't print out if apic is not there */ 945 /* don't print out if apic is not there */
946 if (!cpu_has_apic && !apic_from_smp_config()) 946 if (!boot_cpu_has(X86_FEATURE_APIC) && !apic_from_smp_config())
947 return 0; 947 return 0;
948 948
949 print_local_APICs(show_lapic); 949 print_local_APICs(show_lapic);
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 19d7dcfc8b3e..54f7b44dcf01 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -565,9 +565,9 @@ static void early_init_amd(struct cpuinfo_x86 *c)
565 * can safely set X86_FEATURE_EXTD_APICID unconditionally for families 565 * can safely set X86_FEATURE_EXTD_APICID unconditionally for families
566 * after 16h. 566 * after 16h.
567 */ 567 */
568 if (cpu_has_apic && c->x86 > 0x16) { 568 if (boot_cpu_has(X86_FEATURE_APIC) && c->x86 > 0x16) {
569 set_cpu_cap(c, X86_FEATURE_EXTD_APICID); 569 set_cpu_cap(c, X86_FEATURE_EXTD_APICID);
570 } else if (cpu_has_apic && c->x86 >= 0xf) { 570 } else if (boot_cpu_has(X86_FEATURE_APIC) && c->x86 >= 0xf) {
571 /* check CPU config space for extended APIC ID */ 571 /* check CPU config space for extended APIC ID */
572 unsigned int val; 572 unsigned int val;
573 val = read_pci_config(0, 24, 0, 0x68); 573 val = read_pci_config(0, 24, 0, 0x68);
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index f71a34944b56..1d5582259b20 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -281,7 +281,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
281 * integrated APIC (see 11AP erratum in "Pentium Processor 281 * integrated APIC (see 11AP erratum in "Pentium Processor
282 * Specification Update"). 282 * Specification Update").
283 */ 283 */
284 if (cpu_has_apic && (c->x86<<8 | c->x86_model<<4) == 0x520 && 284 if (boot_cpu_has(X86_FEATURE_APIC) && (c->x86<<8 | c->x86_model<<4) == 0x520 &&
285 (c->x86_mask < 0x6 || c->x86_mask == 0xb)) 285 (c->x86_mask < 0x6 || c->x86_mask == 0xb))
286 set_cpu_bug(c, X86_BUG_11AP); 286 set_cpu_bug(c, X86_BUG_11AP);
287 287
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mcheck/mce_intel.c
index 1e8bb6c94f14..1defb8ea882c 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_intel.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_intel.c
@@ -84,7 +84,7 @@ static int cmci_supported(int *banks)
84 */ 84 */
85 if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) 85 if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
86 return 0; 86 return 0;
87 if (!cpu_has_apic || lapic_get_maxlvt() < 6) 87 if (!boot_cpu_has(X86_FEATURE_APIC) || lapic_get_maxlvt() < 6)
88 return 0; 88 return 0;
89 rdmsrl(MSR_IA32_MCG_CAP, cap); 89 rdmsrl(MSR_IA32_MCG_CAP, cap);
90 *banks = min_t(unsigned, MAX_NR_BANKS, cap & 0xff); 90 *banks = min_t(unsigned, MAX_NR_BANKS, cap & 0xff);
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 0b445c2ff735..615793321c49 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -447,7 +447,7 @@ asmlinkage __visible void smp_trace_thermal_interrupt(struct pt_regs *regs)
447/* Thermal monitoring depends on APIC, ACPI and clock modulation */ 447/* Thermal monitoring depends on APIC, ACPI and clock modulation */
448static int intel_thermal_supported(struct cpuinfo_x86 *c) 448static int intel_thermal_supported(struct cpuinfo_x86 *c)
449{ 449{
450 if (!cpu_has_apic) 450 if (!boot_cpu_has(X86_FEATURE_APIC))
451 return 0; 451 return 0;
452 if (!cpu_has(c, X86_FEATURE_ACPI) || !cpu_has(c, X86_FEATURE_ACC)) 452 if (!cpu_has(c, X86_FEATURE_ACPI) || !cpu_has(c, X86_FEATURE_ACC))
453 return 0; 453 return 0;
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 1f4acd68b98b..3fe45f84ced4 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -151,7 +151,7 @@ static void __init dtb_lapic_setup(void)
151 return; 151 return;
152 152
153 /* Did the boot loader setup the local APIC ? */ 153 /* Did the boot loader setup the local APIC ? */
154 if (!cpu_has_apic) { 154 if (!boot_cpu_has(X86_FEATURE_APIC)) {
155 if (apic_force_enable(r.start)) 155 if (apic_force_enable(r.start))
156 return; 156 return;
157 } 157 }
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index a2065d3b3b39..1fe4130b14d9 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1231,7 +1231,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
1231 * If we couldn't find a local APIC, then get out of here now! 1231 * If we couldn't find a local APIC, then get out of here now!
1232 */ 1232 */
1233 if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid]) && 1233 if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid]) &&
1234 !cpu_has_apic) { 1234 !boot_cpu_has(X86_FEATURE_APIC)) {
1235 if (!disable_apic) { 1235 if (!disable_apic) {
1236 pr_err("BIOS bug, local APIC #%d not detected!...\n", 1236 pr_err("BIOS bug, local APIC #%d not detected!...\n",
1237 boot_cpu_physical_apicid); 1237 boot_cpu_physical_apicid);
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 25171e9595f7..28c04123b6dd 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -700,7 +700,7 @@ int __init op_nmi_init(struct oprofile_operations *ops)
700 char *cpu_type = NULL; 700 char *cpu_type = NULL;
701 int ret = 0; 701 int ret = 0;
702 702
703 if (!cpu_has_apic) 703 if (!boot_cpu_has(X86_FEATURE_APIC))
704 return -ENODEV; 704 return -ENODEV;
705 705
706 if (force_cpu_type == timer) 706 if (force_cpu_type == timer)
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
index beac4dfdade6..4bd08b0fc8ea 100644
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -445,7 +445,7 @@ void __init xen_msi_init(void)
445 uint32_t eax = cpuid_eax(xen_cpuid_base() + 4); 445 uint32_t eax = cpuid_eax(xen_cpuid_base() + 4);
446 446
447 if (((eax & XEN_HVM_CPUID_X2APIC_VIRT) && x2apic_mode) || 447 if (((eax & XEN_HVM_CPUID_X2APIC_VIRT) && x2apic_mode) ||
448 ((eax & XEN_HVM_CPUID_APIC_ACCESS_VIRT) && cpu_has_apic)) 448 ((eax & XEN_HVM_CPUID_APIC_ACCESS_VIRT) && boot_cpu_has(X86_FEATURE_APIC)))
449 return; 449 return;
450 } 450 }
451 451
diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index 0f6b229afcb9..247bfa8eaddb 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
@@ -945,7 +945,7 @@ static int __init longhaul_init(void)
945 } 945 }
946#endif 946#endif
947#ifdef CONFIG_X86_IO_APIC 947#ifdef CONFIG_X86_IO_APIC
948 if (cpu_has_apic) { 948 if (boot_cpu_has(X86_FEATURE_APIC)) {
949 printk(KERN_ERR PFX "APIC detected. Longhaul is currently " 949 printk(KERN_ERR PFX "APIC detected. Longhaul is currently "
950 "broken in this configuration.\n"); 950 "broken in this configuration.\n");
951 return -ENODEV; 951 return -ENODEV;
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
index 8adaaeae3268..49721b4e1975 100644
--- a/drivers/iommu/irq_remapping.c
+++ b/drivers/iommu/irq_remapping.c
@@ -36,7 +36,7 @@ static void irq_remapping_disable_io_apic(void)
36 * As this gets called during crash dump, keep this simple for 36 * As this gets called during crash dump, keep this simple for
37 * now. 37 * now.
38 */ 38 */
39 if (cpu_has_apic || apic_from_smp_config()) 39 if (boot_cpu_has(X86_FEATURE_APIC) || apic_from_smp_config())
40 disconnect_bsp_APIC(0); 40 disconnect_bsp_APIC(0);
41} 41}
42 42