diff options
Diffstat (limited to 'arch')
37 files changed, 312 insertions, 154 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index e44da40d984f..5ebb44fe826a 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile | |||
| @@ -155,6 +155,7 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \ | |||
| 155 | dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb | 155 | dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb |
| 156 | 156 | ||
| 157 | targets += dtbs | 157 | targets += dtbs |
| 158 | targets += $(dtb-y) | ||
| 158 | endif | 159 | endif |
| 159 | 160 | ||
| 160 | # *.dtb used to be generated in the directory above. Clean out the | 161 | # *.dtb used to be generated in the directory above. Clean out the |
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h index a611ad3153c7..b6132aa95dc0 100644 --- a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h +++ b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h | |||
| @@ -463,6 +463,9 @@ | |||
| 463 | GPIO76_LCD_PCLK, \ | 463 | GPIO76_LCD_PCLK, \ |
| 464 | GPIO77_LCD_BIAS | 464 | GPIO77_LCD_BIAS |
| 465 | 465 | ||
| 466 | /* these enable a work-around for a hw bug in pxa27x during ac97 warm reset */ | ||
| 467 | #define GPIO113_AC97_nRESET_GPIO_HIGH MFP_CFG_OUT(GPIO113, AF0, DEFAULT) | ||
| 468 | #define GPIO95_AC97_nRESET_GPIO_HIGH MFP_CFG_OUT(GPIO95, AF0, DEFAULT) | ||
| 466 | 469 | ||
| 467 | extern int keypad_set_wake(unsigned int on); | 470 | extern int keypad_set_wake(unsigned int on); |
| 468 | #endif /* __ASM_ARCH_MFP_PXA27X_H */ | 471 | #endif /* __ASM_ARCH_MFP_PXA27X_H */ |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 8047ee0effc5..616cb87b6179 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
| @@ -47,9 +47,9 @@ void pxa27x_clear_otgph(void) | |||
| 47 | EXPORT_SYMBOL(pxa27x_clear_otgph); | 47 | EXPORT_SYMBOL(pxa27x_clear_otgph); |
| 48 | 48 | ||
| 49 | static unsigned long ac97_reset_config[] = { | 49 | static unsigned long ac97_reset_config[] = { |
| 50 | GPIO113_GPIO, | 50 | GPIO113_AC97_nRESET_GPIO_HIGH, |
| 51 | GPIO113_AC97_nRESET, | 51 | GPIO113_AC97_nRESET, |
| 52 | GPIO95_GPIO, | 52 | GPIO95_AC97_nRESET_GPIO_HIGH, |
| 53 | GPIO95_AC97_nRESET, | 53 | GPIO95_AC97_nRESET, |
| 54 | }; | 54 | }; |
| 55 | 55 | ||
diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile index 801e2d7fcbc6..32ac0aef0068 100644 --- a/arch/arm64/boot/dts/Makefile +++ b/arch/arm64/boot/dts/Makefile | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | targets += dtbs | 1 | targets += dtbs |
| 2 | targets += $(dtb-y) | ||
| 2 | 3 | ||
| 3 | dtbs: $(addprefix $(obj)/, $(dtb-y)) | 4 | dtbs: $(addprefix $(obj)/, $(dtb-y)) |
| 4 | 5 | ||
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index aa03f2e13385..e70001cfa05b 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig | |||
| @@ -6,6 +6,7 @@ config MN10300 | |||
| 6 | select ARCH_WANT_IPC_PARSE_VERSION | 6 | select ARCH_WANT_IPC_PARSE_VERSION |
| 7 | select HAVE_ARCH_TRACEHOOK | 7 | select HAVE_ARCH_TRACEHOOK |
| 8 | select HAVE_ARCH_KGDB | 8 | select HAVE_ARCH_KGDB |
| 9 | select GENERIC_ATOMIC64 | ||
| 9 | select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER | 10 | select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER |
| 10 | select GENERIC_CLOCKEVENTS | 11 | select GENERIC_CLOCKEVENTS |
| 11 | select MODULES_USE_ELF_RELA | 12 | select MODULES_USE_ELF_RELA |
diff --git a/arch/powerpc/include/uapi/asm/kvm_para.h b/arch/powerpc/include/uapi/asm/kvm_para.h index ed0e0254b47f..e3af3286a068 100644 --- a/arch/powerpc/include/uapi/asm/kvm_para.h +++ b/arch/powerpc/include/uapi/asm/kvm_para.h | |||
| @@ -78,7 +78,7 @@ struct kvm_vcpu_arch_shared { | |||
| 78 | 78 | ||
| 79 | #define KVM_HCALL_TOKEN(num) _EV_HCALL_TOKEN(EV_KVM_VENDOR_ID, num) | 79 | #define KVM_HCALL_TOKEN(num) _EV_HCALL_TOKEN(EV_KVM_VENDOR_ID, num) |
| 80 | 80 | ||
| 81 | #include <uapi/asm/epapr_hcalls.h> | 81 | #include <asm/epapr_hcalls.h> |
| 82 | 82 | ||
| 83 | #define KVM_FEATURE_MAGIC_PAGE 1 | 83 | #define KVM_FEATURE_MAGIC_PAGE 1 |
| 84 | 84 | ||
diff --git a/arch/powerpc/kvm/book3s_hv_ras.c b/arch/powerpc/kvm/book3s_hv_ras.c index 35f3cf0269b3..a353c485808c 100644 --- a/arch/powerpc/kvm/book3s_hv_ras.c +++ b/arch/powerpc/kvm/book3s_hv_ras.c | |||
| @@ -79,7 +79,9 @@ static void flush_tlb_power7(struct kvm_vcpu *vcpu) | |||
| 79 | static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu) | 79 | static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu) |
| 80 | { | 80 | { |
| 81 | unsigned long srr1 = vcpu->arch.shregs.msr; | 81 | unsigned long srr1 = vcpu->arch.shregs.msr; |
| 82 | #ifdef CONFIG_PPC_POWERNV | ||
| 82 | struct opal_machine_check_event *opal_evt; | 83 | struct opal_machine_check_event *opal_evt; |
| 84 | #endif | ||
| 83 | long handled = 1; | 85 | long handled = 1; |
| 84 | 86 | ||
| 85 | if (srr1 & SRR1_MC_LDSTERR) { | 87 | if (srr1 & SRR1_MC_LDSTERR) { |
| @@ -117,6 +119,7 @@ static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu) | |||
| 117 | handled = 0; | 119 | handled = 0; |
| 118 | } | 120 | } |
| 119 | 121 | ||
| 122 | #ifdef CONFIG_PPC_POWERNV | ||
| 120 | /* | 123 | /* |
| 121 | * See if OPAL has already handled the condition. | 124 | * See if OPAL has already handled the condition. |
| 122 | * We assume that if the condition is recovered then OPAL | 125 | * We assume that if the condition is recovered then OPAL |
| @@ -131,6 +134,7 @@ static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu) | |||
| 131 | 134 | ||
| 132 | if (handled) | 135 | if (handled) |
| 133 | opal_evt->in_use = 0; | 136 | opal_evt->in_use = 0; |
| 137 | #endif | ||
| 134 | 138 | ||
| 135 | return handled; | 139 | return handled; |
| 136 | } | 140 | } |
diff --git a/arch/s390/include/asm/dma.h b/arch/s390/include/asm/dma.h index de015d85e3e5..bb9bdcd20864 100644 --- a/arch/s390/include/asm/dma.h +++ b/arch/s390/include/asm/dma.h | |||
| @@ -10,4 +10,10 @@ | |||
| 10 | */ | 10 | */ |
| 11 | #define MAX_DMA_ADDRESS 0x80000000 | 11 | #define MAX_DMA_ADDRESS 0x80000000 |
| 12 | 12 | ||
| 13 | #ifdef CONFIG_PCI | ||
| 14 | extern int isa_dma_bridge_buggy; | ||
| 15 | #else | ||
| 16 | #define isa_dma_bridge_buggy (0) | ||
| 17 | #endif | ||
| 18 | |||
| 13 | #endif /* _ASM_S390_DMA_H */ | 19 | #endif /* _ASM_S390_DMA_H */ |
diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h index 16c3eb164f4f..27cb32185ce1 100644 --- a/arch/s390/include/asm/io.h +++ b/arch/s390/include/asm/io.h | |||
| @@ -85,6 +85,11 @@ static inline void iounmap(volatile void __iomem *addr) | |||
| 85 | #define __raw_writel zpci_write_u32 | 85 | #define __raw_writel zpci_write_u32 |
| 86 | #define __raw_writeq zpci_write_u64 | 86 | #define __raw_writeq zpci_write_u64 |
| 87 | 87 | ||
| 88 | #define readb_relaxed readb | ||
| 89 | #define readw_relaxed readw | ||
| 90 | #define readl_relaxed readl | ||
| 91 | #define readq_relaxed readq | ||
| 92 | |||
| 88 | #endif /* CONFIG_PCI */ | 93 | #endif /* CONFIG_PCI */ |
| 89 | 94 | ||
| 90 | #include <asm-generic/io.h> | 95 | #include <asm-generic/io.h> |
diff --git a/arch/s390/include/asm/irq.h b/arch/s390/include/asm/irq.h index e6972f85d2b0..7def77302d63 100644 --- a/arch/s390/include/asm/irq.h +++ b/arch/s390/include/asm/irq.h | |||
| @@ -2,43 +2,61 @@ | |||
| 2 | #define _ASM_IRQ_H | 2 | #define _ASM_IRQ_H |
| 3 | 3 | ||
| 4 | #include <linux/hardirq.h> | 4 | #include <linux/hardirq.h> |
| 5 | #include <linux/percpu.h> | ||
| 6 | #include <linux/cache.h> | ||
| 5 | #include <linux/types.h> | 7 | #include <linux/types.h> |
| 6 | 8 | ||
| 7 | enum interruption_class { | 9 | enum interruption_main_class { |
| 8 | EXTERNAL_INTERRUPT, | 10 | EXTERNAL_INTERRUPT, |
| 9 | IO_INTERRUPT, | 11 | IO_INTERRUPT, |
| 10 | EXTINT_CLK, | 12 | NR_IRQS |
| 11 | EXTINT_EXC, | 13 | }; |
| 12 | EXTINT_EMS, | 14 | |
| 13 | EXTINT_TMR, | 15 | enum interruption_class { |
| 14 | EXTINT_TLA, | 16 | IRQEXT_CLK, |
| 15 | EXTINT_PFL, | 17 | IRQEXT_EXC, |
| 16 | EXTINT_DSD, | 18 | IRQEXT_EMS, |
| 17 | EXTINT_VRT, | 19 | IRQEXT_TMR, |
| 18 | EXTINT_SCP, | 20 | IRQEXT_TLA, |
| 19 | EXTINT_IUC, | 21 | IRQEXT_PFL, |
| 20 | EXTINT_CMS, | 22 | IRQEXT_DSD, |
| 21 | EXTINT_CMC, | 23 | IRQEXT_VRT, |
| 22 | EXTINT_CMR, | 24 | IRQEXT_SCP, |
| 23 | IOINT_CIO, | 25 | IRQEXT_IUC, |
| 24 | IOINT_QAI, | 26 | IRQEXT_CMS, |
| 25 | IOINT_DAS, | 27 | IRQEXT_CMC, |
| 26 | IOINT_C15, | 28 | IRQEXT_CMR, |
| 27 | IOINT_C70, | 29 | IRQIO_CIO, |
| 28 | IOINT_TAP, | 30 | IRQIO_QAI, |
| 29 | IOINT_VMR, | 31 | IRQIO_DAS, |
| 30 | IOINT_LCS, | 32 | IRQIO_C15, |
| 31 | IOINT_CLW, | 33 | IRQIO_C70, |
| 32 | IOINT_CTC, | 34 | IRQIO_TAP, |
| 33 | IOINT_APB, | 35 | IRQIO_VMR, |
| 34 | IOINT_ADM, | 36 | IRQIO_LCS, |
| 35 | IOINT_CSC, | 37 | IRQIO_CLW, |
| 36 | IOINT_PCI, | 38 | IRQIO_CTC, |
| 37 | IOINT_MSI, | 39 | IRQIO_APB, |
| 40 | IRQIO_ADM, | ||
| 41 | IRQIO_CSC, | ||
| 42 | IRQIO_PCI, | ||
| 43 | IRQIO_MSI, | ||
| 38 | NMI_NMI, | 44 | NMI_NMI, |
| 39 | NR_IRQS, | 45 | CPU_RST, |
| 46 | NR_ARCH_IRQS | ||
| 40 | }; | 47 | }; |
| 41 | 48 | ||
| 49 | struct irq_stat { | ||
| 50 | unsigned int irqs[NR_ARCH_IRQS]; | ||
| 51 | }; | ||
| 52 | |||
| 53 | DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat); | ||
| 54 | |||
| 55 | static __always_inline void inc_irq_stat(enum interruption_class irq) | ||
| 56 | { | ||
| 57 | __get_cpu_var(irq_stat).irqs[irq]++; | ||
| 58 | } | ||
| 59 | |||
| 42 | struct ext_code { | 60 | struct ext_code { |
| 43 | unsigned short subcode; | 61 | unsigned short subcode; |
| 44 | unsigned short code; | 62 | unsigned short code; |
diff --git a/arch/s390/include/uapi/asm/unistd.h b/arch/s390/include/uapi/asm/unistd.h index 63e6078699f1..864f693c237f 100644 --- a/arch/s390/include/uapi/asm/unistd.h +++ b/arch/s390/include/uapi/asm/unistd.h | |||
| @@ -279,7 +279,8 @@ | |||
| 279 | #define __NR_process_vm_writev 341 | 279 | #define __NR_process_vm_writev 341 |
| 280 | #define __NR_s390_runtime_instr 342 | 280 | #define __NR_s390_runtime_instr 342 |
| 281 | #define __NR_kcmp 343 | 281 | #define __NR_kcmp 343 |
| 282 | #define NR_syscalls 344 | 282 | #define __NR_finit_module 344 |
| 283 | #define NR_syscalls 345 | ||
| 283 | 284 | ||
| 284 | /* | 285 | /* |
| 285 | * There are some system calls that are not present on 64 bit, some | 286 | * There are some system calls that are not present on 64 bit, some |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 827e094a2f49..9b9a805656b5 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
| @@ -1659,3 +1659,9 @@ ENTRY(sys_kcmp_wrapper) | |||
| 1659 | llgfr %r5,%r5 # unsigned long | 1659 | llgfr %r5,%r5 # unsigned long |
| 1660 | llgfr %r6,%r6 # unsigned long | 1660 | llgfr %r6,%r6 # unsigned long |
| 1661 | jg sys_kcmp | 1661 | jg sys_kcmp |
| 1662 | |||
| 1663 | ENTRY(sys_finit_module_wrapper) | ||
| 1664 | lgfr %r2,%r2 # int | ||
| 1665 | llgtr %r3,%r3 # const char __user * | ||
| 1666 | lgfr %r4,%r4 # int | ||
| 1667 | jg sys_finit_module | ||
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index ba500d8dc392..4e8215e0d4b6 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c | |||
| @@ -1127,13 +1127,14 @@ debug_register_view(debug_info_t * id, struct debug_view *view) | |||
| 1127 | if (i == DEBUG_MAX_VIEWS) { | 1127 | if (i == DEBUG_MAX_VIEWS) { |
| 1128 | pr_err("Registering view %s/%s would exceed the maximum " | 1128 | pr_err("Registering view %s/%s would exceed the maximum " |
| 1129 | "number of views %i\n", id->name, view->name, i); | 1129 | "number of views %i\n", id->name, view->name, i); |
| 1130 | debugfs_remove(pde); | ||
| 1131 | rc = -1; | 1130 | rc = -1; |
| 1132 | } else { | 1131 | } else { |
| 1133 | id->views[i] = view; | 1132 | id->views[i] = view; |
| 1134 | id->debugfs_entries[i] = pde; | 1133 | id->debugfs_entries[i] = pde; |
| 1135 | } | 1134 | } |
| 1136 | spin_unlock_irqrestore(&id->lock, flags); | 1135 | spin_unlock_irqrestore(&id->lock, flags); |
| 1136 | if (rc) | ||
| 1137 | debugfs_remove(pde); | ||
| 1137 | out: | 1138 | out: |
| 1138 | return rc; | 1139 | return rc; |
| 1139 | } | 1140 | } |
| @@ -1146,9 +1147,9 @@ EXPORT_SYMBOL(debug_register_view); | |||
| 1146 | int | 1147 | int |
| 1147 | debug_unregister_view(debug_info_t * id, struct debug_view *view) | 1148 | debug_unregister_view(debug_info_t * id, struct debug_view *view) |
| 1148 | { | 1149 | { |
| 1149 | int rc = 0; | 1150 | struct dentry *dentry = NULL; |
| 1150 | int i; | ||
| 1151 | unsigned long flags; | 1151 | unsigned long flags; |
| 1152 | int i, rc = 0; | ||
| 1152 | 1153 | ||
| 1153 | if (!id) | 1154 | if (!id) |
| 1154 | goto out; | 1155 | goto out; |
| @@ -1160,10 +1161,12 @@ debug_unregister_view(debug_info_t * id, struct debug_view *view) | |||
| 1160 | if (i == DEBUG_MAX_VIEWS) | 1161 | if (i == DEBUG_MAX_VIEWS) |
| 1161 | rc = -1; | 1162 | rc = -1; |
| 1162 | else { | 1163 | else { |
| 1163 | debugfs_remove(id->debugfs_entries[i]); | 1164 | dentry = id->debugfs_entries[i]; |
| 1164 | id->views[i] = NULL; | 1165 | id->views[i] = NULL; |
| 1166 | id->debugfs_entries[i] = NULL; | ||
| 1165 | } | 1167 | } |
| 1166 | spin_unlock_irqrestore(&id->lock, flags); | 1168 | spin_unlock_irqrestore(&id->lock, flags); |
| 1169 | debugfs_remove(dentry); | ||
| 1167 | out: | 1170 | out: |
| 1168 | return rc; | 1171 | return rc; |
| 1169 | } | 1172 | } |
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index bf24293970ce..9df824ea1667 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c | |||
| @@ -24,43 +24,65 @@ | |||
| 24 | #include <asm/irq.h> | 24 | #include <asm/irq.h> |
| 25 | #include "entry.h" | 25 | #include "entry.h" |
| 26 | 26 | ||
| 27 | DEFINE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat); | ||
| 28 | EXPORT_PER_CPU_SYMBOL_GPL(irq_stat); | ||
| 29 | |||
| 27 | struct irq_class { | 30 | struct irq_class { |
| 28 | char *name; | 31 | char *name; |
| 29 | char *desc; | 32 | char *desc; |
| 30 | }; | 33 | }; |
| 31 | 34 | ||
| 32 | static const struct irq_class intrclass_names[] = { | 35 | /* |
| 36 | * The list of "main" irq classes on s390. This is the list of interrrupts | ||
| 37 | * that appear both in /proc/stat ("intr" line) and /proc/interrupts. | ||
| 38 | * Historically only external and I/O interrupts have been part of /proc/stat. | ||
| 39 | * We can't add the split external and I/O sub classes since the first field | ||
| 40 | * in the "intr" line in /proc/stat is supposed to be the sum of all other | ||
| 41 | * fields. | ||
| 42 | * Since the external and I/O interrupt fields are already sums we would end | ||
| 43 | * up with having a sum which accounts each interrupt twice. | ||
| 44 | */ | ||
| 45 | static const struct irq_class irqclass_main_desc[NR_IRQS] = { | ||
| 33 | [EXTERNAL_INTERRUPT] = {.name = "EXT"}, | 46 | [EXTERNAL_INTERRUPT] = {.name = "EXT"}, |
| 34 | [IO_INTERRUPT] = {.name = "I/O"}, | 47 | [IO_INTERRUPT] = {.name = "I/O"} |
| 35 | [EXTINT_CLK] = {.name = "CLK", .desc = "[EXT] Clock Comparator"}, | 48 | }; |
| 36 | [EXTINT_EXC] = {.name = "EXC", .desc = "[EXT] External Call"}, | 49 | |
| 37 | [EXTINT_EMS] = {.name = "EMS", .desc = "[EXT] Emergency Signal"}, | 50 | /* |
| 38 | [EXTINT_TMR] = {.name = "TMR", .desc = "[EXT] CPU Timer"}, | 51 | * The list of split external and I/O interrupts that appear only in |
| 39 | [EXTINT_TLA] = {.name = "TAL", .desc = "[EXT] Timing Alert"}, | 52 | * /proc/interrupts. |
| 40 | [EXTINT_PFL] = {.name = "PFL", .desc = "[EXT] Pseudo Page Fault"}, | 53 | * In addition this list contains non external / I/O events like NMIs. |
| 41 | [EXTINT_DSD] = {.name = "DSD", .desc = "[EXT] DASD Diag"}, | 54 | */ |
| 42 | [EXTINT_VRT] = {.name = "VRT", .desc = "[EXT] Virtio"}, | 55 | static const struct irq_class irqclass_sub_desc[NR_ARCH_IRQS] = { |
| 43 | [EXTINT_SCP] = {.name = "SCP", .desc = "[EXT] Service Call"}, | 56 | [IRQEXT_CLK] = {.name = "CLK", .desc = "[EXT] Clock Comparator"}, |
| 44 | [EXTINT_IUC] = {.name = "IUC", .desc = "[EXT] IUCV"}, | 57 | [IRQEXT_EXC] = {.name = "EXC", .desc = "[EXT] External Call"}, |
| 45 | [EXTINT_CMS] = {.name = "CMS", .desc = "[EXT] CPU-Measurement: Sampling"}, | 58 | [IRQEXT_EMS] = {.name = "EMS", .desc = "[EXT] Emergency Signal"}, |
| 46 | [EXTINT_CMC] = {.name = "CMC", .desc = "[EXT] CPU-Measurement: Counter"}, | 59 | [IRQEXT_TMR] = {.name = "TMR", .desc = "[EXT] CPU Timer"}, |
| 47 | [EXTINT_CMR] = {.name = "CMR", .desc = "[EXT] CPU-Measurement: RI"}, | 60 | [IRQEXT_TLA] = {.name = "TAL", .desc = "[EXT] Timing Alert"}, |
| 48 | [IOINT_CIO] = {.name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt"}, | 61 | [IRQEXT_PFL] = {.name = "PFL", .desc = "[EXT] Pseudo Page Fault"}, |
| 49 | [IOINT_QAI] = {.name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt"}, | 62 | [IRQEXT_DSD] = {.name = "DSD", .desc = "[EXT] DASD Diag"}, |
| 50 | [IOINT_DAS] = {.name = "DAS", .desc = "[I/O] DASD"}, | 63 | [IRQEXT_VRT] = {.name = "VRT", .desc = "[EXT] Virtio"}, |
| 51 | [IOINT_C15] = {.name = "C15", .desc = "[I/O] 3215"}, | 64 | [IRQEXT_SCP] = {.name = "SCP", .desc = "[EXT] Service Call"}, |
| 52 | [IOINT_C70] = {.name = "C70", .desc = "[I/O] 3270"}, | 65 | [IRQEXT_IUC] = {.name = "IUC", .desc = "[EXT] IUCV"}, |
| 53 | [IOINT_TAP] = {.name = "TAP", .desc = "[I/O] Tape"}, | 66 | [IRQEXT_CMS] = {.name = "CMS", .desc = "[EXT] CPU-Measurement: Sampling"}, |
| 54 | [IOINT_VMR] = {.name = "VMR", .desc = "[I/O] Unit Record Devices"}, | 67 | [IRQEXT_CMC] = {.name = "CMC", .desc = "[EXT] CPU-Measurement: Counter"}, |
| 55 | [IOINT_LCS] = {.name = "LCS", .desc = "[I/O] LCS"}, | 68 | [IRQEXT_CMR] = {.name = "CMR", .desc = "[EXT] CPU-Measurement: RI"}, |
| 56 | [IOINT_CLW] = {.name = "CLW", .desc = "[I/O] CLAW"}, | 69 | [IRQIO_CIO] = {.name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt"}, |
| 57 | [IOINT_CTC] = {.name = "CTC", .desc = "[I/O] CTC"}, | 70 | [IRQIO_QAI] = {.name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt"}, |
| 58 | [IOINT_APB] = {.name = "APB", .desc = "[I/O] AP Bus"}, | 71 | [IRQIO_DAS] = {.name = "DAS", .desc = "[I/O] DASD"}, |
| 59 | [IOINT_ADM] = {.name = "ADM", .desc = "[I/O] EADM Subchannel"}, | 72 | [IRQIO_C15] = {.name = "C15", .desc = "[I/O] 3215"}, |
| 60 | [IOINT_CSC] = {.name = "CSC", .desc = "[I/O] CHSC Subchannel"}, | 73 | [IRQIO_C70] = {.name = "C70", .desc = "[I/O] 3270"}, |
| 61 | [IOINT_PCI] = {.name = "PCI", .desc = "[I/O] PCI Interrupt" }, | 74 | [IRQIO_TAP] = {.name = "TAP", .desc = "[I/O] Tape"}, |
| 62 | [IOINT_MSI] = {.name = "MSI", .desc = "[I/O] MSI Interrupt" }, | 75 | [IRQIO_VMR] = {.name = "VMR", .desc = "[I/O] Unit Record Devices"}, |
| 76 | [IRQIO_LCS] = {.name = "LCS", .desc = "[I/O] LCS"}, | ||
| 77 | [IRQIO_CLW] = {.name = "CLW", .desc = "[I/O] CLAW"}, | ||
| 78 | [IRQIO_CTC] = {.name = "CTC", .desc = "[I/O] CTC"}, | ||
| 79 | [IRQIO_APB] = {.name = "APB", .desc = "[I/O] AP Bus"}, | ||
| 80 | [IRQIO_ADM] = {.name = "ADM", .desc = "[I/O] EADM Subchannel"}, | ||
| 81 | [IRQIO_CSC] = {.name = "CSC", .desc = "[I/O] CHSC Subchannel"}, | ||
| 82 | [IRQIO_PCI] = {.name = "PCI", .desc = "[I/O] PCI Interrupt" }, | ||
| 83 | [IRQIO_MSI] = {.name = "MSI", .desc = "[I/O] MSI Interrupt" }, | ||
| 63 | [NMI_NMI] = {.name = "NMI", .desc = "[NMI] Machine Check"}, | 84 | [NMI_NMI] = {.name = "NMI", .desc = "[NMI] Machine Check"}, |
| 85 | [CPU_RST] = {.name = "RST", .desc = "[CPU] CPU Restart"}, | ||
| 64 | }; | 86 | }; |
| 65 | 87 | ||
| 66 | /* | 88 | /* |
| @@ -68,30 +90,34 @@ static const struct irq_class intrclass_names[] = { | |||
| 68 | */ | 90 | */ |
| 69 | int show_interrupts(struct seq_file *p, void *v) | 91 | int show_interrupts(struct seq_file *p, void *v) |
| 70 | { | 92 | { |
| 71 | int i = *(loff_t *) v, j; | 93 | int irq = *(loff_t *) v; |
| 94 | int cpu; | ||
| 72 | 95 | ||
| 73 | get_online_cpus(); | 96 | get_online_cpus(); |
| 74 | if (i == 0) { | 97 | if (irq == 0) { |
| 75 | seq_puts(p, " "); | 98 | seq_puts(p, " "); |
| 76 | for_each_online_cpu(j) | 99 | for_each_online_cpu(cpu) |
| 77 | seq_printf(p, "CPU%d ",j); | 100 | seq_printf(p, "CPU%d ", cpu); |
| 78 | seq_putc(p, '\n'); | 101 | seq_putc(p, '\n'); |
| 79 | } | 102 | } |
| 80 | 103 | if (irq < NR_IRQS) { | |
| 81 | if (i < NR_IRQS) { | 104 | seq_printf(p, "%s: ", irqclass_main_desc[irq].name); |
| 82 | seq_printf(p, "%s: ", intrclass_names[i].name); | 105 | for_each_online_cpu(cpu) |
| 83 | #ifndef CONFIG_SMP | 106 | seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[irq]); |
| 84 | seq_printf(p, "%10u ", kstat_irqs(i)); | 107 | seq_putc(p, '\n'); |
| 85 | #else | 108 | goto skip_arch_irqs; |
| 86 | for_each_online_cpu(j) | 109 | } |
| 87 | seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); | 110 | for (irq = 0; irq < NR_ARCH_IRQS; irq++) { |
| 88 | #endif | 111 | seq_printf(p, "%s: ", irqclass_sub_desc[irq].name); |
| 89 | if (intrclass_names[i].desc) | 112 | for_each_online_cpu(cpu) |
| 90 | seq_printf(p, " %s", intrclass_names[i].desc); | 113 | seq_printf(p, "%10u ", per_cpu(irq_stat, cpu).irqs[irq]); |
| 91 | seq_putc(p, '\n'); | 114 | if (irqclass_sub_desc[irq].desc) |
| 92 | } | 115 | seq_printf(p, " %s", irqclass_sub_desc[irq].desc); |
| 116 | seq_putc(p, '\n'); | ||
| 117 | } | ||
| 118 | skip_arch_irqs: | ||
| 93 | put_online_cpus(); | 119 | put_online_cpus(); |
| 94 | return 0; | 120 | return 0; |
| 95 | } | 121 | } |
| 96 | 122 | ||
| 97 | /* | 123 | /* |
| @@ -222,7 +248,7 @@ void __irq_entry do_extint(struct pt_regs *regs, struct ext_code ext_code, | |||
| 222 | /* Serve timer interrupts first. */ | 248 | /* Serve timer interrupts first. */ |
| 223 | clock_comparator_work(); | 249 | clock_comparator_work(); |
| 224 | } | 250 | } |
| 225 | kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; | 251 | kstat_incr_irqs_this_cpu(EXTERNAL_INTERRUPT, NULL); |
| 226 | if (ext_code.code != 0x1004) | 252 | if (ext_code.code != 0x1004) |
| 227 | __get_cpu_var(s390_idle).nohz_delay = 1; | 253 | __get_cpu_var(s390_idle).nohz_delay = 1; |
| 228 | 254 | ||
diff --git a/arch/s390/kernel/nmi.c b/arch/s390/kernel/nmi.c index a6daa5c5cdb0..7918fbea36bb 100644 --- a/arch/s390/kernel/nmi.c +++ b/arch/s390/kernel/nmi.c | |||
| @@ -254,7 +254,7 @@ void notrace s390_do_machine_check(struct pt_regs *regs) | |||
| 254 | int umode; | 254 | int umode; |
| 255 | 255 | ||
| 256 | nmi_enter(); | 256 | nmi_enter(); |
| 257 | kstat_cpu(smp_processor_id()).irqs[NMI_NMI]++; | 257 | inc_irq_stat(NMI_NMI); |
| 258 | mci = (struct mci *) &S390_lowcore.mcck_interruption_code; | 258 | mci = (struct mci *) &S390_lowcore.mcck_interruption_code; |
| 259 | mcck = &__get_cpu_var(cpu_mcck); | 259 | mcck = &__get_cpu_var(cpu_mcck); |
| 260 | umode = user_mode(regs); | 260 | umode = user_mode(regs); |
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index c4e7269d4a09..86ec7447e1f5 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c | |||
| @@ -229,7 +229,7 @@ static void cpumf_measurement_alert(struct ext_code ext_code, | |||
| 229 | if (!(alert & CPU_MF_INT_CF_MASK)) | 229 | if (!(alert & CPU_MF_INT_CF_MASK)) |
| 230 | return; | 230 | return; |
| 231 | 231 | ||
| 232 | kstat_cpu(smp_processor_id()).irqs[EXTINT_CMC]++; | 232 | inc_irq_stat(IRQEXT_CMC); |
| 233 | cpuhw = &__get_cpu_var(cpu_hw_events); | 233 | cpuhw = &__get_cpu_var(cpu_hw_events); |
| 234 | 234 | ||
| 235 | /* Measurement alerts are shared and might happen when the PMU | 235 | /* Measurement alerts are shared and might happen when the PMU |
diff --git a/arch/s390/kernel/runtime_instr.c b/arch/s390/kernel/runtime_instr.c index 61066f6f71a5..077a99389b07 100644 --- a/arch/s390/kernel/runtime_instr.c +++ b/arch/s390/kernel/runtime_instr.c | |||
| @@ -71,7 +71,7 @@ static void runtime_instr_int_handler(struct ext_code ext_code, | |||
| 71 | if (!(param32 & CPU_MF_INT_RI_MASK)) | 71 | if (!(param32 & CPU_MF_INT_RI_MASK)) |
| 72 | return; | 72 | return; |
| 73 | 73 | ||
| 74 | kstat_cpu(smp_processor_id()).irqs[EXTINT_CMR]++; | 74 | inc_irq_stat(IRQEXT_CMR); |
| 75 | 75 | ||
| 76 | if (!current->thread.ri_cb) | 76 | if (!current->thread.ri_cb) |
| 77 | return; | 77 | return; |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 2568590973ad..a5360de85ec7 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | 16 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
| 17 | 17 | ||
| 18 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
| 19 | #include <linux/module.h> | 19 | #include <linux/export.h> |
| 20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
| 21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
| 22 | #include <linux/memblock.h> | 22 | #include <linux/memblock.h> |
| @@ -289,6 +289,7 @@ void machine_power_off(void) | |||
| 289 | * Dummy power off function. | 289 | * Dummy power off function. |
| 290 | */ | 290 | */ |
| 291 | void (*pm_power_off)(void) = machine_power_off; | 291 | void (*pm_power_off)(void) = machine_power_off; |
| 292 | EXPORT_SYMBOL_GPL(pm_power_off); | ||
| 292 | 293 | ||
| 293 | static int __init early_parse_mem(char *p) | 294 | static int __init early_parse_mem(char *p) |
| 294 | { | 295 | { |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 0b45baa55438..7433a2f9e5cc 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
| @@ -433,9 +433,9 @@ static void do_ext_call_interrupt(struct ext_code ext_code, | |||
| 433 | 433 | ||
| 434 | cpu = smp_processor_id(); | 434 | cpu = smp_processor_id(); |
| 435 | if (ext_code.code == 0x1202) | 435 | if (ext_code.code == 0x1202) |
| 436 | kstat_cpu(cpu).irqs[EXTINT_EXC]++; | 436 | inc_irq_stat(IRQEXT_EXC); |
| 437 | else | 437 | else |
| 438 | kstat_cpu(cpu).irqs[EXTINT_EMS]++; | 438 | inc_irq_stat(IRQEXT_EMS); |
| 439 | /* | 439 | /* |
| 440 | * handle bit signal external calls | 440 | * handle bit signal external calls |
| 441 | */ | 441 | */ |
| @@ -623,9 +623,10 @@ static struct sclp_cpu_info *smp_get_cpu_info(void) | |||
| 623 | return info; | 623 | return info; |
| 624 | } | 624 | } |
| 625 | 625 | ||
| 626 | static int smp_add_present_cpu(int cpu); | 626 | static int __cpuinit smp_add_present_cpu(int cpu); |
| 627 | 627 | ||
| 628 | static int __smp_rescan_cpus(struct sclp_cpu_info *info, int sysfs_add) | 628 | static int __cpuinit __smp_rescan_cpus(struct sclp_cpu_info *info, |
| 629 | int sysfs_add) | ||
| 629 | { | 630 | { |
| 630 | struct pcpu *pcpu; | 631 | struct pcpu *pcpu; |
| 631 | cpumask_t avail; | 632 | cpumask_t avail; |
| @@ -708,6 +709,7 @@ static void __cpuinit smp_start_secondary(void *cpuvoid) | |||
| 708 | pfault_init(); | 709 | pfault_init(); |
| 709 | notify_cpu_starting(smp_processor_id()); | 710 | notify_cpu_starting(smp_processor_id()); |
| 710 | set_cpu_online(smp_processor_id(), true); | 711 | set_cpu_online(smp_processor_id(), true); |
| 712 | inc_irq_stat(CPU_RST); | ||
| 711 | local_irq_enable(); | 713 | local_irq_enable(); |
| 712 | /* cpu_idle will call schedule for us */ | 714 | /* cpu_idle will call schedule for us */ |
| 713 | cpu_idle(); | 715 | cpu_idle(); |
| @@ -985,7 +987,7 @@ static int __cpuinit smp_cpu_notify(struct notifier_block *self, | |||
| 985 | return notifier_from_errno(err); | 987 | return notifier_from_errno(err); |
| 986 | } | 988 | } |
| 987 | 989 | ||
| 988 | static int smp_add_present_cpu(int cpu) | 990 | static int __cpuinit smp_add_present_cpu(int cpu) |
| 989 | { | 991 | { |
| 990 | struct cpu *c = &pcpu_devices[cpu].cpu; | 992 | struct cpu *c = &pcpu_devices[cpu].cpu; |
| 991 | struct device *s = &c->dev; | 993 | struct device *s = &c->dev; |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 48174850f3b0..6a6c61f94dd3 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
| @@ -352,3 +352,4 @@ SYSCALL(sys_process_vm_readv,sys_process_vm_readv,compat_sys_process_vm_readv_wr | |||
| 352 | SYSCALL(sys_process_vm_writev,sys_process_vm_writev,compat_sys_process_vm_writev_wrapper) | 352 | SYSCALL(sys_process_vm_writev,sys_process_vm_writev,compat_sys_process_vm_writev_wrapper) |
| 353 | SYSCALL(sys_ni_syscall,sys_s390_runtime_instr,sys_s390_runtime_instr_wrapper) | 353 | SYSCALL(sys_ni_syscall,sys_s390_runtime_instr,sys_s390_runtime_instr_wrapper) |
| 354 | SYSCALL(sys_kcmp,sys_kcmp,sys_kcmp_wrapper) | 354 | SYSCALL(sys_kcmp,sys_kcmp,sys_kcmp_wrapper) |
| 355 | SYSCALL(sys_finit_module,sys_finit_module,sys_finit_module_wrapper) | ||
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 7fcd690d42c7..aff0e350d776 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c | |||
| @@ -168,7 +168,7 @@ static void clock_comparator_interrupt(struct ext_code ext_code, | |||
| 168 | unsigned int param32, | 168 | unsigned int param32, |
| 169 | unsigned long param64) | 169 | unsigned long param64) |
| 170 | { | 170 | { |
| 171 | kstat_cpu(smp_processor_id()).irqs[EXTINT_CLK]++; | 171 | inc_irq_stat(IRQEXT_CLK); |
| 172 | if (S390_lowcore.clock_comparator == -1ULL) | 172 | if (S390_lowcore.clock_comparator == -1ULL) |
| 173 | set_clock_comparator(S390_lowcore.clock_comparator); | 173 | set_clock_comparator(S390_lowcore.clock_comparator); |
| 174 | } | 174 | } |
| @@ -179,7 +179,7 @@ static void stp_timing_alert(struct stp_irq_parm *); | |||
| 179 | static void timing_alert_interrupt(struct ext_code ext_code, | 179 | static void timing_alert_interrupt(struct ext_code ext_code, |
| 180 | unsigned int param32, unsigned long param64) | 180 | unsigned int param32, unsigned long param64) |
| 181 | { | 181 | { |
| 182 | kstat_cpu(smp_processor_id()).irqs[EXTINT_TLA]++; | 182 | inc_irq_stat(IRQEXT_TLA); |
| 183 | if (param32 & 0x00c40000) | 183 | if (param32 & 0x00c40000) |
| 184 | etr_timing_alert((struct etr_irq_parm *) ¶m32); | 184 | etr_timing_alert((struct etr_irq_parm *) ¶m32); |
| 185 | if (param32 & 0x00038000) | 185 | if (param32 & 0x00038000) |
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index f1aba87cceb8..4b2e3e317004 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/bootmem.h> | 10 | #include <linux/bootmem.h> |
| 11 | #include <linux/cpuset.h> | 11 | #include <linux/cpuset.h> |
| 12 | #include <linux/device.h> | 12 | #include <linux/device.h> |
| 13 | #include <linux/export.h> | ||
| 13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 14 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
| 15 | #include <linux/init.h> | 16 | #include <linux/init.h> |
| @@ -42,6 +43,7 @@ static struct mask_info socket_info; | |||
| 42 | static struct mask_info book_info; | 43 | static struct mask_info book_info; |
| 43 | 44 | ||
| 44 | struct cpu_topology_s390 cpu_topology[NR_CPUS]; | 45 | struct cpu_topology_s390 cpu_topology[NR_CPUS]; |
| 46 | EXPORT_SYMBOL_GPL(cpu_topology); | ||
| 45 | 47 | ||
| 46 | static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu) | 48 | static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu) |
| 47 | { | 49 | { |
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 42601d6e166f..2fb9e63b8fc4 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c | |||
| @@ -569,7 +569,7 @@ static void pfault_interrupt(struct ext_code ext_code, | |||
| 569 | subcode = ext_code.subcode; | 569 | subcode = ext_code.subcode; |
| 570 | if ((subcode & 0xff00) != __SUBCODE_MASK) | 570 | if ((subcode & 0xff00) != __SUBCODE_MASK) |
| 571 | return; | 571 | return; |
| 572 | kstat_cpu(smp_processor_id()).irqs[EXTINT_PFL]++; | 572 | inc_irq_stat(IRQEXT_PFL); |
| 573 | /* Get the token (= pid of the affected task). */ | 573 | /* Get the token (= pid of the affected task). */ |
| 574 | pid = sizeof(void *) == 4 ? param32 : param64; | 574 | pid = sizeof(void *) == 4 ? param32 : param64; |
| 575 | rcu_read_lock(); | 575 | rcu_read_lock(); |
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c index 0cb385da202c..b5b2916895e0 100644 --- a/arch/s390/oprofile/hwsampler.c +++ b/arch/s390/oprofile/hwsampler.c | |||
| @@ -233,7 +233,7 @@ static void hws_ext_handler(struct ext_code ext_code, | |||
| 233 | if (!(param32 & CPU_MF_INT_SF_MASK)) | 233 | if (!(param32 & CPU_MF_INT_SF_MASK)) |
| 234 | return; | 234 | return; |
| 235 | 235 | ||
| 236 | kstat_cpu(smp_processor_id()).irqs[EXTINT_CMS]++; | 236 | inc_irq_stat(IRQEXT_CMS); |
| 237 | atomic_xchg(&cb->ext_params, atomic_read(&cb->ext_params) | param32); | 237 | atomic_xchg(&cb->ext_params, atomic_read(&cb->ext_params) | param32); |
| 238 | 238 | ||
| 239 | if (hws_wq) | 239 | if (hws_wq) |
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index ff49427e9941..60e0372545d2 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c | |||
| @@ -160,35 +160,6 @@ int pci_proc_domain(struct pci_bus *bus) | |||
| 160 | } | 160 | } |
| 161 | EXPORT_SYMBOL_GPL(pci_proc_domain); | 161 | EXPORT_SYMBOL_GPL(pci_proc_domain); |
| 162 | 162 | ||
| 163 | /* Store PCI function information block */ | ||
| 164 | static int zpci_store_fib(struct zpci_dev *zdev, u8 *fc) | ||
| 165 | { | ||
| 166 | struct zpci_fib *fib; | ||
| 167 | u8 status, cc; | ||
| 168 | |||
| 169 | fib = (void *) get_zeroed_page(GFP_KERNEL); | ||
| 170 | if (!fib) | ||
| 171 | return -ENOMEM; | ||
| 172 | |||
| 173 | do { | ||
| 174 | cc = __stpcifc(zdev->fh, 0, fib, &status); | ||
| 175 | if (cc == 2) { | ||
| 176 | msleep(ZPCI_INSN_BUSY_DELAY); | ||
| 177 | memset(fib, 0, PAGE_SIZE); | ||
| 178 | } | ||
| 179 | } while (cc == 2); | ||
| 180 | |||
| 181 | if (cc) | ||
| 182 | pr_err_once("%s: cc: %u status: %u\n", | ||
| 183 | __func__, cc, status); | ||
| 184 | |||
| 185 | /* Return PCI function controls */ | ||
| 186 | *fc = fib->fc; | ||
| 187 | |||
| 188 | free_page((unsigned long) fib); | ||
| 189 | return (cc) ? -EIO : 0; | ||
| 190 | } | ||
| 191 | |||
| 192 | /* Modify PCI: Register adapter interruptions */ | 163 | /* Modify PCI: Register adapter interruptions */ |
| 193 | static int zpci_register_airq(struct zpci_dev *zdev, unsigned int aisb, | 164 | static int zpci_register_airq(struct zpci_dev *zdev, unsigned int aisb, |
| 194 | u64 aibv) | 165 | u64 aibv) |
| @@ -469,7 +440,7 @@ static void zpci_irq_handler(void *dont, void *need) | |||
| 469 | int rescan = 0, max = aisb_max; | 440 | int rescan = 0, max = aisb_max; |
| 470 | struct zdev_irq_map *imap; | 441 | struct zdev_irq_map *imap; |
| 471 | 442 | ||
| 472 | kstat_cpu(smp_processor_id()).irqs[IOINT_PCI]++; | 443 | inc_irq_stat(IRQIO_PCI); |
| 473 | sbit = start; | 444 | sbit = start; |
| 474 | 445 | ||
| 475 | scan: | 446 | scan: |
| @@ -481,7 +452,7 @@ scan: | |||
| 481 | /* find vector bit */ | 452 | /* find vector bit */ |
| 482 | imap = bucket->imap[sbit]; | 453 | imap = bucket->imap[sbit]; |
| 483 | for_each_set_bit_left(mbit, &imap->aibv, imap->msi_vecs) { | 454 | for_each_set_bit_left(mbit, &imap->aibv, imap->msi_vecs) { |
| 484 | kstat_cpu(smp_processor_id()).irqs[IOINT_MSI]++; | 455 | inc_irq_stat(IRQIO_MSI); |
| 485 | clear_bit(63 - mbit, &imap->aibv); | 456 | clear_bit(63 - mbit, &imap->aibv); |
| 486 | 457 | ||
| 487 | spin_lock(&imap->lock); | 458 | spin_lock(&imap->lock); |
diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c index 6138468b420f..a547419907c3 100644 --- a/arch/s390/pci/pci_dma.c +++ b/arch/s390/pci/pci_dma.c | |||
| @@ -13,8 +13,6 @@ | |||
| 13 | #include <linux/pci.h> | 13 | #include <linux/pci.h> |
| 14 | #include <asm/pci_dma.h> | 14 | #include <asm/pci_dma.h> |
| 15 | 15 | ||
| 16 | static enum zpci_ioat_dtype zpci_ioat_dt = ZPCI_IOTA_RTTO; | ||
| 17 | |||
| 18 | static struct kmem_cache *dma_region_table_cache; | 16 | static struct kmem_cache *dma_region_table_cache; |
| 19 | static struct kmem_cache *dma_page_table_cache; | 17 | static struct kmem_cache *dma_page_table_cache; |
| 20 | 18 | ||
diff --git a/arch/sparc/include/uapi/asm/unistd.h b/arch/sparc/include/uapi/asm/unistd.h index cac719d1bc5c..62ced589bcf7 100644 --- a/arch/sparc/include/uapi/asm/unistd.h +++ b/arch/sparc/include/uapi/asm/unistd.h | |||
| @@ -407,8 +407,9 @@ | |||
| 407 | #define __NR_process_vm_writev 339 | 407 | #define __NR_process_vm_writev 339 |
| 408 | #define __NR_kern_features 340 | 408 | #define __NR_kern_features 340 |
| 409 | #define __NR_kcmp 341 | 409 | #define __NR_kcmp 341 |
| 410 | #define __NR_finit_module 342 | ||
| 410 | 411 | ||
| 411 | #define NR_syscalls 342 | 412 | #define NR_syscalls 343 |
| 412 | 413 | ||
| 413 | /* Bitmask values returned from kern_features system call. */ | 414 | /* Bitmask values returned from kern_features system call. */ |
| 414 | #define KERN_FEATURE_MIXED_MODE_STACK 0x00000001 | 415 | #define KERN_FEATURE_MIXED_MODE_STACK 0x00000001 |
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 04bacce76fe6..baf4366e2d6a 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
| @@ -378,7 +378,8 @@ static void apb_calc_first_last(u8 map, u32 *first_p, u32 *last_p) | |||
| 378 | /* Cook up fake bus resources for SUNW,simba PCI bridges which lack | 378 | /* Cook up fake bus resources for SUNW,simba PCI bridges which lack |
| 379 | * a proper 'ranges' property. | 379 | * a proper 'ranges' property. |
| 380 | */ | 380 | */ |
| 381 | static void apb_fake_ranges(struct pci_dev *dev, struct pci_bus *bus, | 381 | static void apb_fake_ranges(struct pci_dev *dev, |
| 382 | struct pci_bus *bus, | ||
| 382 | struct pci_pbm_info *pbm) | 383 | struct pci_pbm_info *pbm) |
| 383 | { | 384 | { |
| 384 | struct pci_bus_region region; | 385 | struct pci_bus_region region; |
| @@ -403,13 +404,15 @@ static void apb_fake_ranges(struct pci_dev *dev, struct pci_bus *bus, | |||
| 403 | pcibios_bus_to_resource(dev, res, ®ion); | 404 | pcibios_bus_to_resource(dev, res, ®ion); |
| 404 | } | 405 | } |
| 405 | 406 | ||
| 406 | static void pci_of_scan_bus(struct pci_pbm_info *pbm, struct device_node *node, | 407 | static void pci_of_scan_bus(struct pci_pbm_info *pbm, |
| 408 | struct device_node *node, | ||
| 407 | struct pci_bus *bus); | 409 | struct pci_bus *bus); |
| 408 | 410 | ||
| 409 | #define GET_64BIT(prop, i) ((((u64) (prop)[(i)]) << 32) | (prop)[(i)+1]) | 411 | #define GET_64BIT(prop, i) ((((u64) (prop)[(i)]) << 32) | (prop)[(i)+1]) |
| 410 | 412 | ||
| 411 | static void of_scan_pci_bridge(struct pci_pbm_info *pbm, | 413 | static void of_scan_pci_bridge(struct pci_pbm_info *pbm, |
| 412 | struct device_node *node, struct pci_dev *dev) | 414 | struct device_node *node, |
| 415 | struct pci_dev *dev) | ||
| 413 | { | 416 | { |
| 414 | struct pci_bus *bus; | 417 | struct pci_bus *bus; |
| 415 | const u32 *busrange, *ranges; | 418 | const u32 *busrange, *ranges; |
| @@ -500,7 +503,8 @@ after_ranges: | |||
| 500 | pci_of_scan_bus(pbm, node, bus); | 503 | pci_of_scan_bus(pbm, node, bus); |
| 501 | } | 504 | } |
| 502 | 505 | ||
| 503 | static void pci_of_scan_bus(struct pci_pbm_info *pbm, struct device_node *node, | 506 | static void pci_of_scan_bus(struct pci_pbm_info *pbm, |
| 507 | struct device_node *node, | ||
| 504 | struct pci_bus *bus) | 508 | struct pci_bus *bus) |
| 505 | { | 509 | { |
| 506 | struct device_node *child; | 510 | struct device_node *child; |
diff --git a/arch/sparc/kernel/pci_psycho.c b/arch/sparc/kernel/pci_psycho.c index b85238289717..c647634ead2b 100644 --- a/arch/sparc/kernel/pci_psycho.c +++ b/arch/sparc/kernel/pci_psycho.c | |||
| @@ -366,7 +366,8 @@ static void pbm_config_busmastering(struct pci_pbm_info *pbm) | |||
| 366 | pci_config_write8(addr, 64); | 366 | pci_config_write8(addr, 64); |
| 367 | } | 367 | } |
| 368 | 368 | ||
| 369 | static void psycho_scan_bus(struct pci_pbm_info *pbm, struct device *parent) | 369 | static void psycho_scan_bus(struct pci_pbm_info *pbm, |
| 370 | struct device *parent) | ||
| 370 | { | 371 | { |
| 371 | pbm_config_busmastering(pbm); | 372 | pbm_config_busmastering(pbm); |
| 372 | pbm->is_66mhz_capable = 0; | 373 | pbm->is_66mhz_capable = 0; |
diff --git a/arch/sparc/kernel/pci_sabre.c b/arch/sparc/kernel/pci_sabre.c index 531186d7c9ab..6f00d27e8dac 100644 --- a/arch/sparc/kernel/pci_sabre.c +++ b/arch/sparc/kernel/pci_sabre.c | |||
| @@ -442,7 +442,8 @@ static void sabre_scan_bus(struct pci_pbm_info *pbm, struct device *parent) | |||
| 442 | sabre_register_error_handlers(pbm); | 442 | sabre_register_error_handlers(pbm); |
| 443 | } | 443 | } |
| 444 | 444 | ||
| 445 | static void sabre_pbm_init(struct pci_pbm_info *pbm, struct platform_device *op) | 445 | static void sabre_pbm_init(struct pci_pbm_info *pbm, |
| 446 | struct platform_device *op) | ||
| 446 | { | 447 | { |
| 447 | psycho_pbm_init_common(pbm, op, "SABRE", PBM_CHIP_TYPE_SABRE); | 448 | psycho_pbm_init_common(pbm, op, "SABRE", PBM_CHIP_TYPE_SABRE); |
| 448 | pbm->pci_afsr = pbm->controller_regs + SABRE_PIOAFSR; | 449 | pbm->pci_afsr = pbm->controller_regs + SABRE_PIOAFSR; |
diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c index 29e888158ae6..8f76f23dac38 100644 --- a/arch/sparc/kernel/pci_schizo.c +++ b/arch/sparc/kernel/pci_schizo.c | |||
| @@ -1306,8 +1306,9 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm) | |||
| 1306 | } | 1306 | } |
| 1307 | } | 1307 | } |
| 1308 | 1308 | ||
| 1309 | static int schizo_pbm_init(struct pci_pbm_info *pbm, struct platform_device *op, | 1309 | static int schizo_pbm_init(struct pci_pbm_info *pbm, |
| 1310 | u32 portid, int chip_type) | 1310 | struct platform_device *op, u32 portid, |
| 1311 | int chip_type) | ||
| 1311 | { | 1312 | { |
| 1312 | const struct linux_prom64_registers *regs; | 1313 | const struct linux_prom64_registers *regs; |
| 1313 | struct device_node *dp = op->dev.of_node; | 1314 | struct device_node *dp = op->dev.of_node; |
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S index 5147f574f125..6ac43c36bbbf 100644 --- a/arch/sparc/kernel/systbls_32.S +++ b/arch/sparc/kernel/systbls_32.S | |||
| @@ -85,4 +85,4 @@ sys_call_table: | |||
| 85 | /*325*/ .long sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init | 85 | /*325*/ .long sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init |
| 86 | /*330*/ .long sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime | 86 | /*330*/ .long sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime |
| 87 | /*335*/ .long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev | 87 | /*335*/ .long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev |
| 88 | /*340*/ .long sys_ni_syscall, sys_kcmp | 88 | /*340*/ .long sys_ni_syscall, sys_kcmp, sys_finit_module |
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index cdbd9b817751..1009ecb92678 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S | |||
| @@ -86,7 +86,7 @@ sys_call_table32: | |||
| 86 | .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open, compat_sys_recvmmsg, sys_fanotify_init | 86 | .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open, compat_sys_recvmmsg, sys_fanotify_init |
| 87 | /*330*/ .word sys32_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime | 87 | /*330*/ .word sys32_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime |
| 88 | .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev | 88 | .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev |
| 89 | /*340*/ .word sys_kern_features, sys_kcmp | 89 | /*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module |
| 90 | 90 | ||
| 91 | #endif /* CONFIG_COMPAT */ | 91 | #endif /* CONFIG_COMPAT */ |
| 92 | 92 | ||
| @@ -164,4 +164,4 @@ sys_call_table: | |||
| 164 | .word sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init | 164 | .word sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init |
| 165 | /*330*/ .word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime | 165 | /*330*/ .word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime |
| 166 | .word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev | 166 | .word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev |
| 167 | /*340*/ .word sys_kern_features, sys_kcmp | 167 | /*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module |
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index b1942e222768..18e329ca108e 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c | |||
| @@ -302,7 +302,7 @@ static efi_status_t setup_efi_pci(struct boot_params *params) | |||
| 302 | if (status != EFI_SUCCESS) | 302 | if (status != EFI_SUCCESS) |
| 303 | continue; | 303 | continue; |
| 304 | 304 | ||
| 305 | if (!attributes & EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM) | 305 | if (!(attributes & EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM)) |
| 306 | continue; | 306 | continue; |
| 307 | 307 | ||
| 308 | if (!pci->romimage || !pci->romsize) | 308 | if (!pci->romimage || !pci->romsize) |
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 08b973f64032..9c2bd8bd4b4c 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | #include <asm/apicdef.h> | 43 | #include <asm/apicdef.h> |
| 44 | #include <asm/hypervisor.h> | 44 | #include <asm/hypervisor.h> |
| 45 | #include <asm/kvm_guest.h> | 45 | #include <asm/kvm_guest.h> |
| 46 | #include <asm/context_tracking.h> | ||
| 46 | 47 | ||
| 47 | static int kvmapf = 1; | 48 | static int kvmapf = 1; |
| 48 | 49 | ||
| @@ -121,6 +122,8 @@ void kvm_async_pf_task_wait(u32 token) | |||
| 121 | struct kvm_task_sleep_node n, *e; | 122 | struct kvm_task_sleep_node n, *e; |
| 122 | DEFINE_WAIT(wait); | 123 | DEFINE_WAIT(wait); |
| 123 | 124 | ||
| 125 | rcu_irq_enter(); | ||
| 126 | |||
| 124 | spin_lock(&b->lock); | 127 | spin_lock(&b->lock); |
| 125 | e = _find_apf_task(b, token); | 128 | e = _find_apf_task(b, token); |
| 126 | if (e) { | 129 | if (e) { |
| @@ -128,6 +131,8 @@ void kvm_async_pf_task_wait(u32 token) | |||
| 128 | hlist_del(&e->link); | 131 | hlist_del(&e->link); |
| 129 | kfree(e); | 132 | kfree(e); |
| 130 | spin_unlock(&b->lock); | 133 | spin_unlock(&b->lock); |
| 134 | |||
| 135 | rcu_irq_exit(); | ||
| 131 | return; | 136 | return; |
| 132 | } | 137 | } |
| 133 | 138 | ||
| @@ -152,13 +157,16 @@ void kvm_async_pf_task_wait(u32 token) | |||
| 152 | /* | 157 | /* |
| 153 | * We cannot reschedule. So halt. | 158 | * We cannot reschedule. So halt. |
| 154 | */ | 159 | */ |
| 160 | rcu_irq_exit(); | ||
| 155 | native_safe_halt(); | 161 | native_safe_halt(); |
| 162 | rcu_irq_enter(); | ||
| 156 | local_irq_disable(); | 163 | local_irq_disable(); |
| 157 | } | 164 | } |
| 158 | } | 165 | } |
| 159 | if (!n.halted) | 166 | if (!n.halted) |
| 160 | finish_wait(&n.wq, &wait); | 167 | finish_wait(&n.wq, &wait); |
| 161 | 168 | ||
| 169 | rcu_irq_exit(); | ||
| 162 | return; | 170 | return; |
| 163 | } | 171 | } |
| 164 | EXPORT_SYMBOL_GPL(kvm_async_pf_task_wait); | 172 | EXPORT_SYMBOL_GPL(kvm_async_pf_task_wait); |
| @@ -252,10 +260,10 @@ do_async_page_fault(struct pt_regs *regs, unsigned long error_code) | |||
| 252 | break; | 260 | break; |
| 253 | case KVM_PV_REASON_PAGE_NOT_PRESENT: | 261 | case KVM_PV_REASON_PAGE_NOT_PRESENT: |
| 254 | /* page is swapped out by the host. */ | 262 | /* page is swapped out by the host. */ |
| 255 | rcu_irq_enter(); | 263 | exception_enter(regs); |
| 256 | exit_idle(); | 264 | exit_idle(); |
| 257 | kvm_async_pf_task_wait((u32)read_cr2()); | 265 | kvm_async_pf_task_wait((u32)read_cr2()); |
| 258 | rcu_irq_exit(); | 266 | exception_exit(regs); |
| 259 | break; | 267 | break; |
| 260 | case KVM_PV_REASON_PAGE_READY: | 268 | case KVM_PV_REASON_PAGE_READY: |
| 261 | rcu_irq_enter(); | 269 | rcu_irq_enter(); |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 23ddd558fbd5..00f6c1472b85 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
| @@ -610,6 +610,83 @@ static __init void reserve_ibft_region(void) | |||
| 610 | 610 | ||
| 611 | static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10; | 611 | static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10; |
| 612 | 612 | ||
| 613 | static bool __init snb_gfx_workaround_needed(void) | ||
| 614 | { | ||
| 615 | #ifdef CONFIG_PCI | ||
| 616 | int i; | ||
| 617 | u16 vendor, devid; | ||
| 618 | static const __initconst u16 snb_ids[] = { | ||
| 619 | 0x0102, | ||
| 620 | 0x0112, | ||
| 621 | 0x0122, | ||
| 622 | 0x0106, | ||
| 623 | 0x0116, | ||
| 624 | 0x0126, | ||
| 625 | 0x010a, | ||
| 626 | }; | ||
| 627 | |||
| 628 | /* Assume no if something weird is going on with PCI */ | ||
| 629 | if (!early_pci_allowed()) | ||
| 630 | return false; | ||
| 631 | |||
| 632 | vendor = read_pci_config_16(0, 2, 0, PCI_VENDOR_ID); | ||
| 633 | if (vendor != 0x8086) | ||
| 634 | return false; | ||
| 635 | |||
| 636 | devid = read_pci_config_16(0, 2, 0, PCI_DEVICE_ID); | ||
| 637 | for (i = 0; i < ARRAY_SIZE(snb_ids); i++) | ||
| 638 | if (devid == snb_ids[i]) | ||
| 639 | return true; | ||
| 640 | #endif | ||
| 641 | |||
| 642 | return false; | ||
| 643 | } | ||
| 644 | |||
| 645 | /* | ||
| 646 | * Sandy Bridge graphics has trouble with certain ranges, exclude | ||
| 647 | * them from allocation. | ||
| 648 | */ | ||
| 649 | static void __init trim_snb_memory(void) | ||
| 650 | { | ||
| 651 | static const __initconst unsigned long bad_pages[] = { | ||
| 652 | 0x20050000, | ||
| 653 | 0x20110000, | ||
| 654 | 0x20130000, | ||
| 655 | 0x20138000, | ||
| 656 | 0x40004000, | ||
| 657 | }; | ||
| 658 | int i; | ||
| 659 | |||
| 660 | if (!snb_gfx_workaround_needed()) | ||
| 661 | return; | ||
| 662 | |||
| 663 | printk(KERN_DEBUG "reserving inaccessible SNB gfx pages\n"); | ||
| 664 | |||
| 665 | /* | ||
| 666 | * Reserve all memory below the 1 MB mark that has not | ||
| 667 | * already been reserved. | ||
| 668 | */ | ||
| 669 | memblock_reserve(0, 1<<20); | ||
| 670 | |||
| 671 | for (i = 0; i < ARRAY_SIZE(bad_pages); i++) { | ||
| 672 | if (memblock_reserve(bad_pages[i], PAGE_SIZE)) | ||
| 673 | printk(KERN_WARNING "failed to reserve 0x%08lx\n", | ||
| 674 | bad_pages[i]); | ||
| 675 | } | ||
| 676 | } | ||
| 677 | |||
| 678 | /* | ||
| 679 | * Here we put platform-specific memory range workarounds, i.e. | ||
| 680 | * memory known to be corrupt or otherwise in need to be reserved on | ||
| 681 | * specific platforms. | ||
| 682 | * | ||
| 683 | * If this gets used more widely it could use a real dispatch mechanism. | ||
| 684 | */ | ||
| 685 | static void __init trim_platform_memory_ranges(void) | ||
| 686 | { | ||
| 687 | trim_snb_memory(); | ||
| 688 | } | ||
| 689 | |||
| 613 | static void __init trim_bios_range(void) | 690 | static void __init trim_bios_range(void) |
| 614 | { | 691 | { |
| 615 | /* | 692 | /* |
| @@ -630,6 +707,7 @@ static void __init trim_bios_range(void) | |||
| 630 | * take them out. | 707 | * take them out. |
| 631 | */ | 708 | */ |
| 632 | e820_remove_range(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_RAM, 1); | 709 | e820_remove_range(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_RAM, 1); |
| 710 | |||
| 633 | sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); | 711 | sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); |
| 634 | } | 712 | } |
| 635 | 713 | ||
| @@ -908,6 +986,8 @@ void __init setup_arch(char **cmdline_p) | |||
| 908 | 986 | ||
| 909 | setup_real_mode(); | 987 | setup_real_mode(); |
| 910 | 988 | ||
| 989 | trim_platform_memory_ranges(); | ||
| 990 | |||
| 911 | init_gbpages(); | 991 | init_gbpages(); |
| 912 | 992 | ||
| 913 | /* max_pfn_mapped is updated here */ | 993 | /* max_pfn_mapped is updated here */ |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 76f54461f7cb..c243b81e3c74 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
| @@ -120,7 +120,7 @@ struct kvm_shared_msrs { | |||
| 120 | }; | 120 | }; |
| 121 | 121 | ||
| 122 | static struct kvm_shared_msrs_global __read_mostly shared_msrs_global; | 122 | static struct kvm_shared_msrs_global __read_mostly shared_msrs_global; |
| 123 | static DEFINE_PER_CPU(struct kvm_shared_msrs, shared_msrs); | 123 | static struct kvm_shared_msrs __percpu *shared_msrs; |
| 124 | 124 | ||
| 125 | struct kvm_stats_debugfs_item debugfs_entries[] = { | 125 | struct kvm_stats_debugfs_item debugfs_entries[] = { |
| 126 | { "pf_fixed", VCPU_STAT(pf_fixed) }, | 126 | { "pf_fixed", VCPU_STAT(pf_fixed) }, |
| @@ -191,10 +191,10 @@ static void kvm_on_user_return(struct user_return_notifier *urn) | |||
| 191 | 191 | ||
| 192 | static void shared_msr_update(unsigned slot, u32 msr) | 192 | static void shared_msr_update(unsigned slot, u32 msr) |
| 193 | { | 193 | { |
| 194 | struct kvm_shared_msrs *smsr; | ||
| 195 | u64 value; | 194 | u64 value; |
| 195 | unsigned int cpu = smp_processor_id(); | ||
| 196 | struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu); | ||
| 196 | 197 | ||
| 197 | smsr = &__get_cpu_var(shared_msrs); | ||
| 198 | /* only read, and nobody should modify it at this time, | 198 | /* only read, and nobody should modify it at this time, |
| 199 | * so don't need lock */ | 199 | * so don't need lock */ |
| 200 | if (slot >= shared_msrs_global.nr) { | 200 | if (slot >= shared_msrs_global.nr) { |
| @@ -226,7 +226,8 @@ static void kvm_shared_msr_cpu_online(void) | |||
| 226 | 226 | ||
| 227 | void kvm_set_shared_msr(unsigned slot, u64 value, u64 mask) | 227 | void kvm_set_shared_msr(unsigned slot, u64 value, u64 mask) |
| 228 | { | 228 | { |
| 229 | struct kvm_shared_msrs *smsr = &__get_cpu_var(shared_msrs); | 229 | unsigned int cpu = smp_processor_id(); |
| 230 | struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu); | ||
| 230 | 231 | ||
| 231 | if (((value ^ smsr->values[slot].curr) & mask) == 0) | 232 | if (((value ^ smsr->values[slot].curr) & mask) == 0) |
| 232 | return; | 233 | return; |
| @@ -242,7 +243,8 @@ EXPORT_SYMBOL_GPL(kvm_set_shared_msr); | |||
| 242 | 243 | ||
| 243 | static void drop_user_return_notifiers(void *ignore) | 244 | static void drop_user_return_notifiers(void *ignore) |
| 244 | { | 245 | { |
| 245 | struct kvm_shared_msrs *smsr = &__get_cpu_var(shared_msrs); | 246 | unsigned int cpu = smp_processor_id(); |
| 247 | struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu); | ||
| 246 | 248 | ||
| 247 | if (smsr->registered) | 249 | if (smsr->registered) |
| 248 | kvm_on_user_return(&smsr->urn); | 250 | kvm_on_user_return(&smsr->urn); |
| @@ -5233,9 +5235,16 @@ int kvm_arch_init(void *opaque) | |||
| 5233 | goto out; | 5235 | goto out; |
| 5234 | } | 5236 | } |
| 5235 | 5237 | ||
| 5238 | r = -ENOMEM; | ||
| 5239 | shared_msrs = alloc_percpu(struct kvm_shared_msrs); | ||
| 5240 | if (!shared_msrs) { | ||
| 5241 | printk(KERN_ERR "kvm: failed to allocate percpu kvm_shared_msrs\n"); | ||
| 5242 | goto out; | ||
| 5243 | } | ||
| 5244 | |||
| 5236 | r = kvm_mmu_module_init(); | 5245 | r = kvm_mmu_module_init(); |
| 5237 | if (r) | 5246 | if (r) |
| 5238 | goto out; | 5247 | goto out_free_percpu; |
| 5239 | 5248 | ||
| 5240 | kvm_set_mmio_spte_mask(); | 5249 | kvm_set_mmio_spte_mask(); |
| 5241 | kvm_init_msr_list(); | 5250 | kvm_init_msr_list(); |
| @@ -5258,6 +5267,8 @@ int kvm_arch_init(void *opaque) | |||
| 5258 | 5267 | ||
| 5259 | return 0; | 5268 | return 0; |
| 5260 | 5269 | ||
| 5270 | out_free_percpu: | ||
| 5271 | free_percpu(shared_msrs); | ||
| 5261 | out: | 5272 | out: |
| 5262 | return r; | 5273 | return r; |
| 5263 | } | 5274 | } |
| @@ -5275,6 +5286,7 @@ void kvm_arch_exit(void) | |||
| 5275 | #endif | 5286 | #endif |
| 5276 | kvm_x86_ops = NULL; | 5287 | kvm_x86_ops = NULL; |
| 5277 | kvm_mmu_module_exit(); | 5288 | kvm_mmu_module_exit(); |
| 5289 | free_percpu(shared_msrs); | ||
| 5278 | } | 5290 | } |
| 5279 | 5291 | ||
| 5280 | int kvm_emulate_halt(struct kvm_vcpu *vcpu) | 5292 | int kvm_emulate_halt(struct kvm_vcpu *vcpu) |
