Commit 4ec9f7a1 authored by Linus Torvalds's avatar Linus Torvalds

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()
parents e234b4a8 db15e7f2
...@@ -348,6 +348,7 @@ config X86_DEBUG_FPU ...@@ -348,6 +348,7 @@ config X86_DEBUG_FPU
config PUNIT_ATOM_DEBUG config PUNIT_ATOM_DEBUG
tristate "ATOM Punit debug driver" tristate "ATOM Punit debug driver"
depends on PCI
select DEBUG_FS select DEBUG_FS
select IOSF_MBI select IOSF_MBI
---help--- ---help---
......
...@@ -73,12 +73,13 @@ UBSAN_SANITIZE := n ...@@ -73,12 +73,13 @@ UBSAN_SANITIZE := n
$(obj)/bzImage: asflags-y := $(SVGA_MODE) $(obj)/bzImage: asflags-y := $(SVGA_MODE)
quiet_cmd_image = BUILD $@ quiet_cmd_image = BUILD $@
silent_redirect_image = >/dev/null
cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \ cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
$(obj)/zoffset.h $@ $(obj)/zoffset.h $@ $($(quiet)redirect_image)
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
$(call if_changed,image) $(call if_changed,image)
@echo 'Kernel: $@ is ready' ' (#'`cat .version`')' @$(kecho) 'Kernel: $@ is ready' ' (#'`cat .version`')'
OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note -R .comment -S OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note -R .comment -S
$(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
......
# CONFIG_64BIT is not set # CONFIG_64BIT is not set
CONFIG_EXPERIMENTAL=y
# CONFIG_LOCALVERSION_AUTO is not set # CONFIG_LOCALVERSION_AUTO is not set
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
...@@ -125,7 +124,6 @@ CONFIG_NF_CONNTRACK_IPV4=y ...@@ -125,7 +124,6 @@ CONFIG_NF_CONNTRACK_IPV4=y
CONFIG_IP_NF_IPTABLES=y CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_FILTER=y CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_REJECT=y CONFIG_IP_NF_TARGET_REJECT=y
CONFIG_IP_NF_TARGET_ULOG=y
CONFIG_NF_NAT=y CONFIG_NF_NAT=y
CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_MANGLE=y CONFIG_IP_NF_MANGLE=y
...@@ -255,7 +253,6 @@ CONFIG_USB_OHCI_HCD=y ...@@ -255,7 +253,6 @@ CONFIG_USB_OHCI_HCD=y
CONFIG_USB_UHCI_HCD=y CONFIG_USB_UHCI_HCD=y
CONFIG_USB_PRINTER=y CONFIG_USB_PRINTER=y
CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE=y
CONFIG_USB_LIBUSUAL=y
CONFIG_EDAC=y CONFIG_EDAC=y
CONFIG_RTC_CLASS=y CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set # CONFIG_RTC_HCTOSYS is not set
......
CONFIG_EXPERIMENTAL=y
# CONFIG_LOCALVERSION_AUTO is not set # CONFIG_LOCALVERSION_AUTO is not set
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
...@@ -124,7 +123,6 @@ CONFIG_NF_CONNTRACK_IPV4=y ...@@ -124,7 +123,6 @@ CONFIG_NF_CONNTRACK_IPV4=y
CONFIG_IP_NF_IPTABLES=y CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_FILTER=y CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_REJECT=y CONFIG_IP_NF_TARGET_REJECT=y
CONFIG_IP_NF_TARGET_ULOG=y
CONFIG_NF_NAT=y CONFIG_NF_NAT=y
CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_MANGLE=y CONFIG_IP_NF_MANGLE=y
...@@ -251,7 +249,6 @@ CONFIG_USB_OHCI_HCD=y ...@@ -251,7 +249,6 @@ CONFIG_USB_OHCI_HCD=y
CONFIG_USB_UHCI_HCD=y CONFIG_USB_UHCI_HCD=y
CONFIG_USB_PRINTER=y CONFIG_USB_PRINTER=y
CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE=y
CONFIG_USB_LIBUSUAL=y
CONFIG_EDAC=y CONFIG_EDAC=y
CONFIG_RTC_CLASS=y CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set # CONFIG_RTC_HCTOSYS is not set
......
...@@ -191,8 +191,8 @@ static void release_pmc_hardware(void) {} ...@@ -191,8 +191,8 @@ static void release_pmc_hardware(void) {}
static bool check_hw_exists(void) static bool check_hw_exists(void)
{ {
u64 val, val_fail, val_new= ~0; u64 val, val_fail = -1, val_new= ~0;
int i, reg, reg_fail, ret = 0; int i, reg, reg_fail = -1, ret = 0;
int bios_fail = 0; int bios_fail = 0;
int reg_safe = -1; int reg_safe = -1;
......
...@@ -328,13 +328,13 @@ static inline unsigned type in##bwl##_p(int port) \ ...@@ -328,13 +328,13 @@ static inline unsigned type in##bwl##_p(int port) \
static inline void outs##bwl(int port, const void *addr, unsigned long count) \ static inline void outs##bwl(int port, const void *addr, unsigned long count) \
{ \ { \
asm volatile("rep; outs" #bwl \ asm volatile("rep; outs" #bwl \
: "+S"(addr), "+c"(count) : "d"(port)); \ : "+S"(addr), "+c"(count) : "d"(port) : "memory"); \
} \ } \
\ \
static inline void ins##bwl(int port, void *addr, unsigned long count) \ static inline void ins##bwl(int port, void *addr, unsigned long count) \
{ \ { \
asm volatile("rep; ins" #bwl \ asm volatile("rep; ins" #bwl \
: "+D"(addr), "+c"(count) : "d"(port)); \ : "+D"(addr), "+c"(count) : "d"(port) : "memory"); \
} }
BUILDIO(b, b, char) BUILDIO(b, b, char)
......
...@@ -293,7 +293,7 @@ static inline unsigned long __get_current_cr3_fast(void) ...@@ -293,7 +293,7 @@ static inline unsigned long __get_current_cr3_fast(void)
unsigned long cr3 = __pa(this_cpu_read(cpu_tlbstate.loaded_mm)->pgd); unsigned long cr3 = __pa(this_cpu_read(cpu_tlbstate.loaded_mm)->pgd);
/* For now, be very restrictive about when this can be called. */ /* For now, be very restrictive about when this can be called. */
VM_WARN_ON(in_nmi() || !in_atomic()); VM_WARN_ON(in_nmi() || preemptible());
VM_BUG_ON(cr3 != __read_cr3()); VM_BUG_ON(cr3 != __read_cr3());
return cr3; return cr3;
......
...@@ -346,6 +346,14 @@ static void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, ...@@ -346,6 +346,14 @@ static void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
int pin; int pin;
struct mpc_intsrc mp_irq; struct mpc_intsrc mp_irq;
/*
* Check bus_irq boundary.
*/
if (bus_irq >= NR_IRQS_LEGACY) {
pr_warn("Invalid bus_irq %u for legacy override\n", bus_irq);
return;
}
/* /*
* Convert 'gsi' to 'ioapic.pin'. * Convert 'gsi' to 'ioapic.pin'.
*/ */
......
...@@ -2093,7 +2093,7 @@ static inline void __init check_timer(void) ...@@ -2093,7 +2093,7 @@ static inline void __init check_timer(void)
int idx; int idx;
idx = find_irq_entry(apic1, pin1, mp_INT); idx = find_irq_entry(apic1, pin1, mp_INT);
if (idx != -1 && irq_trigger(idx)) if (idx != -1 && irq_trigger(idx))
unmask_ioapic_irq(irq_get_chip_data(0)); unmask_ioapic_irq(irq_get_irq_data(0));
} }
irq_domain_deactivate_irq(irq_data); irq_domain_deactivate_irq(irq_data);
irq_domain_activate_irq(irq_data); irq_domain_activate_irq(irq_data);
......
...@@ -134,6 +134,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c) ...@@ -134,6 +134,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
n = K6_BUG_LOOP; n = K6_BUG_LOOP;
f_vide = vide; f_vide = vide;
OPTIMIZER_HIDE_VAR(f_vide);
d = rdtsc(); d = rdtsc();
while (n--) while (n--)
f_vide(); f_vide();
......
...@@ -235,8 +235,7 @@ static void __init dtb_add_ioapic(struct device_node *dn) ...@@ -235,8 +235,7 @@ static void __init dtb_add_ioapic(struct device_node *dn)
ret = of_address_to_resource(dn, 0, &r); ret = of_address_to_resource(dn, 0, &r);
if (ret) { if (ret) {
printk(KERN_ERR "Can't obtain address from node %s.\n", printk(KERN_ERR "Can't obtain address from device node %pOF.\n", dn);
dn->full_name);
return; return;
} }
mp_register_ioapic(++ioapic_id, r.start, gsi_top, &cfg); mp_register_ioapic(++ioapic_id, r.start, gsi_top, &cfg);
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#DEBUG = -DDEBUGGING #DEBUG = -DDEBUGGING
DEBUG = DEBUG =
PARANOID = -DPARANOID PARANOID = -DPARANOID
EXTRA_CFLAGS := $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION) ccflags-y += $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION)
EXTRA_AFLAGS := $(PARANOID) asflags-y += $(PARANOID)
# From 'C' language sources: # From 'C' language sources:
C_OBJS =fpu_entry.o errors.o \ C_OBJS =fpu_entry.o errors.o \
......
...@@ -157,7 +157,7 @@ extern u_char const data_sizes_16[32]; ...@@ -157,7 +157,7 @@ extern u_char const data_sizes_16[32];
#define signbyte(a) (((u_char *)(a))[9]) #define signbyte(a) (((u_char *)(a))[9])
#define getsign(a) (signbyte(a) & 0x80) #define getsign(a) (signbyte(a) & 0x80)
#define setsign(a,b) { if (b) signbyte(a) |= 0x80; else signbyte(a) &= 0x7f; } #define setsign(a,b) { if ((b) != 0) signbyte(a) |= 0x80; else signbyte(a) &= 0x7f; }
#define copysign(a,b) { if (getsign(a)) signbyte(b) |= 0x80; \ #define copysign(a,b) { if (getsign(a)) signbyte(b) |= 0x80; \
else signbyte(b) &= 0x7f; } else signbyte(b) &= 0x7f; }
#define changesign(a) { signbyte(a) ^= 0x80; } #define changesign(a) { signbyte(a) ^= 0x80; }
......
...@@ -168,7 +168,7 @@ static int compare(FPU_REG const *b, int tagb) ...@@ -168,7 +168,7 @@ static int compare(FPU_REG const *b, int tagb)
/* This function requires that st(0) is not empty */ /* This function requires that st(0) is not empty */
int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag) int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag)
{ {
int f = 0, c; int f, c;
c = compare(loaded_data, loaded_tag); c = compare(loaded_data, loaded_tag);
...@@ -189,12 +189,12 @@ int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag) ...@@ -189,12 +189,12 @@ int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag)
case COMP_No_Comp: case COMP_No_Comp:
f = SW_C3 | SW_C2 | SW_C0; f = SW_C3 | SW_C2 | SW_C0;
break; break;
#ifdef PARANOID
default: default:
#ifdef PARANOID
EXCEPTION(EX_INTERNAL | 0x121); EXCEPTION(EX_INTERNAL | 0x121);
#endif /* PARANOID */
f = SW_C3 | SW_C2 | SW_C0; f = SW_C3 | SW_C2 | SW_C0;
break; break;
#endif /* PARANOID */
} }
setcc(f); setcc(f);
if (c & COMP_Denormal) { if (c & COMP_Denormal) {
...@@ -205,7 +205,7 @@ int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag) ...@@ -205,7 +205,7 @@ int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag)
static int compare_st_st(int nr) static int compare_st_st(int nr)
{ {
int f = 0, c; int f, c;
FPU_REG *st_ptr; FPU_REG *st_ptr;
if (!NOT_EMPTY(0) || !NOT_EMPTY(nr)) { if (!NOT_EMPTY(0) || !NOT_EMPTY(nr)) {
...@@ -235,12 +235,12 @@ static int compare_st_st(int nr) ...@@ -235,12 +235,12 @@ static int compare_st_st(int nr)
case COMP_No_Comp: case COMP_No_Comp:
f = SW_C3 | SW_C2 | SW_C0; f = SW_C3 | SW_C2 | SW_C0;
break; break;
#ifdef PARANOID
default: default:
#ifdef PARANOID
EXCEPTION(EX_INTERNAL | 0x122); EXCEPTION(EX_INTERNAL | 0x122);
#endif /* PARANOID */
f = SW_C3 | SW_C2 | SW_C0; f = SW_C3 | SW_C2 | SW_C0;
break; break;
#endif /* PARANOID */
} }
setcc(f); setcc(f);
if (c & COMP_Denormal) { if (c & COMP_Denormal) {
...@@ -283,12 +283,12 @@ static int compare_i_st_st(int nr) ...@@ -283,12 +283,12 @@ static int compare_i_st_st(int nr)
case COMP_No_Comp: case COMP_No_Comp:
f = X86_EFLAGS_ZF | X86_EFLAGS_PF | X86_EFLAGS_CF; f = X86_EFLAGS_ZF | X86_EFLAGS_PF | X86_EFLAGS_CF;
break; break;
#ifdef PARANOID
default: default:
#ifdef PARANOID
EXCEPTION(EX_INTERNAL | 0x122); EXCEPTION(EX_INTERNAL | 0x122);
#endif /* PARANOID */
f = 0; f = 0;
break; break;
#endif /* PARANOID */
} }
FPU_EFLAGS = (FPU_EFLAGS & ~(X86_EFLAGS_ZF | X86_EFLAGS_PF | X86_EFLAGS_CF)) | f; FPU_EFLAGS = (FPU_EFLAGS & ~(X86_EFLAGS_ZF | X86_EFLAGS_PF | X86_EFLAGS_CF)) | f;
if (c & COMP_Denormal) { if (c & COMP_Denormal) {
......
...@@ -38,8 +38,10 @@ static void __init *max7315_platform_data(void *info) ...@@ -38,8 +38,10 @@ static void __init *max7315_platform_data(void *info)
*/ */
strcpy(i2c_info->type, "max7315"); strcpy(i2c_info->type, "max7315");
if (nr++) { if (nr++) {
sprintf(base_pin_name, "max7315_%d_base", nr); snprintf(base_pin_name, sizeof(base_pin_name),
sprintf(intr_pin_name, "max7315_%d_int", nr); "max7315_%d_base", nr);
snprintf(intr_pin_name, sizeof(intr_pin_name),
"max7315_%d_int", nr);
} else { } else {
strcpy(base_pin_name, "max7315_base"); strcpy(base_pin_name, "max7315_base");
strcpy(intr_pin_name, "max7315_int"); strcpy(intr_pin_name, "max7315_int");
......
...@@ -40,7 +40,6 @@ static int timeout_base_ns[] = { ...@@ -40,7 +40,6 @@ static int timeout_base_ns[] = {
static int timeout_us; static int timeout_us;
static bool nobau = true; static bool nobau = true;
static int nobau_perm; static int nobau_perm;
static cycles_t congested_cycles;
/* tunables: */ /* tunables: */
static int max_concurr = MAX_BAU_CONCURRENT; static int max_concurr = MAX_BAU_CONCURRENT;
...@@ -829,10 +828,10 @@ static void record_send_stats(cycles_t time1, cycles_t time2, ...@@ -829,10 +828,10 @@ static void record_send_stats(cycles_t time1, cycles_t time2,
if ((completion_status == FLUSH_COMPLETE) && (try == 1)) { if ((completion_status == FLUSH_COMPLETE) && (try == 1)) {
bcp->period_requests++; bcp->period_requests++;
bcp->period_time += elapsed; bcp->period_time += elapsed;
if ((elapsed > congested_cycles) && if ((elapsed > usec_2_cycles(bcp->cong_response_us)) &&
(bcp->period_requests > bcp->cong_reps) && (bcp->period_requests > bcp->cong_reps) &&
((bcp->period_time / bcp->period_requests) > ((bcp->period_time / bcp->period_requests) >
congested_cycles)) { usec_2_cycles(bcp->cong_response_us))) {
stat->s_congested++; stat->s_congested++;
disable_for_period(bcp, stat); disable_for_period(bcp, stat);
} }
...@@ -2222,14 +2221,17 @@ static int __init uv_bau_init(void) ...@@ -2222,14 +2221,17 @@ static int __init uv_bau_init(void)
else if (is_uv1_hub()) else if (is_uv1_hub())
ops = uv1_bau_ops; ops = uv1_bau_ops;
nuvhubs = uv_num_possible_blades();
if (nuvhubs < 2) {
pr_crit("UV: BAU disabled - insufficient hub count\n");
goto err_bau_disable;
}
for_each_possible_cpu(cur_cpu) { for_each_possible_cpu(cur_cpu) {
mask = &per_cpu(uv_flush_tlb_mask, cur_cpu); mask = &per_cpu(uv_flush_tlb_mask, cur_cpu);
zalloc_cpumask_var_node(mask, GFP_KERNEL, cpu_to_node(cur_cpu)); zalloc_cpumask_var_node(mask, GFP_KERNEL, cpu_to_node(cur_cpu));
} }
nuvhubs = uv_num_possible_blades();
congested_cycles = usec_2_cycles(congested_respns_us);
uv_base_pnode = 0x7fffffff; uv_base_pnode = 0x7fffffff;
for (uvhub = 0; uvhub < nuvhubs; uvhub++) { for (uvhub = 0; uvhub < nuvhubs; uvhub++) {
cpus = uv_blade_nr_possible_cpus(uvhub); cpus = uv_blade_nr_possible_cpus(uvhub);
...@@ -2242,9 +2244,8 @@ static int __init uv_bau_init(void) ...@@ -2242,9 +2244,8 @@ static int __init uv_bau_init(void)
enable_timeouts(); enable_timeouts();
if (init_per_cpu(nuvhubs, uv_base_pnode)) { if (init_per_cpu(nuvhubs, uv_base_pnode)) {
set_bau_off(); pr_crit("UV: BAU disabled - per CPU init failed\n");
nobau_perm = 1; goto err_bau_disable;
return 0;
} }
vector = UV_BAU_MESSAGE; vector = UV_BAU_MESSAGE;
...@@ -2270,6 +2271,16 @@ static int __init uv_bau_init(void) ...@@ -2270,6 +2271,16 @@ static int __init uv_bau_init(void)
} }
return 0; return 0;
err_bau_disable:
for_each_possible_cpu(cur_cpu)
free_cpumask_var(per_cpu(uv_flush_tlb_mask, cur_cpu));
set_bau_off();
nobau_perm = 1;
return -EINVAL;
} }
core_initcall(uv_bau_init); core_initcall(uv_bau_init);
fs_initcall(uv_ptc_init); fs_initcall(uv_ptc_init);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment