aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-21 14:20:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-21 14:20:58 -0400
commit4ec9f7a18b9fcef6e8f7c13279b48e3bb5d4d704 (patch)
treeb1b1b49ff1e9b483ab03e66549523eca9985659d
parente234b4a807202990a0aec4e74aa552fe76b5b6d2 (diff)
parentdb15e7f27369b81b6605a546d54eb844f87370a5 (diff)
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: "Half of the fixes are for various build time warnings triggered by randconfig builds. Most (but not all...) were harmless. There's also: - ACPI boundary condition fixes - UV platform fixes - defconfig updates - an AMD K6 CPU init fix - a %pOF printk format related preparatory change - .. and a warning fix related to the tlb/PCID changes" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/devicetree: Convert to using %pOF instead of ->full_name x86/platform/uv/BAU: Disable BAU on single hub configurations x86/platform/intel-mid: Fix a format string overflow warning x86/platform: Add PCI dependency for PUNIT_ATOM_DEBUG x86/build: Silence the build with "make -s" x86/io: Add "memory" clobber to insb/insw/insl/outsb/outsw/outsl x86/fpu/math-emu: Avoid bogus -Wint-in-bool-context warning x86/fpu/math-emu: Fix possible uninitialized variable use perf/x86: Shut up false-positive -Wmaybe-uninitialized warning x86/defconfig: Remove stale, old Kconfig options x86/ioapic: Pass the correct data to unmask_ioapic_irq() x86/acpi: Prevent out of bound access caused by broken ACPI tables x86/mm, KVM: Fix warning when !CONFIG_PREEMPT_COUNT x86/platform/uv/BAU: Fix congested_response_us not taking effect x86/cpu: Use indirect call to measure performance in init_amd_k6()
-rw-r--r--arch/x86/Kconfig.debug1
-rw-r--r--arch/x86/boot/Makefile5
-rw-r--r--arch/x86/configs/i386_defconfig3
-rw-r--r--arch/x86/configs/x86_64_defconfig3
-rw-r--r--arch/x86/events/core.c4
-rw-r--r--arch/x86/include/asm/io.h4
-rw-r--r--arch/x86/include/asm/mmu_context.h2
-rw-r--r--arch/x86/kernel/acpi/boot.c8
-rw-r--r--arch/x86/kernel/apic/io_apic.c2
-rw-r--r--arch/x86/kernel/cpu/amd.c1
-rw-r--r--arch/x86/kernel/devicetree.c3
-rw-r--r--arch/x86/math-emu/Makefile4
-rw-r--r--arch/x86/math-emu/fpu_emu.h2
-rw-r--r--arch/x86/math-emu/reg_compare.c16
-rw-r--r--arch/x86/platform/intel-mid/device_libs/platform_max7315.c6
-rw-r--r--arch/x86/platform/uv/tlb_uv.c29
16 files changed, 55 insertions, 38 deletions
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index fcb7604172ce..cd20ca0b4043 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -348,6 +348,7 @@ config X86_DEBUG_FPU
348 348
349config PUNIT_ATOM_DEBUG 349config PUNIT_ATOM_DEBUG
350 tristate "ATOM Punit debug driver" 350 tristate "ATOM Punit debug driver"
351 depends on PCI
351 select DEBUG_FS 352 select DEBUG_FS
352 select IOSF_MBI 353 select IOSF_MBI
353 ---help--- 354 ---help---
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index 0d810fb15eac..d88a2fddba8c 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -73,12 +73,13 @@ UBSAN_SANITIZE := n
73$(obj)/bzImage: asflags-y := $(SVGA_MODE) 73$(obj)/bzImage: asflags-y := $(SVGA_MODE)
74 74
75quiet_cmd_image = BUILD $@ 75quiet_cmd_image = BUILD $@
76silent_redirect_image = >/dev/null
76cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \ 77cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
77 $(obj)/zoffset.h $@ 78 $(obj)/zoffset.h $@ $($(quiet)redirect_image)
78 79
79$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE 80$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
80 $(call if_changed,image) 81 $(call if_changed,image)
81 @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' 82 @$(kecho) 'Kernel: $@ is ready' ' (#'`cat .version`')'
82 83
83OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note -R .comment -S 84OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note -R .comment -S
84$(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE 85$(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
index 6cf79e1a6830..0eb9f92f3717 100644
--- a/arch/x86/configs/i386_defconfig
+++ b/arch/x86/configs/i386_defconfig
@@ -1,5 +1,4 @@
1# CONFIG_64BIT is not set 1# CONFIG_64BIT is not set
2CONFIG_EXPERIMENTAL=y
3# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
4CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
5CONFIG_POSIX_MQUEUE=y 4CONFIG_POSIX_MQUEUE=y
@@ -125,7 +124,6 @@ CONFIG_NF_CONNTRACK_IPV4=y
125CONFIG_IP_NF_IPTABLES=y 124CONFIG_IP_NF_IPTABLES=y
126CONFIG_IP_NF_FILTER=y 125CONFIG_IP_NF_FILTER=y
127CONFIG_IP_NF_TARGET_REJECT=y 126CONFIG_IP_NF_TARGET_REJECT=y
128CONFIG_IP_NF_TARGET_ULOG=y
129CONFIG_NF_NAT=y 127CONFIG_NF_NAT=y
130CONFIG_IP_NF_TARGET_MASQUERADE=y 128CONFIG_IP_NF_TARGET_MASQUERADE=y
131CONFIG_IP_NF_MANGLE=y 129CONFIG_IP_NF_MANGLE=y
@@ -255,7 +253,6 @@ CONFIG_USB_OHCI_HCD=y
255CONFIG_USB_UHCI_HCD=y 253CONFIG_USB_UHCI_HCD=y
256CONFIG_USB_PRINTER=y 254CONFIG_USB_PRINTER=y
257CONFIG_USB_STORAGE=y 255CONFIG_USB_STORAGE=y
258CONFIG_USB_LIBUSUAL=y
259CONFIG_EDAC=y 256CONFIG_EDAC=y
260CONFIG_RTC_CLASS=y 257CONFIG_RTC_CLASS=y
261# CONFIG_RTC_HCTOSYS is not set 258# CONFIG_RTC_HCTOSYS is not set
diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
index de45f57b410d..4a4b16e56d35 100644
--- a/arch/x86/configs/x86_64_defconfig
+++ b/arch/x86/configs/x86_64_defconfig
@@ -1,4 +1,3 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 1# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y 2CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y 3CONFIG_POSIX_MQUEUE=y
@@ -124,7 +123,6 @@ CONFIG_NF_CONNTRACK_IPV4=y
124CONFIG_IP_NF_IPTABLES=y 123CONFIG_IP_NF_IPTABLES=y
125CONFIG_IP_NF_FILTER=y 124CONFIG_IP_NF_FILTER=y
126CONFIG_IP_NF_TARGET_REJECT=y 125CONFIG_IP_NF_TARGET_REJECT=y
127CONFIG_IP_NF_TARGET_ULOG=y
128CONFIG_NF_NAT=y 126CONFIG_NF_NAT=y
129CONFIG_IP_NF_TARGET_MASQUERADE=y 127CONFIG_IP_NF_TARGET_MASQUERADE=y
130CONFIG_IP_NF_MANGLE=y 128CONFIG_IP_NF_MANGLE=y
@@ -251,7 +249,6 @@ CONFIG_USB_OHCI_HCD=y
251CONFIG_USB_UHCI_HCD=y 249CONFIG_USB_UHCI_HCD=y
252CONFIG_USB_PRINTER=y 250CONFIG_USB_PRINTER=y
253CONFIG_USB_STORAGE=y 251CONFIG_USB_STORAGE=y
254CONFIG_USB_LIBUSUAL=y
255CONFIG_EDAC=y 252CONFIG_EDAC=y
256CONFIG_RTC_CLASS=y 253CONFIG_RTC_CLASS=y
257# CONFIG_RTC_HCTOSYS is not set 254# CONFIG_RTC_HCTOSYS is not set
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
index ff1ea2fb9705..8e3db8f642a7 100644
--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -191,8 +191,8 @@ static void release_pmc_hardware(void) {}
191 191
192static bool check_hw_exists(void) 192static bool check_hw_exists(void)
193{ 193{
194 u64 val, val_fail, val_new= ~0; 194 u64 val, val_fail = -1, val_new= ~0;
195 int i, reg, reg_fail, ret = 0; 195 int i, reg, reg_fail = -1, ret = 0;
196 int bios_fail = 0; 196 int bios_fail = 0;
197 int reg_safe = -1; 197 int reg_safe = -1;
198 198
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 7afb0e2f07f4..48febf07e828 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -328,13 +328,13 @@ static inline unsigned type in##bwl##_p(int port) \
328static inline void outs##bwl(int port, const void *addr, unsigned long count) \ 328static inline void outs##bwl(int port, const void *addr, unsigned long count) \
329{ \ 329{ \
330 asm volatile("rep; outs" #bwl \ 330 asm volatile("rep; outs" #bwl \
331 : "+S"(addr), "+c"(count) : "d"(port)); \ 331 : "+S"(addr), "+c"(count) : "d"(port) : "memory"); \
332} \ 332} \
333 \ 333 \
334static inline void ins##bwl(int port, void *addr, unsigned long count) \ 334static inline void ins##bwl(int port, void *addr, unsigned long count) \
335{ \ 335{ \
336 asm volatile("rep; ins" #bwl \ 336 asm volatile("rep; ins" #bwl \
337 : "+D"(addr), "+c"(count) : "d"(port)); \ 337 : "+D"(addr), "+c"(count) : "d"(port) : "memory"); \
338} 338}
339 339
340BUILDIO(b, b, char) 340BUILDIO(b, b, char)
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h
index ecfcb6643c9b..265c907d7d4c 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
@@ -293,7 +293,7 @@ static inline unsigned long __get_current_cr3_fast(void)
293 unsigned long cr3 = __pa(this_cpu_read(cpu_tlbstate.loaded_mm)->pgd); 293 unsigned long cr3 = __pa(this_cpu_read(cpu_tlbstate.loaded_mm)->pgd);
294 294
295 /* For now, be very restrictive about when this can be called. */ 295 /* For now, be very restrictive about when this can be called. */
296 VM_WARN_ON(in_nmi() || !in_atomic()); 296 VM_WARN_ON(in_nmi() || preemptible());
297 297
298 VM_BUG_ON(cr3 != __read_cr3()); 298 VM_BUG_ON(cr3 != __read_cr3());
299 return cr3; 299 return cr3;
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 6bb680671088..7491e73d9253 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -347,6 +347,14 @@ static void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
347 struct mpc_intsrc mp_irq; 347 struct mpc_intsrc mp_irq;
348 348
349 /* 349 /*
350 * Check bus_irq boundary.
351 */
352 if (bus_irq >= NR_IRQS_LEGACY) {
353 pr_warn("Invalid bus_irq %u for legacy override\n", bus_irq);
354 return;
355 }
356
357 /*
350 * Convert 'gsi' to 'ioapic.pin'. 358 * Convert 'gsi' to 'ioapic.pin'.
351 */ 359 */
352 ioapic = mp_find_ioapic(gsi); 360 ioapic = mp_find_ioapic(gsi);
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index b4f5f73febdb..237e9c2341c7 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2093,7 +2093,7 @@ static inline void __init check_timer(void)
2093 int idx; 2093 int idx;
2094 idx = find_irq_entry(apic1, pin1, mp_INT); 2094 idx = find_irq_entry(apic1, pin1, mp_INT);
2095 if (idx != -1 && irq_trigger(idx)) 2095 if (idx != -1 && irq_trigger(idx))
2096 unmask_ioapic_irq(irq_get_chip_data(0)); 2096 unmask_ioapic_irq(irq_get_irq_data(0));
2097 } 2097 }
2098 irq_domain_deactivate_irq(irq_data); 2098 irq_domain_deactivate_irq(irq_data);
2099 irq_domain_activate_irq(irq_data); 2099 irq_domain_activate_irq(irq_data);
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index bb5abe8f5fd4..3b9e220621f8 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -134,6 +134,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
134 134
135 n = K6_BUG_LOOP; 135 n = K6_BUG_LOOP;
136 f_vide = vide; 136 f_vide = vide;
137 OPTIMIZER_HIDE_VAR(f_vide);
137 d = rdtsc(); 138 d = rdtsc();
138 while (n--) 139 while (n--)
139 f_vide(); 140 f_vide();
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 3fe45f84ced4..cbf1f6ba39a8 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -235,8 +235,7 @@ static void __init dtb_add_ioapic(struct device_node *dn)
235 235
236 ret = of_address_to_resource(dn, 0, &r); 236 ret = of_address_to_resource(dn, 0, &r);
237 if (ret) { 237 if (ret) {
238 printk(KERN_ERR "Can't obtain address from node %s.\n", 238 printk(KERN_ERR "Can't obtain address from device node %pOF.\n", dn);
239 dn->full_name);
240 return; 239 return;
241 } 240 }
242 mp_register_ioapic(++ioapic_id, r.start, gsi_top, &cfg); 241 mp_register_ioapic(++ioapic_id, r.start, gsi_top, &cfg);
diff --git a/arch/x86/math-emu/Makefile b/arch/x86/math-emu/Makefile
index 9b0c63b60302..1b2dac174321 100644
--- a/arch/x86/math-emu/Makefile
+++ b/arch/x86/math-emu/Makefile
@@ -5,8 +5,8 @@
5#DEBUG = -DDEBUGGING 5#DEBUG = -DDEBUGGING
6DEBUG = 6DEBUG =
7PARANOID = -DPARANOID 7PARANOID = -DPARANOID
8EXTRA_CFLAGS := $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION) 8ccflags-y += $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION)
9EXTRA_AFLAGS := $(PARANOID) 9asflags-y += $(PARANOID)
10 10
11# From 'C' language sources: 11# From 'C' language sources:
12C_OBJS =fpu_entry.o errors.o \ 12C_OBJS =fpu_entry.o errors.o \
diff --git a/arch/x86/math-emu/fpu_emu.h b/arch/x86/math-emu/fpu_emu.h
index afbc4d805d66..c9c320dccca1 100644
--- a/arch/x86/math-emu/fpu_emu.h
+++ b/arch/x86/math-emu/fpu_emu.h
@@ -157,7 +157,7 @@ extern u_char const data_sizes_16[32];
157 157
158#define signbyte(a) (((u_char *)(a))[9]) 158#define signbyte(a) (((u_char *)(a))[9])
159#define getsign(a) (signbyte(a) & 0x80) 159#define getsign(a) (signbyte(a) & 0x80)
160#define setsign(a,b) { if (b) signbyte(a) |= 0x80; else signbyte(a) &= 0x7f; } 160#define setsign(a,b) { if ((b) != 0) signbyte(a) |= 0x80; else signbyte(a) &= 0x7f; }
161#define copysign(a,b) { if (getsign(a)) signbyte(b) |= 0x80; \ 161#define copysign(a,b) { if (getsign(a)) signbyte(b) |= 0x80; \
162 else signbyte(b) &= 0x7f; } 162 else signbyte(b) &= 0x7f; }
163#define changesign(a) { signbyte(a) ^= 0x80; } 163#define changesign(a) { signbyte(a) ^= 0x80; }
diff --git a/arch/x86/math-emu/reg_compare.c b/arch/x86/math-emu/reg_compare.c
index b77360fdbf4a..19b33b50adfa 100644
--- a/arch/x86/math-emu/reg_compare.c
+++ b/arch/x86/math-emu/reg_compare.c
@@ -168,7 +168,7 @@ static int compare(FPU_REG const *b, int tagb)
168/* This function requires that st(0) is not empty */ 168/* This function requires that st(0) is not empty */
169int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag) 169int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag)
170{ 170{
171 int f = 0, c; 171 int f, c;
172 172
173 c = compare(loaded_data, loaded_tag); 173 c = compare(loaded_data, loaded_tag);
174 174
@@ -189,12 +189,12 @@ int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag)
189 case COMP_No_Comp: 189 case COMP_No_Comp:
190 f = SW_C3 | SW_C2 | SW_C0; 190 f = SW_C3 | SW_C2 | SW_C0;
191 break; 191 break;
192#ifdef PARANOID
193 default: 192 default:
193#ifdef PARANOID
194 EXCEPTION(EX_INTERNAL | 0x121); 194 EXCEPTION(EX_INTERNAL | 0x121);
195#endif /* PARANOID */
195 f = SW_C3 | SW_C2 | SW_C0; 196 f = SW_C3 | SW_C2 | SW_C0;
196 break; 197 break;
197#endif /* PARANOID */
198 } 198 }
199 setcc(f); 199 setcc(f);
200 if (c & COMP_Denormal) { 200 if (c & COMP_Denormal) {
@@ -205,7 +205,7 @@ int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag)
205 205
206static int compare_st_st(int nr) 206static int compare_st_st(int nr)
207{ 207{
208 int f = 0, c; 208 int f, c;
209 FPU_REG *st_ptr; 209 FPU_REG *st_ptr;
210 210
211 if (!NOT_EMPTY(0) || !NOT_EMPTY(nr)) { 211 if (!NOT_EMPTY(0) || !NOT_EMPTY(nr)) {
@@ -235,12 +235,12 @@ static int compare_st_st(int nr)
235 case COMP_No_Comp: 235 case COMP_No_Comp:
236 f = SW_C3 | SW_C2 | SW_C0; 236 f = SW_C3 | SW_C2 | SW_C0;
237 break; 237 break;
238#ifdef PARANOID
239 default: 238 default:
239#ifdef PARANOID
240 EXCEPTION(EX_INTERNAL | 0x122); 240 EXCEPTION(EX_INTERNAL | 0x122);
241#endif /* PARANOID */
241 f = SW_C3 | SW_C2 | SW_C0; 242 f = SW_C3 | SW_C2 | SW_C0;
242 break; 243 break;
243#endif /* PARANOID */
244 } 244 }
245 setcc(f); 245 setcc(f);
246 if (c & COMP_Denormal) { 246 if (c & COMP_Denormal) {
@@ -283,12 +283,12 @@ static int compare_i_st_st(int nr)
283 case COMP_No_Comp: 283 case COMP_No_Comp:
284 f = X86_EFLAGS_ZF | X86_EFLAGS_PF | X86_EFLAGS_CF; 284 f = X86_EFLAGS_ZF | X86_EFLAGS_PF | X86_EFLAGS_CF;
285 break; 285 break;
286#ifdef PARANOID
287 default: 286 default:
287#ifdef PARANOID
288 EXCEPTION(EX_INTERNAL | 0x122); 288 EXCEPTION(EX_INTERNAL | 0x122);
289#endif /* PARANOID */
289 f = 0; 290 f = 0;
290 break; 291 break;
291#endif /* PARANOID */
292 } 292 }
293 FPU_EFLAGS = (FPU_EFLAGS & ~(X86_EFLAGS_ZF | X86_EFLAGS_PF | X86_EFLAGS_CF)) | f; 293 FPU_EFLAGS = (FPU_EFLAGS & ~(X86_EFLAGS_ZF | X86_EFLAGS_PF | X86_EFLAGS_CF)) | f;
294 if (c & COMP_Denormal) { 294 if (c & COMP_Denormal) {
diff --git a/arch/x86/platform/intel-mid/device_libs/platform_max7315.c b/arch/x86/platform/intel-mid/device_libs/platform_max7315.c
index 6e075afa7877..58337b2bc682 100644
--- a/arch/x86/platform/intel-mid/device_libs/platform_max7315.c
+++ b/arch/x86/platform/intel-mid/device_libs/platform_max7315.c
@@ -38,8 +38,10 @@ static void __init *max7315_platform_data(void *info)
38 */ 38 */
39 strcpy(i2c_info->type, "max7315"); 39 strcpy(i2c_info->type, "max7315");
40 if (nr++) { 40 if (nr++) {
41 sprintf(base_pin_name, "max7315_%d_base", nr); 41 snprintf(base_pin_name, sizeof(base_pin_name),
42 sprintf(intr_pin_name, "max7315_%d_int", nr); 42 "max7315_%d_base", nr);
43 snprintf(intr_pin_name, sizeof(intr_pin_name),
44 "max7315_%d_int", nr);
43 } else { 45 } else {
44 strcpy(base_pin_name, "max7315_base"); 46 strcpy(base_pin_name, "max7315_base");
45 strcpy(intr_pin_name, "max7315_int"); 47 strcpy(intr_pin_name, "max7315_int");
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index d4a61ddf9e62..3e4bdb442fbc 100644
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
@@ -40,7 +40,6 @@ static int timeout_base_ns[] = {
40static int timeout_us; 40static int timeout_us;
41static bool nobau = true; 41static bool nobau = true;
42static int nobau_perm; 42static int nobau_perm;
43static cycles_t congested_cycles;
44 43
45/* tunables: */ 44/* tunables: */
46static int max_concurr = MAX_BAU_CONCURRENT; 45static int max_concurr = MAX_BAU_CONCURRENT;
@@ -829,10 +828,10 @@ static void record_send_stats(cycles_t time1, cycles_t time2,
829 if ((completion_status == FLUSH_COMPLETE) && (try == 1)) { 828 if ((completion_status == FLUSH_COMPLETE) && (try == 1)) {
830 bcp->period_requests++; 829 bcp->period_requests++;
831 bcp->period_time += elapsed; 830 bcp->period_time += elapsed;
832 if ((elapsed > congested_cycles) && 831 if ((elapsed > usec_2_cycles(bcp->cong_response_us)) &&
833 (bcp->period_requests > bcp->cong_reps) && 832 (bcp->period_requests > bcp->cong_reps) &&
834 ((bcp->period_time / bcp->period_requests) > 833 ((bcp->period_time / bcp->period_requests) >
835 congested_cycles)) { 834 usec_2_cycles(bcp->cong_response_us))) {
836 stat->s_congested++; 835 stat->s_congested++;
837 disable_for_period(bcp, stat); 836 disable_for_period(bcp, stat);
838 } 837 }
@@ -2222,14 +2221,17 @@ static int __init uv_bau_init(void)
2222 else if (is_uv1_hub()) 2221 else if (is_uv1_hub())
2223 ops = uv1_bau_ops; 2222 ops = uv1_bau_ops;
2224 2223
2224 nuvhubs = uv_num_possible_blades();
2225 if (nuvhubs < 2) {
2226 pr_crit("UV: BAU disabled - insufficient hub count\n");
2227 goto err_bau_disable;
2228 }
2229
2225 for_each_possible_cpu(cur_cpu) { 2230 for_each_possible_cpu(cur_cpu) {
2226 mask = &per_cpu(uv_flush_tlb_mask, cur_cpu); 2231 mask = &per_cpu(uv_flush_tlb_mask, cur_cpu);
2227 zalloc_cpumask_var_node(mask, GFP_KERNEL, cpu_to_node(cur_cpu)); 2232 zalloc_cpumask_var_node(mask, GFP_KERNEL, cpu_to_node(cur_cpu));
2228 } 2233 }
2229 2234
2230 nuvhubs = uv_num_possible_blades();
2231 congested_cycles = usec_2_cycles(congested_respns_us);
2232
2233 uv_base_pnode = 0x7fffffff; 2235 uv_base_pnode = 0x7fffffff;
2234 for (uvhub = 0; uvhub < nuvhubs; uvhub++) { 2236 for (uvhub = 0; uvhub < nuvhubs; uvhub++) {
2235 cpus = uv_blade_nr_possible_cpus(uvhub); 2237 cpus = uv_blade_nr_possible_cpus(uvhub);
@@ -2242,9 +2244,8 @@ static int __init uv_bau_init(void)
2242 enable_timeouts(); 2244 enable_timeouts();
2243 2245
2244 if (init_per_cpu(nuvhubs, uv_base_pnode)) { 2246 if (init_per_cpu(nuvhubs, uv_base_pnode)) {
2245 set_bau_off(); 2247 pr_crit("UV: BAU disabled - per CPU init failed\n");
2246 nobau_perm = 1; 2248 goto err_bau_disable;
2247 return 0;
2248 } 2249 }
2249 2250
2250 vector = UV_BAU_MESSAGE; 2251 vector = UV_BAU_MESSAGE;
@@ -2270,6 +2271,16 @@ static int __init uv_bau_init(void)
2270 } 2271 }
2271 2272
2272 return 0; 2273 return 0;
2274
2275err_bau_disable:
2276
2277 for_each_possible_cpu(cur_cpu)
2278 free_cpumask_var(per_cpu(uv_flush_tlb_mask, cur_cpu));
2279
2280 set_bau_off();
2281 nobau_perm = 1;
2282
2283 return -EINVAL;
2273} 2284}
2274core_initcall(uv_bau_init); 2285core_initcall(uv_bau_init);
2275fs_initcall(uv_ptc_init); 2286fs_initcall(uv_ptc_init);