diff options
Diffstat (limited to 'arch')
242 files changed, 1690 insertions, 1871 deletions
diff --git a/arch/alpha/include/asm/syscall.h b/arch/alpha/include/asm/syscall.h new file mode 100644 index 000000000000..88d28eb2a566 --- /dev/null +++ b/arch/alpha/include/asm/syscall.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef _ASM_ALPHA_SYSCALL_H | ||
2 | #define _ASM_ALPHA_SYSCALL_H | ||
3 | |||
4 | #include <uapi/linux/audit.h> | ||
5 | |||
6 | static inline int syscall_get_arch(void) | ||
7 | { | ||
8 | return AUDIT_ARCH_ALPHA; | ||
9 | } | ||
10 | |||
11 | #endif /* _ASM_ALPHA_SYSCALL_H */ | ||
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c index 86d835157b54..d9ee81769899 100644 --- a/arch/alpha/kernel/ptrace.c +++ b/arch/alpha/kernel/ptrace.c | |||
@@ -321,7 +321,7 @@ asmlinkage unsigned long syscall_trace_enter(void) | |||
321 | if (test_thread_flag(TIF_SYSCALL_TRACE) && | 321 | if (test_thread_flag(TIF_SYSCALL_TRACE) && |
322 | tracehook_report_syscall_entry(current_pt_regs())) | 322 | tracehook_report_syscall_entry(current_pt_regs())) |
323 | ret = -1UL; | 323 | ret = -1UL; |
324 | audit_syscall_entry(AUDIT_ARCH_ALPHA, regs->r0, regs->r16, regs->r17, regs->r18, regs->r19); | 324 | audit_syscall_entry(regs->r0, regs->r16, regs->r17, regs->r18, regs->r19); |
325 | return ret ?: current_pt_regs()->r0; | 325 | return ret ?: current_pt_regs()->r0; |
326 | } | 326 | } |
327 | 327 | ||
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index 9596b0ab108d..fe44b2494609 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig | |||
@@ -9,6 +9,7 @@ | |||
9 | config ARC | 9 | config ARC |
10 | def_bool y | 10 | def_bool y |
11 | select BUILDTIME_EXTABLE_SORT | 11 | select BUILDTIME_EXTABLE_SORT |
12 | select COMMON_CLK | ||
12 | select CLONE_BACKWARDS | 13 | select CLONE_BACKWARDS |
13 | # ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev | 14 | # ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev |
14 | select DEVTMPFS if !INITRAMFS_SOURCE="" | 15 | select DEVTMPFS if !INITRAMFS_SOURCE="" |
@@ -73,9 +74,6 @@ config STACKTRACE_SUPPORT | |||
73 | config HAVE_LATENCYTOP_SUPPORT | 74 | config HAVE_LATENCYTOP_SUPPORT |
74 | def_bool y | 75 | def_bool y |
75 | 76 | ||
76 | config NO_DMA | ||
77 | def_bool n | ||
78 | |||
79 | source "init/Kconfig" | 77 | source "init/Kconfig" |
80 | source "kernel/Kconfig.freezer" | 78 | source "kernel/Kconfig.freezer" |
81 | 79 | ||
@@ -354,7 +352,7 @@ config ARC_CURR_IN_REG | |||
354 | kernel mode. This saves memory access for each such access | 352 | kernel mode. This saves memory access for each such access |
355 | 353 | ||
356 | 354 | ||
357 | config ARC_MISALIGN_ACCESS | 355 | config ARC_EMUL_UNALIGNED |
358 | bool "Emulate unaligned memory access (userspace only)" | 356 | bool "Emulate unaligned memory access (userspace only)" |
359 | select SYSCTL_ARCH_UNALIGN_NO_WARN | 357 | select SYSCTL_ARCH_UNALIGN_NO_WARN |
360 | select SYSCTL_ARCH_UNALIGN_ALLOW | 358 | select SYSCTL_ARCH_UNALIGN_ALLOW |
diff --git a/arch/arc/Makefile b/arch/arc/Makefile index 8c0b1aa56f7e..10bc3d4e8a44 100644 --- a/arch/arc/Makefile +++ b/arch/arc/Makefile | |||
@@ -25,7 +25,6 @@ ifdef CONFIG_ARC_CURR_IN_REG | |||
25 | LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h | 25 | LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h |
26 | endif | 26 | endif |
27 | 27 | ||
28 | upto_gcc42 := $(call cc-ifversion, -le, 0402, y) | ||
29 | upto_gcc44 := $(call cc-ifversion, -le, 0404, y) | 28 | upto_gcc44 := $(call cc-ifversion, -le, 0404, y) |
30 | atleast_gcc44 := $(call cc-ifversion, -ge, 0404, y) | 29 | atleast_gcc44 := $(call cc-ifversion, -ge, 0404, y) |
31 | atleast_gcc48 := $(call cc-ifversion, -ge, 0408, y) | 30 | atleast_gcc48 := $(call cc-ifversion, -ge, 0408, y) |
@@ -60,25 +59,11 @@ ldflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB | |||
60 | # --build-id w/o "-marclinux". Default arc-elf32-ld is OK | 59 | # --build-id w/o "-marclinux". Default arc-elf32-ld is OK |
61 | ldflags-$(upto_gcc44) += -marclinux | 60 | ldflags-$(upto_gcc44) += -marclinux |
62 | 61 | ||
63 | ARC_LIBGCC := -mA7 | ||
64 | cflags-$(CONFIG_ARC_HAS_HW_MPY) += -multcost=16 | ||
65 | |||
66 | ifndef CONFIG_ARC_HAS_HW_MPY | 62 | ifndef CONFIG_ARC_HAS_HW_MPY |
67 | cflags-y += -mno-mpy | 63 | cflags-y += -mno-mpy |
68 | |||
69 | # newlib for ARC700 assumes MPY to be always present, which is generally true | ||
70 | # However, if someone really doesn't want MPY, we need to use the 600 ver | ||
71 | # which coupled with -mno-mpy will use mpy emulation | ||
72 | # With gcc 4.4.7, -mno-mpy is enough to make any other related adjustments, | ||
73 | # e.g. increased cost of MPY. With gcc 4.2.1 this had to be explicitly hinted | ||
74 | |||
75 | ifeq ($(upto_gcc42),y) | ||
76 | ARC_LIBGCC := -marc600 | ||
77 | cflags-y += -multcost=30 | ||
78 | endif | ||
79 | endif | 64 | endif |
80 | 65 | ||
81 | LIBGCC := $(shell $(CC) $(ARC_LIBGCC) $(cflags-y) --print-libgcc-file-name) | 66 | LIBGCC := $(shell $(CC) $(cflags-y) --print-libgcc-file-name) |
82 | 67 | ||
83 | # Modules with short calls might break for calls into builtin-kernel | 68 | # Modules with short calls might break for calls into builtin-kernel |
84 | KBUILD_CFLAGS_MODULE += -mlong-calls | 69 | KBUILD_CFLAGS_MODULE += -mlong-calls |
diff --git a/arch/arc/boot/dts/angel4.dts b/arch/arc/boot/dts/angel4.dts index 6b57475967a6..757e0c62c4f9 100644 --- a/arch/arc/boot/dts/angel4.dts +++ b/arch/arc/boot/dts/angel4.dts | |||
@@ -24,11 +24,6 @@ | |||
24 | serial0 = &arcuart0; | 24 | serial0 = &arcuart0; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | memory { | ||
28 | device_type = "memory"; | ||
29 | reg = <0x00000000 0x10000000>; /* 256M */ | ||
30 | }; | ||
31 | |||
32 | fpga { | 27 | fpga { |
33 | compatible = "simple-bus"; | 28 | compatible = "simple-bus"; |
34 | #address-cells = <1>; | 29 | #address-cells = <1>; |
diff --git a/arch/arc/boot/dts/nsimosci.dts b/arch/arc/boot/dts/nsimosci.dts index 4f31b2eb5cdf..cfaedd9c61c9 100644 --- a/arch/arc/boot/dts/nsimosci.dts +++ b/arch/arc/boot/dts/nsimosci.dts | |||
@@ -20,18 +20,13 @@ | |||
20 | /* this is for console on PGU */ | 20 | /* this is for console on PGU */ |
21 | /* bootargs = "console=tty0 consoleblank=0"; */ | 21 | /* bootargs = "console=tty0 consoleblank=0"; */ |
22 | /* this is for console on serial */ | 22 | /* this is for console on serial */ |
23 | bootargs = "earlycon=uart8250,mmio32,0xc0000000,115200n8 console=ttyS0,115200n8 consoleblank=0 debug"; | 23 | bootargs = "earlycon=uart8250,mmio32,0xc0000000,115200n8 console=tty0 console=ttyS0,115200n8 consoleblank=0 debug"; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | aliases { | 26 | aliases { |
27 | serial0 = &uart0; | 27 | serial0 = &uart0; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | memory { | ||
31 | device_type = "memory"; | ||
32 | reg = <0x80000000 0x10000000>; /* 256M */ | ||
33 | }; | ||
34 | |||
35 | fpga { | 30 | fpga { |
36 | compatible = "simple-bus"; | 31 | compatible = "simple-bus"; |
37 | #address-cells = <1>; | 32 | #address-cells = <1>; |
diff --git a/arch/arc/configs/fpga_defconfig b/arch/arc/configs/fpga_defconfig index e283aa586934..ef4d3bc7b6c0 100644 --- a/arch/arc/configs/fpga_defconfig +++ b/arch/arc/configs/fpga_defconfig | |||
@@ -23,7 +23,6 @@ CONFIG_MODULES=y | |||
23 | # CONFIG_IOSCHED_DEADLINE is not set | 23 | # CONFIG_IOSCHED_DEADLINE is not set |
24 | # CONFIG_IOSCHED_CFQ is not set | 24 | # CONFIG_IOSCHED_CFQ is not set |
25 | CONFIG_ARC_PLAT_FPGA_LEGACY=y | 25 | CONFIG_ARC_PLAT_FPGA_LEGACY=y |
26 | CONFIG_ARC_BOARD_ML509=y | ||
27 | # CONFIG_ARC_HAS_RTSC is not set | 26 | # CONFIG_ARC_HAS_RTSC is not set |
28 | CONFIG_ARC_BUILTIN_DTB_NAME="angel4" | 27 | CONFIG_ARC_BUILTIN_DTB_NAME="angel4" |
29 | CONFIG_PREEMPT=y | 28 | CONFIG_PREEMPT=y |
diff --git a/arch/arc/configs/fpga_noramfs_defconfig b/arch/arc/configs/fpga_noramfs_defconfig index 5276a52f6a2f..49c93011ab96 100644 --- a/arch/arc/configs/fpga_noramfs_defconfig +++ b/arch/arc/configs/fpga_noramfs_defconfig | |||
@@ -20,7 +20,6 @@ CONFIG_MODULES=y | |||
20 | # CONFIG_IOSCHED_DEADLINE is not set | 20 | # CONFIG_IOSCHED_DEADLINE is not set |
21 | # CONFIG_IOSCHED_CFQ is not set | 21 | # CONFIG_IOSCHED_CFQ is not set |
22 | CONFIG_ARC_PLAT_FPGA_LEGACY=y | 22 | CONFIG_ARC_PLAT_FPGA_LEGACY=y |
23 | CONFIG_ARC_BOARD_ML509=y | ||
24 | # CONFIG_ARC_HAS_RTSC is not set | 23 | # CONFIG_ARC_HAS_RTSC is not set |
25 | CONFIG_ARC_BUILTIN_DTB_NAME="angel4" | 24 | CONFIG_ARC_BUILTIN_DTB_NAME="angel4" |
26 | CONFIG_PREEMPT=y | 25 | CONFIG_PREEMPT=y |
diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig index c01ba35a4eff..278dacf2a3f9 100644 --- a/arch/arc/configs/nsimosci_defconfig +++ b/arch/arc/configs/nsimosci_defconfig | |||
@@ -21,7 +21,6 @@ CONFIG_MODULES=y | |||
21 | # CONFIG_IOSCHED_DEADLINE is not set | 21 | # CONFIG_IOSCHED_DEADLINE is not set |
22 | # CONFIG_IOSCHED_CFQ is not set | 22 | # CONFIG_IOSCHED_CFQ is not set |
23 | CONFIG_ARC_PLAT_FPGA_LEGACY=y | 23 | CONFIG_ARC_PLAT_FPGA_LEGACY=y |
24 | CONFIG_ARC_BOARD_ML509=y | ||
25 | # CONFIG_ARC_IDE is not set | 24 | # CONFIG_ARC_IDE is not set |
26 | # CONFIG_ARCTANGENT_EMAC is not set | 25 | # CONFIG_ARCTANGENT_EMAC is not set |
27 | # CONFIG_ARC_HAS_RTSC is not set | 26 | # CONFIG_ARC_HAS_RTSC is not set |
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h index 372466b371bf..be33db8a2ee3 100644 --- a/arch/arc/include/asm/arcregs.h +++ b/arch/arc/include/asm/arcregs.h | |||
@@ -9,19 +9,16 @@ | |||
9 | #ifndef _ASM_ARC_ARCREGS_H | 9 | #ifndef _ASM_ARC_ARCREGS_H |
10 | #define _ASM_ARC_ARCREGS_H | 10 | #define _ASM_ARC_ARCREGS_H |
11 | 11 | ||
12 | #ifdef __KERNEL__ | ||
13 | |||
14 | /* Build Configuration Registers */ | 12 | /* Build Configuration Registers */ |
15 | #define ARC_REG_DCCMBASE_BCR 0x61 /* DCCM Base Addr */ | 13 | #define ARC_REG_DCCMBASE_BCR 0x61 /* DCCM Base Addr */ |
16 | #define ARC_REG_CRC_BCR 0x62 | 14 | #define ARC_REG_CRC_BCR 0x62 |
17 | #define ARC_REG_DVFB_BCR 0x64 | ||
18 | #define ARC_REG_EXTARITH_BCR 0x65 | ||
19 | #define ARC_REG_VECBASE_BCR 0x68 | 15 | #define ARC_REG_VECBASE_BCR 0x68 |
20 | #define ARC_REG_PERIBASE_BCR 0x69 | 16 | #define ARC_REG_PERIBASE_BCR 0x69 |
21 | #define ARC_REG_FP_BCR 0x6B /* Single-Precision FPU */ | 17 | #define ARC_REG_FP_BCR 0x6B /* ARCompact: Single-Precision FPU */ |
22 | #define ARC_REG_DPFP_BCR 0x6C /* Dbl Precision FPU */ | 18 | #define ARC_REG_DPFP_BCR 0x6C /* ARCompact: Dbl Precision FPU */ |
23 | #define ARC_REG_DCCM_BCR 0x74 /* DCCM Present + SZ */ | 19 | #define ARC_REG_DCCM_BCR 0x74 /* DCCM Present + SZ */ |
24 | #define ARC_REG_TIMERS_BCR 0x75 | 20 | #define ARC_REG_TIMERS_BCR 0x75 |
21 | #define ARC_REG_AP_BCR 0x76 | ||
25 | #define ARC_REG_ICCM_BCR 0x78 | 22 | #define ARC_REG_ICCM_BCR 0x78 |
26 | #define ARC_REG_XY_MEM_BCR 0x79 | 23 | #define ARC_REG_XY_MEM_BCR 0x79 |
27 | #define ARC_REG_MAC_BCR 0x7a | 24 | #define ARC_REG_MAC_BCR 0x7a |
@@ -31,6 +28,9 @@ | |||
31 | #define ARC_REG_MIXMAX_BCR 0x7e | 28 | #define ARC_REG_MIXMAX_BCR 0x7e |
32 | #define ARC_REG_BARREL_BCR 0x7f | 29 | #define ARC_REG_BARREL_BCR 0x7f |
33 | #define ARC_REG_D_UNCACH_BCR 0x6A | 30 | #define ARC_REG_D_UNCACH_BCR 0x6A |
31 | #define ARC_REG_BPU_BCR 0xc0 | ||
32 | #define ARC_REG_ISA_CFG_BCR 0xc1 | ||
33 | #define ARC_REG_SMART_BCR 0xFF | ||
34 | 34 | ||
35 | /* status32 Bits Positions */ | 35 | /* status32 Bits Positions */ |
36 | #define STATUS_AE_BIT 5 /* Exception active */ | 36 | #define STATUS_AE_BIT 5 /* Exception active */ |
@@ -191,14 +191,6 @@ | |||
191 | #define PAGES_TO_KB(n_pages) ((n_pages) << (PAGE_SHIFT - 10)) | 191 | #define PAGES_TO_KB(n_pages) ((n_pages) << (PAGE_SHIFT - 10)) |
192 | #define PAGES_TO_MB(n_pages) (PAGES_TO_KB(n_pages) >> 10) | 192 | #define PAGES_TO_MB(n_pages) (PAGES_TO_KB(n_pages) >> 10) |
193 | 193 | ||
194 | #ifdef CONFIG_ARC_FPU_SAVE_RESTORE | ||
195 | /* These DPFP regs need to be saved/restored across ctx-sw */ | ||
196 | struct arc_fpu { | ||
197 | struct { | ||
198 | unsigned int l, h; | ||
199 | } aux_dpfp[2]; | ||
200 | }; | ||
201 | #endif | ||
202 | 194 | ||
203 | /* | 195 | /* |
204 | *************************************************************** | 196 | *************************************************************** |
@@ -212,27 +204,19 @@ struct bcr_identity { | |||
212 | #endif | 204 | #endif |
213 | }; | 205 | }; |
214 | 206 | ||
215 | #define EXTN_SWAP_VALID 0x1 | 207 | struct bcr_isa { |
216 | #define EXTN_NORM_VALID 0x2 | ||
217 | #define EXTN_MINMAX_VALID 0x2 | ||
218 | #define EXTN_BARREL_VALID 0x2 | ||
219 | |||
220 | struct bcr_extn { | ||
221 | #ifdef CONFIG_CPU_BIG_ENDIAN | 208 | #ifdef CONFIG_CPU_BIG_ENDIAN |
222 | unsigned int pad:20, crc:1, ext_arith:2, mul:2, barrel:2, minmax:2, | 209 | unsigned int pad1:23, atomic1:1, ver:8; |
223 | norm:2, swap:1; | ||
224 | #else | 210 | #else |
225 | unsigned int swap:1, norm:2, minmax:2, barrel:2, mul:2, ext_arith:2, | 211 | unsigned int ver:8, atomic1:1, pad1:23; |
226 | crc:1, pad:20; | ||
227 | #endif | 212 | #endif |
228 | }; | 213 | }; |
229 | 214 | ||
230 | /* DSP Options Ref Manual */ | 215 | struct bcr_mpy { |
231 | struct bcr_extn_mac_mul { | ||
232 | #ifdef CONFIG_CPU_BIG_ENDIAN | 216 | #ifdef CONFIG_CPU_BIG_ENDIAN |
233 | unsigned int pad:16, type:8, ver:8; | 217 | unsigned int pad:8, x1616:8, dsp:4, cycles:2, type:2, ver:8; |
234 | #else | 218 | #else |
235 | unsigned int ver:8, type:8, pad:16; | 219 | unsigned int ver:8, type:2, cycles:2, dsp:4, x1616:8, pad:8; |
236 | #endif | 220 | #endif |
237 | }; | 221 | }; |
238 | 222 | ||
@@ -251,6 +235,7 @@ struct bcr_perip { | |||
251 | unsigned int pad:8, sz:8, pad2:8, start:8; | 235 | unsigned int pad:8, sz:8, pad2:8, start:8; |
252 | #endif | 236 | #endif |
253 | }; | 237 | }; |
238 | |||
254 | struct bcr_iccm { | 239 | struct bcr_iccm { |
255 | #ifdef CONFIG_CPU_BIG_ENDIAN | 240 | #ifdef CONFIG_CPU_BIG_ENDIAN |
256 | unsigned int base:16, pad:5, sz:3, ver:8; | 241 | unsigned int base:16, pad:5, sz:3, ver:8; |
@@ -277,8 +262,8 @@ struct bcr_dccm { | |||
277 | #endif | 262 | #endif |
278 | }; | 263 | }; |
279 | 264 | ||
280 | /* Both SP and DP FPU BCRs have same format */ | 265 | /* ARCompact: Both SP and DP FPU BCRs have same format */ |
281 | struct bcr_fp { | 266 | struct bcr_fp_arcompact { |
282 | #ifdef CONFIG_CPU_BIG_ENDIAN | 267 | #ifdef CONFIG_CPU_BIG_ENDIAN |
283 | unsigned int fast:1, ver:8; | 268 | unsigned int fast:1, ver:8; |
284 | #else | 269 | #else |
@@ -286,6 +271,30 @@ struct bcr_fp { | |||
286 | #endif | 271 | #endif |
287 | }; | 272 | }; |
288 | 273 | ||
274 | struct bcr_timer { | ||
275 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
276 | unsigned int pad2:15, rtsc:1, pad1:6, t1:1, t0:1, ver:8; | ||
277 | #else | ||
278 | unsigned int ver:8, t0:1, t1:1, pad1:6, rtsc:1, pad2:15; | ||
279 | #endif | ||
280 | }; | ||
281 | |||
282 | struct bcr_bpu_arcompact { | ||
283 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
284 | unsigned int pad2:19, fam:1, pad:2, ent:2, ver:8; | ||
285 | #else | ||
286 | unsigned int ver:8, ent:2, pad:2, fam:1, pad2:19; | ||
287 | #endif | ||
288 | }; | ||
289 | |||
290 | struct bcr_generic { | ||
291 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
292 | unsigned int pad:24, ver:8; | ||
293 | #else | ||
294 | unsigned int ver:8, pad:24; | ||
295 | #endif | ||
296 | }; | ||
297 | |||
289 | /* | 298 | /* |
290 | ******************************************************************* | 299 | ******************************************************************* |
291 | * Generic structures to hold build configuration used at runtime | 300 | * Generic structures to hold build configuration used at runtime |
@@ -299,6 +308,10 @@ struct cpuinfo_arc_cache { | |||
299 | unsigned int sz_k:8, line_len:8, assoc:4, ver:4, alias:1, vipt:1, pad:6; | 308 | unsigned int sz_k:8, line_len:8, assoc:4, ver:4, alias:1, vipt:1, pad:6; |
300 | }; | 309 | }; |
301 | 310 | ||
311 | struct cpuinfo_arc_bpu { | ||
312 | unsigned int ver, full, num_cache, num_pred; | ||
313 | }; | ||
314 | |||
302 | struct cpuinfo_arc_ccm { | 315 | struct cpuinfo_arc_ccm { |
303 | unsigned int base_addr, sz; | 316 | unsigned int base_addr, sz; |
304 | }; | 317 | }; |
@@ -306,21 +319,25 @@ struct cpuinfo_arc_ccm { | |||
306 | struct cpuinfo_arc { | 319 | struct cpuinfo_arc { |
307 | struct cpuinfo_arc_cache icache, dcache; | 320 | struct cpuinfo_arc_cache icache, dcache; |
308 | struct cpuinfo_arc_mmu mmu; | 321 | struct cpuinfo_arc_mmu mmu; |
322 | struct cpuinfo_arc_bpu bpu; | ||
309 | struct bcr_identity core; | 323 | struct bcr_identity core; |
310 | unsigned int timers; | 324 | struct bcr_isa isa; |
325 | struct bcr_timer timers; | ||
311 | unsigned int vec_base; | 326 | unsigned int vec_base; |
312 | unsigned int uncached_base; | 327 | unsigned int uncached_base; |
313 | struct cpuinfo_arc_ccm iccm, dccm; | 328 | struct cpuinfo_arc_ccm iccm, dccm; |
314 | struct bcr_extn extn; | 329 | struct { |
330 | unsigned int swap:1, norm:1, minmax:1, barrel:1, crc:1, pad1:3, | ||
331 | fpu_sp:1, fpu_dp:1, pad2:6, | ||
332 | debug:1, ap:1, smart:1, rtt:1, pad3:4, | ||
333 | pad4:8; | ||
334 | } extn; | ||
335 | struct bcr_mpy extn_mpy; | ||
315 | struct bcr_extn_xymem extn_xymem; | 336 | struct bcr_extn_xymem extn_xymem; |
316 | struct bcr_extn_mac_mul extn_mac_mul; | ||
317 | struct bcr_fp fp, dpfp; | ||
318 | }; | 337 | }; |
319 | 338 | ||
320 | extern struct cpuinfo_arc cpuinfo_arc700[]; | 339 | extern struct cpuinfo_arc cpuinfo_arc700[]; |
321 | 340 | ||
322 | #endif /* __ASEMBLY__ */ | 341 | #endif /* __ASEMBLY__ */ |
323 | 342 | ||
324 | #endif /* __KERNEL__ */ | ||
325 | |||
326 | #endif /* _ASM_ARC_ARCREGS_H */ | 343 | #endif /* _ASM_ARC_ARCREGS_H */ |
diff --git a/arch/arc/include/asm/atomic.h b/arch/arc/include/asm/atomic.h index 173f303a868f..067551b6920a 100644 --- a/arch/arc/include/asm/atomic.h +++ b/arch/arc/include/asm/atomic.h | |||
@@ -9,8 +9,6 @@ | |||
9 | #ifndef _ASM_ARC_ATOMIC_H | 9 | #ifndef _ASM_ARC_ATOMIC_H |
10 | #define _ASM_ARC_ATOMIC_H | 10 | #define _ASM_ARC_ATOMIC_H |
11 | 11 | ||
12 | #ifdef __KERNEL__ | ||
13 | |||
14 | #ifndef __ASSEMBLY__ | 12 | #ifndef __ASSEMBLY__ |
15 | 13 | ||
16 | #include <linux/types.h> | 14 | #include <linux/types.h> |
@@ -170,5 +168,3 @@ ATOMIC_OP(and, &=, and) | |||
170 | #endif | 168 | #endif |
171 | 169 | ||
172 | #endif | 170 | #endif |
173 | |||
174 | #endif | ||
diff --git a/arch/arc/include/asm/bitops.h b/arch/arc/include/asm/bitops.h index ebc0cf3164dc..1a5bf07eefe2 100644 --- a/arch/arc/include/asm/bitops.h +++ b/arch/arc/include/asm/bitops.h | |||
@@ -13,8 +13,6 @@ | |||
13 | #error only <linux/bitops.h> can be included directly | 13 | #error only <linux/bitops.h> can be included directly |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | #ifdef __KERNEL__ | ||
17 | |||
18 | #ifndef __ASSEMBLY__ | 16 | #ifndef __ASSEMBLY__ |
19 | 17 | ||
20 | #include <linux/types.h> | 18 | #include <linux/types.h> |
@@ -508,6 +506,4 @@ static inline __attribute__ ((const)) int __ffs(unsigned long word) | |||
508 | 506 | ||
509 | #endif /* !__ASSEMBLY__ */ | 507 | #endif /* !__ASSEMBLY__ */ |
510 | 508 | ||
511 | #endif /* __KERNEL__ */ | ||
512 | |||
513 | #endif | 509 | #endif |
diff --git a/arch/arc/include/asm/bug.h b/arch/arc/include/asm/bug.h index 5b18e94c6678..ea022d47896c 100644 --- a/arch/arc/include/asm/bug.h +++ b/arch/arc/include/asm/bug.h | |||
@@ -21,10 +21,9 @@ void show_kernel_fault_diag(const char *str, struct pt_regs *regs, | |||
21 | unsigned long address); | 21 | unsigned long address); |
22 | void die(const char *str, struct pt_regs *regs, unsigned long address); | 22 | void die(const char *str, struct pt_regs *regs, unsigned long address); |
23 | 23 | ||
24 | #define BUG() do { \ | 24 | #define BUG() do { \ |
25 | dump_stack(); \ | 25 | pr_warn("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ |
26 | pr_warn("Kernel BUG in %s: %s: %d!\n", \ | 26 | dump_stack(); \ |
27 | __FILE__, __func__, __LINE__); \ | ||
28 | } while (0) | 27 | } while (0) |
29 | 28 | ||
30 | #define HAVE_ARCH_BUG | 29 | #define HAVE_ARCH_BUG |
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h index b3c750979aa1..7861255da32d 100644 --- a/arch/arc/include/asm/cache.h +++ b/arch/arc/include/asm/cache.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #define CACHE_LINE_MASK (~(L1_CACHE_BYTES - 1)) | 20 | #define CACHE_LINE_MASK (~(L1_CACHE_BYTES - 1)) |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * ARC700 doesn't cache any access in top 256M. | 23 | * ARC700 doesn't cache any access in top 1G (0xc000_0000 to 0xFFFF_FFFF) |
24 | * Ideal for wiring memory mapped peripherals as we don't need to do | 24 | * Ideal for wiring memory mapped peripherals as we don't need to do |
25 | * explicit uncached accesses (LD.di/ST.di) hence more portable drivers | 25 | * explicit uncached accesses (LD.di/ST.di) hence more portable drivers |
26 | */ | 26 | */ |
diff --git a/arch/arc/include/asm/current.h b/arch/arc/include/asm/current.h index 87b918585c4a..c2453ee62801 100644 --- a/arch/arc/include/asm/current.h +++ b/arch/arc/include/asm/current.h | |||
@@ -12,8 +12,6 @@ | |||
12 | #ifndef _ASM_ARC_CURRENT_H | 12 | #ifndef _ASM_ARC_CURRENT_H |
13 | #define _ASM_ARC_CURRENT_H | 13 | #define _ASM_ARC_CURRENT_H |
14 | 14 | ||
15 | #ifdef __KERNEL__ | ||
16 | |||
17 | #ifndef __ASSEMBLY__ | 15 | #ifndef __ASSEMBLY__ |
18 | 16 | ||
19 | #ifdef CONFIG_ARC_CURR_IN_REG | 17 | #ifdef CONFIG_ARC_CURR_IN_REG |
@@ -27,6 +25,4 @@ register struct task_struct *curr_arc asm("r25"); | |||
27 | 25 | ||
28 | #endif /* ! __ASSEMBLY__ */ | 26 | #endif /* ! __ASSEMBLY__ */ |
29 | 27 | ||
30 | #endif /* __KERNEL__ */ | ||
31 | |||
32 | #endif /* _ASM_ARC_CURRENT_H */ | 28 | #endif /* _ASM_ARC_CURRENT_H */ |
diff --git a/arch/arc/include/asm/irqflags.h b/arch/arc/include/asm/irqflags.h index 587df8236e8b..742816f1b210 100644 --- a/arch/arc/include/asm/irqflags.h +++ b/arch/arc/include/asm/irqflags.h | |||
@@ -15,8 +15,6 @@ | |||
15 | * -Conditionally disable interrupts (if they are not enabled, don't disable) | 15 | * -Conditionally disable interrupts (if they are not enabled, don't disable) |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #ifdef __KERNEL__ | ||
19 | |||
20 | #include <asm/arcregs.h> | 18 | #include <asm/arcregs.h> |
21 | 19 | ||
22 | /* status32 Reg bits related to Interrupt Handling */ | 20 | /* status32 Reg bits related to Interrupt Handling */ |
@@ -169,6 +167,4 @@ static inline int arch_irqs_disabled(void) | |||
169 | 167 | ||
170 | #endif /* __ASSEMBLY__ */ | 168 | #endif /* __ASSEMBLY__ */ |
171 | 169 | ||
172 | #endif /* KERNEL */ | ||
173 | |||
174 | #endif | 170 | #endif |
diff --git a/arch/arc/include/asm/kgdb.h b/arch/arc/include/asm/kgdb.h index b65fca7ffeb5..fea931634136 100644 --- a/arch/arc/include/asm/kgdb.h +++ b/arch/arc/include/asm/kgdb.h | |||
@@ -19,7 +19,7 @@ | |||
19 | * register API yet */ | 19 | * register API yet */ |
20 | #undef DBG_MAX_REG_NUM | 20 | #undef DBG_MAX_REG_NUM |
21 | 21 | ||
22 | #define GDB_MAX_REGS 39 | 22 | #define GDB_MAX_REGS 87 |
23 | 23 | ||
24 | #define BREAK_INSTR_SIZE 2 | 24 | #define BREAK_INSTR_SIZE 2 |
25 | #define CACHE_FLUSH_IS_SAFE 1 | 25 | #define CACHE_FLUSH_IS_SAFE 1 |
@@ -33,23 +33,27 @@ static inline void arch_kgdb_breakpoint(void) | |||
33 | 33 | ||
34 | extern void kgdb_trap(struct pt_regs *regs); | 34 | extern void kgdb_trap(struct pt_regs *regs); |
35 | 35 | ||
36 | enum arc700_linux_regnums { | 36 | /* This is the numbering of registers according to the GDB. See GDB's |
37 | * arc-tdep.h for details. | ||
38 | * | ||
39 | * Registers are ordered for GDB 7.5. It is incompatible with GDB 6.8. */ | ||
40 | enum arc_linux_regnums { | ||
37 | _R0 = 0, | 41 | _R0 = 0, |
38 | _R1, _R2, _R3, _R4, _R5, _R6, _R7, _R8, _R9, _R10, _R11, _R12, _R13, | 42 | _R1, _R2, _R3, _R4, _R5, _R6, _R7, _R8, _R9, _R10, _R11, _R12, _R13, |
39 | _R14, _R15, _R16, _R17, _R18, _R19, _R20, _R21, _R22, _R23, _R24, | 43 | _R14, _R15, _R16, _R17, _R18, _R19, _R20, _R21, _R22, _R23, _R24, |
40 | _R25, _R26, | 44 | _R25, _R26, |
41 | _BTA = 27, | 45 | _FP = 27, |
42 | _LP_START = 28, | 46 | __SP = 28, |
43 | _LP_END = 29, | 47 | _R30 = 30, |
44 | _LP_COUNT = 30, | 48 | _BLINK = 31, |
45 | _STATUS32 = 31, | 49 | _LP_COUNT = 60, |
46 | _BLINK = 32, | 50 | _STOP_PC = 64, |
47 | _FP = 33, | 51 | _RET = 64, |
48 | __SP = 34, | 52 | _LP_START = 65, |
49 | _EFA = 35, | 53 | _LP_END = 66, |
50 | _RET = 36, | 54 | _STATUS32 = 67, |
51 | _ORIG_R8 = 37, | 55 | _ECR = 76, |
52 | _STOP_PC = 38 | 56 | _BTA = 82, |
53 | }; | 57 | }; |
54 | 58 | ||
55 | #else | 59 | #else |
diff --git a/arch/arc/include/asm/processor.h b/arch/arc/include/asm/processor.h index 82588f3ba77f..210fe97464c3 100644 --- a/arch/arc/include/asm/processor.h +++ b/arch/arc/include/asm/processor.h | |||
@@ -14,12 +14,19 @@ | |||
14 | #ifndef __ASM_ARC_PROCESSOR_H | 14 | #ifndef __ASM_ARC_PROCESSOR_H |
15 | #define __ASM_ARC_PROCESSOR_H | 15 | #define __ASM_ARC_PROCESSOR_H |
16 | 16 | ||
17 | #ifdef __KERNEL__ | ||
18 | |||
19 | #ifndef __ASSEMBLY__ | 17 | #ifndef __ASSEMBLY__ |
20 | 18 | ||
21 | #include <asm/ptrace.h> | 19 | #include <asm/ptrace.h> |
22 | 20 | ||
21 | #ifdef CONFIG_ARC_FPU_SAVE_RESTORE | ||
22 | /* These DPFP regs need to be saved/restored across ctx-sw */ | ||
23 | struct arc_fpu { | ||
24 | struct { | ||
25 | unsigned int l, h; | ||
26 | } aux_dpfp[2]; | ||
27 | }; | ||
28 | #endif | ||
29 | |||
23 | /* Arch specific stuff which needs to be saved per task. | 30 | /* Arch specific stuff which needs to be saved per task. |
24 | * However these items are not so important so as to earn a place in | 31 | * However these items are not so important so as to earn a place in |
25 | * struct thread_info | 32 | * struct thread_info |
@@ -128,6 +135,4 @@ extern unsigned int get_wchan(struct task_struct *p); | |||
128 | */ | 135 | */ |
129 | #define TASK_UNMAPPED_BASE (TASK_SIZE / 3) | 136 | #define TASK_UNMAPPED_BASE (TASK_SIZE / 3) |
130 | 137 | ||
131 | #endif /* __KERNEL__ */ | ||
132 | |||
133 | #endif /* __ASM_ARC_PROCESSOR_H */ | 138 | #endif /* __ASM_ARC_PROCESSOR_H */ |
diff --git a/arch/arc/include/asm/setup.h b/arch/arc/include/asm/setup.h index e10f8cef56a8..6e3ef5ba4f74 100644 --- a/arch/arc/include/asm/setup.h +++ b/arch/arc/include/asm/setup.h | |||
@@ -29,7 +29,6 @@ struct cpuinfo_data { | |||
29 | }; | 29 | }; |
30 | 30 | ||
31 | extern int root_mountflags, end_mem; | 31 | extern int root_mountflags, end_mem; |
32 | extern int running_on_hw; | ||
33 | 32 | ||
34 | void setup_processor(void); | 33 | void setup_processor(void); |
35 | void __init setup_arch_memory(void); | 34 | void __init setup_arch_memory(void); |
diff --git a/arch/arc/include/asm/smp.h b/arch/arc/include/asm/smp.h index 5d06eee43ea9..3845b9e94f69 100644 --- a/arch/arc/include/asm/smp.h +++ b/arch/arc/include/asm/smp.h | |||
@@ -59,7 +59,15 @@ struct plat_smp_ops { | |||
59 | /* TBD: stop exporting it for direct population by platform */ | 59 | /* TBD: stop exporting it for direct population by platform */ |
60 | extern struct plat_smp_ops plat_smp_ops; | 60 | extern struct plat_smp_ops plat_smp_ops; |
61 | 61 | ||
62 | #endif /* CONFIG_SMP */ | 62 | #else /* CONFIG_SMP */ |
63 | |||
64 | static inline void smp_init_cpus(void) {} | ||
65 | static inline const char *arc_platform_smp_cpuinfo(void) | ||
66 | { | ||
67 | return ""; | ||
68 | } | ||
69 | |||
70 | #endif /* !CONFIG_SMP */ | ||
63 | 71 | ||
64 | /* | 72 | /* |
65 | * ARC700 doesn't support atomic Read-Modify-Write ops. | 73 | * ARC700 doesn't support atomic Read-Modify-Write ops. |
diff --git a/arch/arc/include/asm/string.h b/arch/arc/include/asm/string.h index 87676c8f1412..95822b550a18 100644 --- a/arch/arc/include/asm/string.h +++ b/arch/arc/include/asm/string.h | |||
@@ -17,8 +17,6 @@ | |||
17 | 17 | ||
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | 19 | ||
20 | #ifdef __KERNEL__ | ||
21 | |||
22 | #define __HAVE_ARCH_MEMSET | 20 | #define __HAVE_ARCH_MEMSET |
23 | #define __HAVE_ARCH_MEMCPY | 21 | #define __HAVE_ARCH_MEMCPY |
24 | #define __HAVE_ARCH_MEMCMP | 22 | #define __HAVE_ARCH_MEMCMP |
@@ -36,5 +34,4 @@ extern char *strcpy(char *dest, const char *src); | |||
36 | extern int strcmp(const char *cs, const char *ct); | 34 | extern int strcmp(const char *cs, const char *ct); |
37 | extern __kernel_size_t strlen(const char *); | 35 | extern __kernel_size_t strlen(const char *); |
38 | 36 | ||
39 | #endif /* __KERNEL__ */ | ||
40 | #endif /* _ASM_ARC_STRING_H */ | 37 | #endif /* _ASM_ARC_STRING_H */ |
diff --git a/arch/arc/include/asm/syscalls.h b/arch/arc/include/asm/syscalls.h index dd785befe7fd..e56f9fcc5581 100644 --- a/arch/arc/include/asm/syscalls.h +++ b/arch/arc/include/asm/syscalls.h | |||
@@ -9,8 +9,6 @@ | |||
9 | #ifndef _ASM_ARC_SYSCALLS_H | 9 | #ifndef _ASM_ARC_SYSCALLS_H |
10 | #define _ASM_ARC_SYSCALLS_H 1 | 10 | #define _ASM_ARC_SYSCALLS_H 1 |
11 | 11 | ||
12 | #ifdef __KERNEL__ | ||
13 | |||
14 | #include <linux/compiler.h> | 12 | #include <linux/compiler.h> |
15 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
16 | #include <linux/types.h> | 14 | #include <linux/types.h> |
@@ -22,6 +20,4 @@ int sys_arc_gettls(void); | |||
22 | 20 | ||
23 | #include <asm-generic/syscalls.h> | 21 | #include <asm-generic/syscalls.h> |
24 | 22 | ||
25 | #endif /* __KERNEL__ */ | ||
26 | |||
27 | #endif | 23 | #endif |
diff --git a/arch/arc/include/asm/thread_info.h b/arch/arc/include/asm/thread_info.h index 45be21672011..02bc5ec0fb2e 100644 --- a/arch/arc/include/asm/thread_info.h +++ b/arch/arc/include/asm/thread_info.h | |||
@@ -16,8 +16,6 @@ | |||
16 | #ifndef _ASM_THREAD_INFO_H | 16 | #ifndef _ASM_THREAD_INFO_H |
17 | #define _ASM_THREAD_INFO_H | 17 | #define _ASM_THREAD_INFO_H |
18 | 18 | ||
19 | #ifdef __KERNEL__ | ||
20 | |||
21 | #include <asm/page.h> | 19 | #include <asm/page.h> |
22 | 20 | ||
23 | #ifdef CONFIG_16KSTACKS | 21 | #ifdef CONFIG_16KSTACKS |
@@ -114,6 +112,4 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void) | |||
114 | * syscall, so all that reamins to be tested is _TIF_WORK_MASK | 112 | * syscall, so all that reamins to be tested is _TIF_WORK_MASK |
115 | */ | 113 | */ |
116 | 114 | ||
117 | #endif /* __KERNEL__ */ | ||
118 | |||
119 | #endif /* _ASM_THREAD_INFO_H */ | 115 | #endif /* _ASM_THREAD_INFO_H */ |
diff --git a/arch/arc/include/asm/unaligned.h b/arch/arc/include/asm/unaligned.h index 3e5f071bc00c..6da6b4edaeda 100644 --- a/arch/arc/include/asm/unaligned.h +++ b/arch/arc/include/asm/unaligned.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <asm-generic/unaligned.h> | 14 | #include <asm-generic/unaligned.h> |
15 | #include <asm/ptrace.h> | 15 | #include <asm/ptrace.h> |
16 | 16 | ||
17 | #ifdef CONFIG_ARC_MISALIGN_ACCESS | 17 | #ifdef CONFIG_ARC_EMUL_UNALIGNED |
18 | int misaligned_fixup(unsigned long address, struct pt_regs *regs, | 18 | int misaligned_fixup(unsigned long address, struct pt_regs *regs, |
19 | struct callee_regs *cregs); | 19 | struct callee_regs *cregs); |
20 | #else | 20 | #else |
diff --git a/arch/arc/kernel/Makefile b/arch/arc/kernel/Makefile index 8004b4fa6461..113f2033da9f 100644 --- a/arch/arc/kernel/Makefile +++ b/arch/arc/kernel/Makefile | |||
@@ -16,7 +16,7 @@ obj-$(CONFIG_MODULES) += arcksyms.o module.o | |||
16 | obj-$(CONFIG_SMP) += smp.o | 16 | obj-$(CONFIG_SMP) += smp.o |
17 | obj-$(CONFIG_ARC_DW2_UNWIND) += unwind.o | 17 | obj-$(CONFIG_ARC_DW2_UNWIND) += unwind.o |
18 | obj-$(CONFIG_KPROBES) += kprobes.o | 18 | obj-$(CONFIG_KPROBES) += kprobes.o |
19 | obj-$(CONFIG_ARC_MISALIGN_ACCESS) += unaligned.o | 19 | obj-$(CONFIG_ARC_EMUL_UNALIGNED) += unaligned.o |
20 | obj-$(CONFIG_KGDB) += kgdb.o | 20 | obj-$(CONFIG_KGDB) += kgdb.o |
21 | obj-$(CONFIG_ARC_METAWARE_HLINK) += arc_hostlink.o | 21 | obj-$(CONFIG_ARC_METAWARE_HLINK) += arc_hostlink.o |
22 | obj-$(CONFIG_PERF_EVENTS) += perf_event.o | 22 | obj-$(CONFIG_PERF_EVENTS) += perf_event.o |
diff --git a/arch/arc/kernel/disasm.c b/arch/arc/kernel/disasm.c index b8a549c4f540..3b7cd4864ba2 100644 --- a/arch/arc/kernel/disasm.c +++ b/arch/arc/kernel/disasm.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/uaccess.h> | 15 | #include <linux/uaccess.h> |
16 | #include <asm/disasm.h> | 16 | #include <asm/disasm.h> |
17 | 17 | ||
18 | #if defined(CONFIG_KGDB) || defined(CONFIG_ARC_MISALIGN_ACCESS) || \ | 18 | #if defined(CONFIG_KGDB) || defined(CONFIG_ARC_EMUL_UNALIGNED) || \ |
19 | defined(CONFIG_KPROBES) | 19 | defined(CONFIG_KPROBES) |
20 | 20 | ||
21 | /* disasm_instr: Analyses instruction at addr, stores | 21 | /* disasm_instr: Analyses instruction at addr, stores |
@@ -535,4 +535,4 @@ int __kprobes disasm_next_pc(unsigned long pc, struct pt_regs *regs, | |||
535 | return instr.is_branch; | 535 | return instr.is_branch; |
536 | } | 536 | } |
537 | 537 | ||
538 | #endif /* CONFIG_KGDB || CONFIG_ARC_MISALIGN_ACCESS || CONFIG_KPROBES */ | 538 | #endif /* CONFIG_KGDB || CONFIG_ARC_EMUL_UNALIGNED || CONFIG_KPROBES */ |
diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S index 4d2481bd8b98..b0e8666fdccc 100644 --- a/arch/arc/kernel/head.S +++ b/arch/arc/kernel/head.S | |||
@@ -91,16 +91,6 @@ stext: | |||
91 | st r0, [@uboot_tag] | 91 | st r0, [@uboot_tag] |
92 | st r2, [@uboot_arg] | 92 | st r2, [@uboot_arg] |
93 | 93 | ||
94 | ; Identify if running on ISS vs Silicon | ||
95 | ; IDENTITY Reg [ 3 2 1 0 ] | ||
96 | ; (chip-id) ^^^^^ ==> 0xffff for ISS | ||
97 | lr r0, [identity] | ||
98 | lsr r3, r0, 16 | ||
99 | cmp r3, 0xffff | ||
100 | mov.z r4, 0 | ||
101 | mov.nz r4, 1 | ||
102 | st r4, [@running_on_hw] | ||
103 | |||
104 | ; setup "current" tsk and optionally cache it in dedicated r25 | 94 | ; setup "current" tsk and optionally cache it in dedicated r25 |
105 | mov r9, @init_task | 95 | mov r9, @init_task |
106 | SET_CURR_TASK_ON_CPU r9, r0 ; r9 = tsk, r0 = scratch | 96 | SET_CURR_TASK_ON_CPU r9, r0 ; r9 = tsk, r0 = scratch |
diff --git a/arch/arc/kernel/kgdb.c b/arch/arc/kernel/kgdb.c index a2ff5c5d1450..ecf6a7869375 100644 --- a/arch/arc/kernel/kgdb.c +++ b/arch/arc/kernel/kgdb.c | |||
@@ -158,11 +158,6 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code, | |||
158 | return -1; | 158 | return -1; |
159 | } | 159 | } |
160 | 160 | ||
161 | unsigned long kgdb_arch_pc(int exception, struct pt_regs *regs) | ||
162 | { | ||
163 | return instruction_pointer(regs); | ||
164 | } | ||
165 | |||
166 | int kgdb_arch_init(void) | 161 | int kgdb_arch_init(void) |
167 | { | 162 | { |
168 | single_step_data.armed = 0; | 163 | single_step_data.armed = 0; |
diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c index b9a5685a990e..ae1c485cbc68 100644 --- a/arch/arc/kernel/perf_event.c +++ b/arch/arc/kernel/perf_event.c | |||
@@ -244,25 +244,23 @@ static int arc_pmu_device_probe(struct platform_device *pdev) | |||
244 | pr_err("This core does not have performance counters!\n"); | 244 | pr_err("This core does not have performance counters!\n"); |
245 | return -ENODEV; | 245 | return -ENODEV; |
246 | } | 246 | } |
247 | BUG_ON(pct_bcr.c > ARC_PMU_MAX_HWEVENTS); | ||
247 | 248 | ||
248 | arc_pmu = devm_kzalloc(&pdev->dev, sizeof(struct arc_pmu), | 249 | READ_BCR(ARC_REG_CC_BUILD, cc_bcr); |
249 | GFP_KERNEL); | 250 | if (!cc_bcr.v) { |
251 | pr_err("Performance counters exist, but no countable conditions?\n"); | ||
252 | return -ENODEV; | ||
253 | } | ||
254 | |||
255 | arc_pmu = devm_kzalloc(&pdev->dev, sizeof(struct arc_pmu), GFP_KERNEL); | ||
250 | if (!arc_pmu) | 256 | if (!arc_pmu) |
251 | return -ENOMEM; | 257 | return -ENOMEM; |
252 | 258 | ||
253 | arc_pmu->n_counters = pct_bcr.c; | 259 | arc_pmu->n_counters = pct_bcr.c; |
254 | BUG_ON(arc_pmu->n_counters > ARC_PMU_MAX_HWEVENTS); | ||
255 | |||
256 | arc_pmu->counter_size = 32 + (pct_bcr.s << 4); | 260 | arc_pmu->counter_size = 32 + (pct_bcr.s << 4); |
257 | pr_info("ARC PMU found with %d counters of size %d bits\n", | ||
258 | arc_pmu->n_counters, arc_pmu->counter_size); | ||
259 | |||
260 | READ_BCR(ARC_REG_CC_BUILD, cc_bcr); | ||
261 | |||
262 | if (!cc_bcr.v) | ||
263 | pr_err("Strange! Performance counters exist, but no countable conditions?\n"); | ||
264 | 261 | ||
265 | pr_info("ARC PMU has %d countable conditions\n", cc_bcr.c); | 262 | pr_info("ARC perf\t: %d counters (%d bits), %d countable conditions\n", |
263 | arc_pmu->n_counters, arc_pmu->counter_size, cc_bcr.c); | ||
266 | 264 | ||
267 | cc_name.str[8] = 0; | 265 | cc_name.str[8] = 0; |
268 | for (i = 0; i < PERF_COUNT_HW_MAX; i++) | 266 | for (i = 0; i < PERF_COUNT_HW_MAX; i++) |
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 119dddb752b2..252bf603db9c 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c | |||
@@ -13,7 +13,9 @@ | |||
13 | #include <linux/console.h> | 13 | #include <linux/console.h> |
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/cpu.h> | 15 | #include <linux/cpu.h> |
16 | #include <linux/clk-provider.h> | ||
16 | #include <linux/of_fdt.h> | 17 | #include <linux/of_fdt.h> |
18 | #include <linux/of_platform.h> | ||
17 | #include <linux/cache.h> | 19 | #include <linux/cache.h> |
18 | #include <asm/sections.h> | 20 | #include <asm/sections.h> |
19 | #include <asm/arcregs.h> | 21 | #include <asm/arcregs.h> |
@@ -24,11 +26,10 @@ | |||
24 | #include <asm/unwind.h> | 26 | #include <asm/unwind.h> |
25 | #include <asm/clk.h> | 27 | #include <asm/clk.h> |
26 | #include <asm/mach_desc.h> | 28 | #include <asm/mach_desc.h> |
29 | #include <asm/smp.h> | ||
27 | 30 | ||
28 | #define FIX_PTR(x) __asm__ __volatile__(";" : "+r"(x)) | 31 | #define FIX_PTR(x) __asm__ __volatile__(";" : "+r"(x)) |
29 | 32 | ||
30 | int running_on_hw = 1; /* vs. on ISS */ | ||
31 | |||
32 | /* Part of U-boot ABI: see head.S */ | 33 | /* Part of U-boot ABI: see head.S */ |
33 | int __initdata uboot_tag; | 34 | int __initdata uboot_tag; |
34 | char __initdata *uboot_arg; | 35 | char __initdata *uboot_arg; |
@@ -42,26 +43,26 @@ struct cpuinfo_arc cpuinfo_arc700[NR_CPUS]; | |||
42 | static void read_arc_build_cfg_regs(void) | 43 | static void read_arc_build_cfg_regs(void) |
43 | { | 44 | { |
44 | struct bcr_perip uncached_space; | 45 | struct bcr_perip uncached_space; |
46 | struct bcr_generic bcr; | ||
45 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; | 47 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; |
46 | FIX_PTR(cpu); | 48 | FIX_PTR(cpu); |
47 | 49 | ||
48 | READ_BCR(AUX_IDENTITY, cpu->core); | 50 | READ_BCR(AUX_IDENTITY, cpu->core); |
51 | READ_BCR(ARC_REG_ISA_CFG_BCR, cpu->isa); | ||
49 | 52 | ||
50 | cpu->timers = read_aux_reg(ARC_REG_TIMERS_BCR); | 53 | READ_BCR(ARC_REG_TIMERS_BCR, cpu->timers); |
51 | cpu->vec_base = read_aux_reg(AUX_INTR_VEC_BASE); | 54 | cpu->vec_base = read_aux_reg(AUX_INTR_VEC_BASE); |
52 | 55 | ||
53 | READ_BCR(ARC_REG_D_UNCACH_BCR, uncached_space); | 56 | READ_BCR(ARC_REG_D_UNCACH_BCR, uncached_space); |
54 | cpu->uncached_base = uncached_space.start << 24; | 57 | cpu->uncached_base = uncached_space.start << 24; |
55 | 58 | ||
56 | cpu->extn.mul = read_aux_reg(ARC_REG_MUL_BCR); | 59 | READ_BCR(ARC_REG_MUL_BCR, cpu->extn_mpy); |
57 | cpu->extn.swap = read_aux_reg(ARC_REG_SWAP_BCR); | ||
58 | cpu->extn.norm = read_aux_reg(ARC_REG_NORM_BCR); | ||
59 | cpu->extn.minmax = read_aux_reg(ARC_REG_MIXMAX_BCR); | ||
60 | cpu->extn.barrel = read_aux_reg(ARC_REG_BARREL_BCR); | ||
61 | READ_BCR(ARC_REG_MAC_BCR, cpu->extn_mac_mul); | ||
62 | 60 | ||
63 | cpu->extn.ext_arith = read_aux_reg(ARC_REG_EXTARITH_BCR); | 61 | cpu->extn.norm = read_aux_reg(ARC_REG_NORM_BCR) > 1 ? 1 : 0; /* 2,3 */ |
64 | cpu->extn.crc = read_aux_reg(ARC_REG_CRC_BCR); | 62 | cpu->extn.barrel = read_aux_reg(ARC_REG_BARREL_BCR) > 1 ? 1 : 0; /* 2,3 */ |
63 | cpu->extn.swap = read_aux_reg(ARC_REG_SWAP_BCR) ? 1 : 0; /* 1,3 */ | ||
64 | cpu->extn.crc = read_aux_reg(ARC_REG_CRC_BCR) ? 1 : 0; | ||
65 | cpu->extn.minmax = read_aux_reg(ARC_REG_MIXMAX_BCR) > 1 ? 1 : 0; /* 2 */ | ||
65 | 66 | ||
66 | /* Note that we read the CCM BCRs independent of kernel config | 67 | /* Note that we read the CCM BCRs independent of kernel config |
67 | * This is to catch the cases where user doesn't know that | 68 | * This is to catch the cases where user doesn't know that |
@@ -95,43 +96,76 @@ static void read_arc_build_cfg_regs(void) | |||
95 | read_decode_mmu_bcr(); | 96 | read_decode_mmu_bcr(); |
96 | read_decode_cache_bcr(); | 97 | read_decode_cache_bcr(); |
97 | 98 | ||
98 | READ_BCR(ARC_REG_FP_BCR, cpu->fp); | 99 | { |
99 | READ_BCR(ARC_REG_DPFP_BCR, cpu->dpfp); | 100 | struct bcr_fp_arcompact sp, dp; |
101 | struct bcr_bpu_arcompact bpu; | ||
102 | |||
103 | READ_BCR(ARC_REG_FP_BCR, sp); | ||
104 | READ_BCR(ARC_REG_DPFP_BCR, dp); | ||
105 | cpu->extn.fpu_sp = sp.ver ? 1 : 0; | ||
106 | cpu->extn.fpu_dp = dp.ver ? 1 : 0; | ||
107 | |||
108 | READ_BCR(ARC_REG_BPU_BCR, bpu); | ||
109 | cpu->bpu.ver = bpu.ver; | ||
110 | cpu->bpu.full = bpu.fam ? 1 : 0; | ||
111 | if (bpu.ent) { | ||
112 | cpu->bpu.num_cache = 256 << (bpu.ent - 1); | ||
113 | cpu->bpu.num_pred = 256 << (bpu.ent - 1); | ||
114 | } | ||
115 | } | ||
116 | |||
117 | READ_BCR(ARC_REG_AP_BCR, bcr); | ||
118 | cpu->extn.ap = bcr.ver ? 1 : 0; | ||
119 | |||
120 | READ_BCR(ARC_REG_SMART_BCR, bcr); | ||
121 | cpu->extn.smart = bcr.ver ? 1 : 0; | ||
122 | |||
123 | cpu->extn.debug = cpu->extn.ap | cpu->extn.smart; | ||
100 | } | 124 | } |
101 | 125 | ||
102 | static const struct cpuinfo_data arc_cpu_tbl[] = { | 126 | static const struct cpuinfo_data arc_cpu_tbl[] = { |
103 | { {0x10, "ARCTangent A5"}, 0x1F}, | ||
104 | { {0x20, "ARC 600" }, 0x2F}, | 127 | { {0x20, "ARC 600" }, 0x2F}, |
105 | { {0x30, "ARC 700" }, 0x33}, | 128 | { {0x30, "ARC 700" }, 0x33}, |
106 | { {0x34, "ARC 700 R4.10"}, 0x34}, | 129 | { {0x34, "ARC 700 R4.10"}, 0x34}, |
130 | { {0x35, "ARC 700 R4.11"}, 0x35}, | ||
107 | { {0x00, NULL } } | 131 | { {0x00, NULL } } |
108 | }; | 132 | }; |
109 | 133 | ||
134 | #define IS_AVAIL1(v, str) ((v) ? str : "") | ||
135 | #define IS_USED(cfg) (IS_ENABLED(cfg) ? "" : "(not used) ") | ||
136 | #define IS_AVAIL2(v, str, cfg) IS_AVAIL1(v, str), IS_AVAIL1(v, IS_USED(cfg)) | ||
137 | |||
110 | static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) | 138 | static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) |
111 | { | 139 | { |
112 | int n = 0; | ||
113 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[cpu_id]; | 140 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[cpu_id]; |
114 | struct bcr_identity *core = &cpu->core; | 141 | struct bcr_identity *core = &cpu->core; |
115 | const struct cpuinfo_data *tbl; | 142 | const struct cpuinfo_data *tbl; |
116 | int be = 0; | 143 | char *isa_nm; |
117 | #ifdef CONFIG_CPU_BIG_ENDIAN | 144 | int i, be, atomic; |
118 | be = 1; | 145 | int n = 0; |
119 | #endif | 146 | |
120 | FIX_PTR(cpu); | 147 | FIX_PTR(cpu); |
121 | 148 | ||
149 | { | ||
150 | isa_nm = "ARCompact"; | ||
151 | be = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN); | ||
152 | |||
153 | atomic = cpu->isa.atomic1; | ||
154 | if (!cpu->isa.ver) /* ISA BCR absent, use Kconfig info */ | ||
155 | atomic = IS_ENABLED(CONFIG_ARC_HAS_LLSC); | ||
156 | } | ||
157 | |||
122 | n += scnprintf(buf + n, len - n, | 158 | n += scnprintf(buf + n, len - n, |
123 | "\nARC IDENTITY\t: Family [%#02x]" | 159 | "\nIDENTITY\t: ARCVER [%#02x] ARCNUM [%#02x] CHIPID [%#4x]\n", |
124 | " Cpu-id [%#02x] Chip-id [%#4x]\n", | 160 | core->family, core->cpu_id, core->chip_id); |
125 | core->family, core->cpu_id, | ||
126 | core->chip_id); | ||
127 | 161 | ||
128 | for (tbl = &arc_cpu_tbl[0]; tbl->info.id != 0; tbl++) { | 162 | for (tbl = &arc_cpu_tbl[0]; tbl->info.id != 0; tbl++) { |
129 | if ((core->family >= tbl->info.id) && | 163 | if ((core->family >= tbl->info.id) && |
130 | (core->family <= tbl->up_range)) { | 164 | (core->family <= tbl->up_range)) { |
131 | n += scnprintf(buf + n, len - n, | 165 | n += scnprintf(buf + n, len - n, |
132 | "processor\t: %s %s\n", | 166 | "processor [%d]\t: %s (%s ISA) %s\n", |
133 | tbl->info.str, | 167 | cpu_id, tbl->info.str, isa_nm, |
134 | be ? "[Big Endian]" : ""); | 168 | IS_AVAIL1(be, "[Big-Endian]")); |
135 | break; | 169 | break; |
136 | } | 170 | } |
137 | } | 171 | } |
@@ -143,34 +177,35 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) | |||
143 | (unsigned int)(arc_get_core_freq() / 1000000), | 177 | (unsigned int)(arc_get_core_freq() / 1000000), |
144 | (unsigned int)(arc_get_core_freq() / 10000) % 100); | 178 | (unsigned int)(arc_get_core_freq() / 10000) % 100); |
145 | 179 | ||
146 | n += scnprintf(buf + n, len - n, "Timers\t\t: %s %s\n", | 180 | n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s%s%s\nISA Extn\t: ", |
147 | (cpu->timers & 0x200) ? "TIMER1" : "", | 181 | IS_AVAIL1(cpu->timers.t0, "Timer0 "), |
148 | (cpu->timers & 0x100) ? "TIMER0" : ""); | 182 | IS_AVAIL1(cpu->timers.t1, "Timer1 "), |
183 | IS_AVAIL2(cpu->timers.rtsc, "64-bit RTSC ", CONFIG_ARC_HAS_RTSC)); | ||
149 | 184 | ||
150 | n += scnprintf(buf + n, len - n, "Vect Tbl Base\t: %#x\n", | 185 | n += i = scnprintf(buf + n, len - n, "%s%s", |
151 | cpu->vec_base); | 186 | IS_AVAIL2(atomic, "atomic ", CONFIG_ARC_HAS_LLSC)); |
152 | 187 | ||
153 | n += scnprintf(buf + n, len - n, "UNCACHED Base\t: %#x\n", | 188 | if (i) |
154 | cpu->uncached_base); | 189 | n += scnprintf(buf + n, len - n, "\n\t\t: "); |
155 | 190 | ||
156 | return buf; | 191 | n += scnprintf(buf + n, len - n, "%s%s%s%s%s%s%s%s\n", |
157 | } | 192 | IS_AVAIL1(cpu->extn_mpy.ver, "mpy "), |
193 | IS_AVAIL1(cpu->extn.norm, "norm "), | ||
194 | IS_AVAIL1(cpu->extn.barrel, "barrel-shift "), | ||
195 | IS_AVAIL1(cpu->extn.swap, "swap "), | ||
196 | IS_AVAIL1(cpu->extn.minmax, "minmax "), | ||
197 | IS_AVAIL1(cpu->extn.crc, "crc "), | ||
198 | IS_AVAIL2(1, "swape", CONFIG_ARC_HAS_SWAPE)); | ||
158 | 199 | ||
159 | static const struct id_to_str mul_type_nm[] = { | 200 | if (cpu->bpu.ver) |
160 | { 0x0, "N/A"}, | 201 | n += scnprintf(buf + n, len - n, |
161 | { 0x1, "32x32 (spl Result Reg)" }, | 202 | "BPU\t\t: %s%s match, cache:%d, Predict Table:%d\n", |
162 | { 0x2, "32x32 (ANY Result Reg)" } | 203 | IS_AVAIL1(cpu->bpu.full, "full"), |
163 | }; | 204 | IS_AVAIL1(!cpu->bpu.full, "partial"), |
205 | cpu->bpu.num_cache, cpu->bpu.num_pred); | ||
164 | 206 | ||
165 | static const struct id_to_str mac_mul_nm[] = { | 207 | return buf; |
166 | {0x0, "N/A"}, | 208 | } |
167 | {0x1, "N/A"}, | ||
168 | {0x2, "Dual 16 x 16"}, | ||
169 | {0x3, "N/A"}, | ||
170 | {0x4, "32x16"}, | ||
171 | {0x5, "N/A"}, | ||
172 | {0x6, "Dual 16x16 and 32x16"} | ||
173 | }; | ||
174 | 209 | ||
175 | static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len) | 210 | static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len) |
176 | { | 211 | { |
@@ -178,67 +213,46 @@ static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len) | |||
178 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[cpu_id]; | 213 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[cpu_id]; |
179 | 214 | ||
180 | FIX_PTR(cpu); | 215 | FIX_PTR(cpu); |
181 | #define IS_AVAIL1(var, str) ((var) ? str : "") | ||
182 | #define IS_AVAIL2(var, str) ((var == 0x2) ? str : "") | ||
183 | #define IS_USED(cfg) (IS_ENABLED(cfg) ? "(in-use)" : "(not used)") | ||
184 | 216 | ||
185 | n += scnprintf(buf + n, len - n, | 217 | n += scnprintf(buf + n, len - n, |
186 | "Extn [700-Base]\t: %s %s %s %s %s %s\n", | 218 | "Vector Table\t: %#x\nUncached Base\t: %#x\n", |
187 | IS_AVAIL2(cpu->extn.norm, "norm,"), | 219 | cpu->vec_base, cpu->uncached_base); |
188 | IS_AVAIL2(cpu->extn.barrel, "barrel-shift,"), | 220 | |
189 | IS_AVAIL1(cpu->extn.swap, "swap,"), | 221 | if (cpu->extn.fpu_sp || cpu->extn.fpu_dp) |
190 | IS_AVAIL2(cpu->extn.minmax, "minmax,"), | 222 | n += scnprintf(buf + n, len - n, "FPU\t\t: %s%s\n", |
191 | IS_AVAIL1(cpu->extn.crc, "crc,"), | 223 | IS_AVAIL1(cpu->extn.fpu_sp, "SP "), |
192 | IS_AVAIL2(cpu->extn.ext_arith, "ext-arith")); | 224 | IS_AVAIL1(cpu->extn.fpu_dp, "DP ")); |
193 | 225 | ||
194 | n += scnprintf(buf + n, len - n, "Extn [700-MPY]\t: %s", | 226 | if (cpu->extn.debug) |
195 | mul_type_nm[cpu->extn.mul].str); | 227 | n += scnprintf(buf + n, len - n, "DEBUG\t\t: %s%s%s\n", |
196 | 228 | IS_AVAIL1(cpu->extn.ap, "ActionPoint "), | |
197 | n += scnprintf(buf + n, len - n, " MAC MPY: %s\n", | 229 | IS_AVAIL1(cpu->extn.smart, "smaRT "), |
198 | mac_mul_nm[cpu->extn_mac_mul.type].str); | 230 | IS_AVAIL1(cpu->extn.rtt, "RTT ")); |
199 | 231 | ||
200 | if (cpu->core.family == 0x34) { | 232 | if (cpu->dccm.sz || cpu->iccm.sz) |
201 | n += scnprintf(buf + n, len - n, | 233 | n += scnprintf(buf + n, len - n, "Extn [CCM]\t: DCCM @ %x, %d KB / ICCM: @ %x, %d KB\n", |
202 | "Extn [700-4.10]\t: LLOCK/SCOND %s, SWAPE %s, RTSC %s\n", | 234 | cpu->dccm.base_addr, TO_KB(cpu->dccm.sz), |
203 | IS_USED(CONFIG_ARC_HAS_LLSC), | ||
204 | IS_USED(CONFIG_ARC_HAS_SWAPE), | ||
205 | IS_USED(CONFIG_ARC_HAS_RTSC)); | ||
206 | } | ||
207 | |||
208 | n += scnprintf(buf + n, len - n, "Extn [CCM]\t: %s", | ||
209 | !(cpu->dccm.sz || cpu->iccm.sz) ? "N/A" : ""); | ||
210 | |||
211 | if (cpu->dccm.sz) | ||
212 | n += scnprintf(buf + n, len - n, "DCCM: @ %x, %d KB ", | ||
213 | cpu->dccm.base_addr, TO_KB(cpu->dccm.sz)); | ||
214 | |||
215 | if (cpu->iccm.sz) | ||
216 | n += scnprintf(buf + n, len - n, "ICCM: @ %x, %d KB", | ||
217 | cpu->iccm.base_addr, TO_KB(cpu->iccm.sz)); | 235 | cpu->iccm.base_addr, TO_KB(cpu->iccm.sz)); |
218 | 236 | ||
219 | n += scnprintf(buf + n, len - n, "\nExtn [FPU]\t: %s", | ||
220 | !(cpu->fp.ver || cpu->dpfp.ver) ? "N/A" : ""); | ||
221 | |||
222 | if (cpu->fp.ver) | ||
223 | n += scnprintf(buf + n, len - n, "SP [v%d] %s", | ||
224 | cpu->fp.ver, cpu->fp.fast ? "(fast)" : ""); | ||
225 | |||
226 | if (cpu->dpfp.ver) | ||
227 | n += scnprintf(buf + n, len - n, "DP [v%d] %s", | ||
228 | cpu->dpfp.ver, cpu->dpfp.fast ? "(fast)" : ""); | ||
229 | |||
230 | n += scnprintf(buf + n, len - n, "\n"); | ||
231 | |||
232 | n += scnprintf(buf + n, len - n, | 237 | n += scnprintf(buf + n, len - n, |
233 | "OS ABI [v3]\t: no-legacy-syscalls\n"); | 238 | "OS ABI [v3]\t: no-legacy-syscalls\n"); |
234 | 239 | ||
235 | return buf; | 240 | return buf; |
236 | } | 241 | } |
237 | 242 | ||
238 | static void arc_chk_ccms(void) | 243 | static void arc_chk_core_config(void) |
239 | { | 244 | { |
240 | #if defined(CONFIG_ARC_HAS_DCCM) || defined(CONFIG_ARC_HAS_ICCM) | ||
241 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; | 245 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; |
246 | int fpu_enabled; | ||
247 | |||
248 | if (!cpu->timers.t0) | ||
249 | panic("Timer0 is not present!\n"); | ||
250 | |||
251 | if (!cpu->timers.t1) | ||
252 | panic("Timer1 is not present!\n"); | ||
253 | |||
254 | if (IS_ENABLED(CONFIG_ARC_HAS_RTSC) && !cpu->timers.rtsc) | ||
255 | panic("RTSC is not present\n"); | ||
242 | 256 | ||
243 | #ifdef CONFIG_ARC_HAS_DCCM | 257 | #ifdef CONFIG_ARC_HAS_DCCM |
244 | /* | 258 | /* |
@@ -256,33 +270,20 @@ static void arc_chk_ccms(void) | |||
256 | if (CONFIG_ARC_ICCM_SZ != cpu->iccm.sz) | 270 | if (CONFIG_ARC_ICCM_SZ != cpu->iccm.sz) |
257 | panic("Linux built with incorrect ICCM Size\n"); | 271 | panic("Linux built with incorrect ICCM Size\n"); |
258 | #endif | 272 | #endif |
259 | #endif | ||
260 | } | ||
261 | 273 | ||
262 | /* | 274 | /* |
263 | * Ensure that FP hardware and kernel config match | 275 | * FP hardware/software config sanity |
264 | * -If hardware contains DPFP, kernel needs to save/restore FPU state | 276 | * -If hardware contains DPFP, kernel needs to save/restore FPU state |
265 | * across context switches | 277 | * -If not, it will crash trying to save/restore the non-existant regs |
266 | * -If hardware lacks DPFP, but kernel configured to save FPU state then | 278 | * |
267 | * kernel trying to access non-existant DPFP regs will crash | 279 | * (only DPDP checked since SP has no arch visible regs) |
268 | * | 280 | */ |
269 | * We only check for Dbl precision Floating Point, because only DPFP | 281 | fpu_enabled = IS_ENABLED(CONFIG_ARC_FPU_SAVE_RESTORE); |
270 | * hardware has dedicated regs which need to be saved/restored on ctx-sw | ||
271 | * (Single Precision uses core regs), thus kernel is kind of oblivious to it | ||
272 | */ | ||
273 | static void arc_chk_fpu(void) | ||
274 | { | ||
275 | struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; | ||
276 | 282 | ||
277 | if (cpu->dpfp.ver) { | 283 | if (cpu->extn.fpu_dp && !fpu_enabled) |
278 | #ifndef CONFIG_ARC_FPU_SAVE_RESTORE | 284 | pr_warn("CONFIG_ARC_FPU_SAVE_RESTORE needed for working apps\n"); |
279 | pr_warn("DPFP support broken in this kernel...\n"); | 285 | else if (!cpu->extn.fpu_dp && fpu_enabled) |
280 | #endif | 286 | panic("FPU non-existent, disable CONFIG_ARC_FPU_SAVE_RESTORE\n"); |
281 | } else { | ||
282 | #ifdef CONFIG_ARC_FPU_SAVE_RESTORE | ||
283 | panic("H/w lacks DPFP support, apps won't work\n"); | ||
284 | #endif | ||
285 | } | ||
286 | } | 287 | } |
287 | 288 | ||
288 | /* | 289 | /* |
@@ -303,15 +304,11 @@ void setup_processor(void) | |||
303 | 304 | ||
304 | arc_mmu_init(); | 305 | arc_mmu_init(); |
305 | arc_cache_init(); | 306 | arc_cache_init(); |
306 | arc_chk_ccms(); | ||
307 | 307 | ||
308 | printk(arc_extn_mumbojumbo(cpu_id, str, sizeof(str))); | 308 | printk(arc_extn_mumbojumbo(cpu_id, str, sizeof(str))); |
309 | |||
310 | #ifdef CONFIG_SMP | ||
311 | printk(arc_platform_smp_cpuinfo()); | 309 | printk(arc_platform_smp_cpuinfo()); |
312 | #endif | ||
313 | 310 | ||
314 | arc_chk_fpu(); | 311 | arc_chk_core_config(); |
315 | } | 312 | } |
316 | 313 | ||
317 | static inline int is_kernel(unsigned long addr) | 314 | static inline int is_kernel(unsigned long addr) |
@@ -360,11 +357,7 @@ void __init setup_arch(char **cmdline_p) | |||
360 | machine_desc->init_early(); | 357 | machine_desc->init_early(); |
361 | 358 | ||
362 | setup_processor(); | 359 | setup_processor(); |
363 | |||
364 | #ifdef CONFIG_SMP | ||
365 | smp_init_cpus(); | 360 | smp_init_cpus(); |
366 | #endif | ||
367 | |||
368 | setup_arch_memory(); | 361 | setup_arch_memory(); |
369 | 362 | ||
370 | /* copy flat DT out of .init and then unflatten it */ | 363 | /* copy flat DT out of .init and then unflatten it */ |
@@ -385,7 +378,13 @@ void __init setup_arch(char **cmdline_p) | |||
385 | 378 | ||
386 | static int __init customize_machine(void) | 379 | static int __init customize_machine(void) |
387 | { | 380 | { |
388 | /* Add platform devices */ | 381 | of_clk_init(NULL); |
382 | /* | ||
383 | * Traverses flattened DeviceTree - registering platform devices | ||
384 | * (if any) complete with their resources | ||
385 | */ | ||
386 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
387 | |||
389 | if (machine_desc->init_machine) | 388 | if (machine_desc->init_machine) |
390 | machine_desc->init_machine(); | 389 | machine_desc->init_machine(); |
391 | 390 | ||
@@ -419,19 +418,14 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
419 | 418 | ||
420 | seq_printf(m, arc_cpu_mumbojumbo(cpu_id, str, PAGE_SIZE)); | 419 | seq_printf(m, arc_cpu_mumbojumbo(cpu_id, str, PAGE_SIZE)); |
421 | 420 | ||
422 | seq_printf(m, "Bogo MIPS : \t%lu.%02lu\n", | 421 | seq_printf(m, "Bogo MIPS\t: %lu.%02lu\n", |
423 | loops_per_jiffy / (500000 / HZ), | 422 | loops_per_jiffy / (500000 / HZ), |
424 | (loops_per_jiffy / (5000 / HZ)) % 100); | 423 | (loops_per_jiffy / (5000 / HZ)) % 100); |
425 | 424 | ||
426 | seq_printf(m, arc_mmu_mumbojumbo(cpu_id, str, PAGE_SIZE)); | 425 | seq_printf(m, arc_mmu_mumbojumbo(cpu_id, str, PAGE_SIZE)); |
427 | |||
428 | seq_printf(m, arc_cache_mumbojumbo(cpu_id, str, PAGE_SIZE)); | 426 | seq_printf(m, arc_cache_mumbojumbo(cpu_id, str, PAGE_SIZE)); |
429 | |||
430 | seq_printf(m, arc_extn_mumbojumbo(cpu_id, str, PAGE_SIZE)); | 427 | seq_printf(m, arc_extn_mumbojumbo(cpu_id, str, PAGE_SIZE)); |
431 | |||
432 | #ifdef CONFIG_SMP | ||
433 | seq_printf(m, arc_platform_smp_cpuinfo()); | 428 | seq_printf(m, arc_platform_smp_cpuinfo()); |
434 | #endif | ||
435 | 429 | ||
436 | free_page((unsigned long)str); | 430 | free_page((unsigned long)str); |
437 | done: | 431 | done: |
diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c index dcd317c47d09..d01df0c517a2 100644 --- a/arch/arc/kernel/smp.c +++ b/arch/arc/kernel/smp.c | |||
@@ -101,7 +101,7 @@ void __weak arc_platform_smp_wait_to_boot(int cpu) | |||
101 | 101 | ||
102 | const char *arc_platform_smp_cpuinfo(void) | 102 | const char *arc_platform_smp_cpuinfo(void) |
103 | { | 103 | { |
104 | return plat_smp_ops.info; | 104 | return plat_smp_ops.info ? : ""; |
105 | } | 105 | } |
106 | 106 | ||
107 | /* | 107 | /* |
diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c index 9e1142729fd1..8c3a3e02ba92 100644 --- a/arch/arc/mm/cache_arc700.c +++ b/arch/arc/mm/cache_arc700.c | |||
@@ -530,16 +530,9 @@ EXPORT_SYMBOL(dma_cache_wback); | |||
530 | */ | 530 | */ |
531 | void flush_icache_range(unsigned long kstart, unsigned long kend) | 531 | void flush_icache_range(unsigned long kstart, unsigned long kend) |
532 | { | 532 | { |
533 | unsigned int tot_sz, off, sz; | 533 | unsigned int tot_sz; |
534 | unsigned long phy, pfn; | ||
535 | 534 | ||
536 | /* printk("Kernel Cache Cohenercy: %lx to %lx\n",kstart, kend); */ | 535 | WARN(kstart < TASK_SIZE, "%s() can't handle user vaddr", __func__); |
537 | |||
538 | /* This is not the right API for user virtual address */ | ||
539 | if (kstart < TASK_SIZE) { | ||
540 | BUG_ON("Flush icache range for user virtual addr space"); | ||
541 | return; | ||
542 | } | ||
543 | 536 | ||
544 | /* Shortcut for bigger flush ranges. | 537 | /* Shortcut for bigger flush ranges. |
545 | * Here we don't care if this was kernel virtual or phy addr | 538 | * Here we don't care if this was kernel virtual or phy addr |
@@ -572,6 +565,9 @@ void flush_icache_range(unsigned long kstart, unsigned long kend) | |||
572 | * straddles across 2 virtual pages and hence need for loop | 565 | * straddles across 2 virtual pages and hence need for loop |
573 | */ | 566 | */ |
574 | while (tot_sz > 0) { | 567 | while (tot_sz > 0) { |
568 | unsigned int off, sz; | ||
569 | unsigned long phy, pfn; | ||
570 | |||
575 | off = kstart % PAGE_SIZE; | 571 | off = kstart % PAGE_SIZE; |
576 | pfn = vmalloc_to_pfn((void *)kstart); | 572 | pfn = vmalloc_to_pfn((void *)kstart); |
577 | phy = (pfn << PAGE_SHIFT) + off; | 573 | phy = (pfn << PAGE_SHIFT) + off; |
diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index e1acf0ce5647..7f47d2a56f44 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c | |||
@@ -609,14 +609,12 @@ char *arc_mmu_mumbojumbo(int cpu_id, char *buf, int len) | |||
609 | int n = 0; | 609 | int n = 0; |
610 | struct cpuinfo_arc_mmu *p_mmu = &cpuinfo_arc700[cpu_id].mmu; | 610 | struct cpuinfo_arc_mmu *p_mmu = &cpuinfo_arc700[cpu_id].mmu; |
611 | 611 | ||
612 | n += scnprintf(buf + n, len - n, "ARC700 MMU [v%x]\t: %dk PAGE, ", | ||
613 | p_mmu->ver, TO_KB(p_mmu->pg_sz)); | ||
614 | |||
615 | n += scnprintf(buf + n, len - n, | 612 | n += scnprintf(buf + n, len - n, |
616 | "J-TLB %d (%dx%d), uDTLB %d, uITLB %d, %s\n", | 613 | "MMU [v%x]\t: %dk PAGE, JTLB %d (%dx%d), uDTLB %d, uITLB %d %s\n", |
614 | p_mmu->ver, TO_KB(p_mmu->pg_sz), | ||
617 | p_mmu->num_tlb, p_mmu->sets, p_mmu->ways, | 615 | p_mmu->num_tlb, p_mmu->sets, p_mmu->ways, |
618 | p_mmu->u_dtlb, p_mmu->u_itlb, | 616 | p_mmu->u_dtlb, p_mmu->u_itlb, |
619 | IS_ENABLED(CONFIG_ARC_MMU_SASID) ? "SASID" : ""); | 617 | IS_ENABLED(CONFIG_ARC_MMU_SASID) ? ",SASID" : ""); |
620 | 618 | ||
621 | return buf; | 619 | return buf; |
622 | } | 620 | } |
diff --git a/arch/arc/plat-arcfpga/Kconfig b/arch/arc/plat-arcfpga/Kconfig index b9f34cf55acf..217593a70751 100644 --- a/arch/arc/plat-arcfpga/Kconfig +++ b/arch/arc/plat-arcfpga/Kconfig | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | menuconfig ARC_PLAT_FPGA_LEGACY | 9 | menuconfig ARC_PLAT_FPGA_LEGACY |
10 | bool "\"Legacy\" ARC FPGA dev Boards" | 10 | bool "\"Legacy\" ARC FPGA dev Boards" |
11 | select ISS_SMP_EXTN if SMP | 11 | select ARC_HAS_COH_CACHES if SMP |
12 | help | 12 | help |
13 | Support for ARC development boards, provided by Synopsys. | 13 | Support for ARC development boards, provided by Synopsys. |
14 | These are based on FPGA or ISS. e.g. | 14 | These are based on FPGA or ISS. e.g. |
@@ -18,17 +18,6 @@ menuconfig ARC_PLAT_FPGA_LEGACY | |||
18 | 18 | ||
19 | if ARC_PLAT_FPGA_LEGACY | 19 | if ARC_PLAT_FPGA_LEGACY |
20 | 20 | ||
21 | config ARC_BOARD_ANGEL4 | ||
22 | bool "ARC Angel4" | ||
23 | default y | ||
24 | help | ||
25 | ARC Angel4 FPGA Ref Platform (Xilinx Virtex Based) | ||
26 | |||
27 | config ARC_BOARD_ML509 | ||
28 | bool "ML509" | ||
29 | help | ||
30 | ARC ML509 FPGA Ref Platform (Xilinx Virtex-5 Based) | ||
31 | |||
32 | config ISS_SMP_EXTN | 21 | config ISS_SMP_EXTN |
33 | bool "ARC SMP Extensions (ISS Models only)" | 22 | bool "ARC SMP Extensions (ISS Models only)" |
34 | default n | 23 | default n |
diff --git a/arch/arc/plat-arcfpga/include/plat/irq.h b/arch/arc/plat-arcfpga/include/plat/irq.h deleted file mode 100644 index 2c9dea690ac4..000000000000 --- a/arch/arc/plat-arcfpga/include/plat/irq.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * vineetg: Feb 2009 | ||
9 | * -For AA4 board, IRQ assignments to peripherals | ||
10 | */ | ||
11 | |||
12 | #ifndef __PLAT_IRQ_H | ||
13 | #define __PLAT_IRQ_H | ||
14 | |||
15 | #define UART0_IRQ 5 | ||
16 | #define UART1_IRQ 10 | ||
17 | #define UART2_IRQ 11 | ||
18 | |||
19 | #define IDE_IRQ 13 | ||
20 | #define PCI_IRQ 14 | ||
21 | #define PS2_IRQ 15 | ||
22 | |||
23 | #ifdef CONFIG_SMP | ||
24 | #define IDU_INTERRUPT_0 16 | ||
25 | #endif | ||
26 | |||
27 | #endif | ||
diff --git a/arch/arc/plat-arcfpga/include/plat/memmap.h b/arch/arc/plat-arcfpga/include/plat/memmap.h deleted file mode 100644 index 5c78e6135a1f..000000000000 --- a/arch/arc/plat-arcfpga/include/plat/memmap.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * vineetg: Feb 2009 | ||
9 | * -For AA4 board, System Memory Map for Peripherals etc | ||
10 | */ | ||
11 | |||
12 | #ifndef __PLAT_MEMMAP_H | ||
13 | #define __PLAT_MEMMAP_H | ||
14 | |||
15 | #define UART0_BASE 0xC0FC1000 | ||
16 | #define UART1_BASE 0xC0FC1100 | ||
17 | |||
18 | #define IDE_CONTROLLER_BASE 0xC0FC9000 | ||
19 | |||
20 | #define AHB_PCI_HOST_BRG_BASE 0xC0FD0000 | ||
21 | |||
22 | #define PGU_BASEADDR 0xC0FC8000 | ||
23 | #define VLCK_ADDR 0xC0FCF028 | ||
24 | |||
25 | #define BVCI_LAT_UNIT_BASE 0xC0FED000 | ||
26 | |||
27 | #define PS2_BASE_ADDR 0xC0FCC000 | ||
28 | |||
29 | #endif | ||
diff --git a/arch/arc/plat-arcfpga/platform.c b/arch/arc/plat-arcfpga/platform.c index 1038949a99a1..afc88254acc1 100644 --- a/arch/arc/plat-arcfpga/platform.c +++ b/arch/arc/plat-arcfpga/platform.c | |||
@@ -8,37 +8,9 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/types.h> | ||
12 | #include <linux/init.h> | 11 | #include <linux/init.h> |
13 | #include <linux/device.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/console.h> | ||
17 | #include <linux/of_platform.h> | ||
18 | #include <asm/setup.h> | ||
19 | #include <asm/clk.h> | ||
20 | #include <asm/mach_desc.h> | 12 | #include <asm/mach_desc.h> |
21 | #include <plat/memmap.h> | ||
22 | #include <plat/smp.h> | 13 | #include <plat/smp.h> |
23 | #include <plat/irq.h> | ||
24 | |||
25 | static void __init plat_fpga_early_init(void) | ||
26 | { | ||
27 | pr_info("[plat-arcfpga]: registering early dev resources\n"); | ||
28 | |||
29 | #ifdef CONFIG_ISS_SMP_EXTN | ||
30 | iss_model_init_early_smp(); | ||
31 | #endif | ||
32 | } | ||
33 | |||
34 | static void __init plat_fpga_populate_dev(void) | ||
35 | { | ||
36 | /* | ||
37 | * Traverses flattened DeviceTree - registering platform devices | ||
38 | * (if any) complete with their resources | ||
39 | */ | ||
40 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
41 | } | ||
42 | 14 | ||
43 | /*----------------------- Machine Descriptions ------------------------------ | 15 | /*----------------------- Machine Descriptions ------------------------------ |
44 | * | 16 | * |
@@ -48,41 +20,26 @@ static void __init plat_fpga_populate_dev(void) | |||
48 | * callback set, by matching the DT compatible name. | 20 | * callback set, by matching the DT compatible name. |
49 | */ | 21 | */ |
50 | 22 | ||
51 | static const char *aa4_compat[] __initconst = { | 23 | static const char *legacy_fpga_compat[] __initconst = { |
52 | "snps,arc-angel4", | 24 | "snps,arc-angel4", |
53 | NULL, | ||
54 | }; | ||
55 | |||
56 | MACHINE_START(ANGEL4, "angel4") | ||
57 | .dt_compat = aa4_compat, | ||
58 | .init_early = plat_fpga_early_init, | ||
59 | .init_machine = plat_fpga_populate_dev, | ||
60 | #ifdef CONFIG_ISS_SMP_EXTN | ||
61 | .init_smp = iss_model_init_smp, | ||
62 | #endif | ||
63 | MACHINE_END | ||
64 | |||
65 | static const char *ml509_compat[] __initconst = { | ||
66 | "snps,arc-ml509", | 25 | "snps,arc-ml509", |
67 | NULL, | 26 | NULL, |
68 | }; | 27 | }; |
69 | 28 | ||
70 | MACHINE_START(ML509, "ml509") | 29 | MACHINE_START(LEGACY_FPGA, "legacy_fpga") |
71 | .dt_compat = ml509_compat, | 30 | .dt_compat = legacy_fpga_compat, |
72 | .init_early = plat_fpga_early_init, | 31 | #ifdef CONFIG_ISS_SMP_EXTN |
73 | .init_machine = plat_fpga_populate_dev, | 32 | .init_early = iss_model_init_early_smp, |
74 | #ifdef CONFIG_SMP | ||
75 | .init_smp = iss_model_init_smp, | 33 | .init_smp = iss_model_init_smp, |
76 | #endif | 34 | #endif |
77 | MACHINE_END | 35 | MACHINE_END |
78 | 36 | ||
79 | static const char *nsimosci_compat[] __initconst = { | 37 | static const char *simulation_compat[] __initconst = { |
38 | "snps,nsim", | ||
80 | "snps,nsimosci", | 39 | "snps,nsimosci", |
81 | NULL, | 40 | NULL, |
82 | }; | 41 | }; |
83 | 42 | ||
84 | MACHINE_START(NSIMOSCI, "nsimosci") | 43 | MACHINE_START(SIMULATION, "simulation") |
85 | .dt_compat = nsimosci_compat, | 44 | .dt_compat = simulation_compat, |
86 | .init_early = NULL, | ||
87 | .init_machine = plat_fpga_populate_dev, | ||
88 | MACHINE_END | 45 | MACHINE_END |
diff --git a/arch/arc/plat-arcfpga/smp.c b/arch/arc/plat-arcfpga/smp.c index 92bad9122077..64797ba3bbe3 100644 --- a/arch/arc/plat-arcfpga/smp.c +++ b/arch/arc/plat-arcfpga/smp.c | |||
@@ -13,9 +13,10 @@ | |||
13 | 13 | ||
14 | #include <linux/smp.h> | 14 | #include <linux/smp.h> |
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #include <plat/irq.h> | ||
17 | #include <plat/smp.h> | 16 | #include <plat/smp.h> |
18 | 17 | ||
18 | #define IDU_INTERRUPT_0 16 | ||
19 | |||
19 | static char smp_cpuinfo_buf[128]; | 20 | static char smp_cpuinfo_buf[128]; |
20 | 21 | ||
21 | /* | 22 | /* |
diff --git a/arch/arc/plat-tb10x/Kconfig b/arch/arc/plat-tb10x/Kconfig index 6994c188dc88..d14b3d3c5dfd 100644 --- a/arch/arc/plat-tb10x/Kconfig +++ b/arch/arc/plat-tb10x/Kconfig | |||
@@ -18,7 +18,6 @@ | |||
18 | 18 | ||
19 | menuconfig ARC_PLAT_TB10X | 19 | menuconfig ARC_PLAT_TB10X |
20 | bool "Abilis TB10x" | 20 | bool "Abilis TB10x" |
21 | select COMMON_CLK | ||
22 | select PINCTRL | 21 | select PINCTRL |
23 | select PINCTRL_TB10X | 22 | select PINCTRL_TB10X |
24 | select PINMUX | 23 | select PINMUX |
diff --git a/arch/arc/plat-tb10x/tb10x.c b/arch/arc/plat-tb10x/tb10x.c index 06cb30929460..da0ac0960a4b 100644 --- a/arch/arc/plat-tb10x/tb10x.c +++ b/arch/arc/plat-tb10x/tb10x.c | |||
@@ -19,21 +19,9 @@ | |||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | */ | 20 | */ |
21 | 21 | ||
22 | |||
23 | #include <linux/init.h> | 22 | #include <linux/init.h> |
24 | #include <linux/of_platform.h> | ||
25 | #include <linux/clk-provider.h> | ||
26 | #include <linux/pinctrl/consumer.h> | ||
27 | |||
28 | #include <asm/mach_desc.h> | 23 | #include <asm/mach_desc.h> |
29 | 24 | ||
30 | |||
31 | static void __init tb10x_platform_init(void) | ||
32 | { | ||
33 | of_clk_init(NULL); | ||
34 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
35 | } | ||
36 | |||
37 | static const char *tb10x_compat[] __initdata = { | 25 | static const char *tb10x_compat[] __initdata = { |
38 | "abilis,arc-tb10x", | 26 | "abilis,arc-tb10x", |
39 | NULL, | 27 | NULL, |
@@ -41,5 +29,4 @@ static const char *tb10x_compat[] __initdata = { | |||
41 | 29 | ||
42 | MACHINE_START(TB10x, "tb10x") | 30 | MACHINE_START(TB10x, "tb10x") |
43 | .dt_compat = tb10x_compat, | 31 | .dt_compat = tb10x_compat, |
44 | .init_machine = tb10x_platform_init, | ||
45 | MACHINE_END | 32 | MACHINE_END |
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 7c80af906897..38c89cafa1ab 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile | |||
@@ -354,13 +354,15 @@ dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-d2-network.dtb \ | |||
354 | orion5x-rd88f5182-nas.dtb | 354 | orion5x-rd88f5182-nas.dtb |
355 | dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb | 355 | dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb |
356 | dtb-$(CONFIG_ARCH_QCOM) += \ | 356 | dtb-$(CONFIG_ARCH_QCOM) += \ |
357 | qcom-apq8064-cm-qs600.dtb \ | ||
357 | qcom-apq8064-ifc6410.dtb \ | 358 | qcom-apq8064-ifc6410.dtb \ |
358 | qcom-apq8074-dragonboard.dtb \ | 359 | qcom-apq8074-dragonboard.dtb \ |
359 | qcom-apq8084-ifc6540.dtb \ | 360 | qcom-apq8084-ifc6540.dtb \ |
360 | qcom-apq8084-mtp.dtb \ | 361 | qcom-apq8084-mtp.dtb \ |
361 | qcom-ipq8064-ap148.dtb \ | 362 | qcom-ipq8064-ap148.dtb \ |
362 | qcom-msm8660-surf.dtb \ | 363 | qcom-msm8660-surf.dtb \ |
363 | qcom-msm8960-cdp.dtb | 364 | qcom-msm8960-cdp.dtb \ |
365 | qcom-msm8974-sony-xperia-honami.dtb | ||
364 | dtb-$(CONFIG_ARCH_ROCKCHIP) += \ | 366 | dtb-$(CONFIG_ARCH_ROCKCHIP) += \ |
365 | rk3066a-bqcurie2.dtb \ | 367 | rk3066a-bqcurie2.dtb \ |
366 | rk3188-radxarock.dtb \ | 368 | rk3188-radxarock.dtb \ |
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi index d68b3c4862bc..51416c7d0625 100644 --- a/arch/arm/boot/dts/at91sam9263.dtsi +++ b/arch/arm/boot/dts/at91sam9263.dtsi | |||
@@ -122,9 +122,10 @@ | |||
122 | interrupts-extended = <&pmc AT91_PMC_LOCKB>; | 122 | interrupts-extended = <&pmc AT91_PMC_LOCKB>; |
123 | clocks = <&main>; | 123 | clocks = <&main>; |
124 | reg = <1>; | 124 | reg = <1>; |
125 | atmel,clk-input-range = <1000000 5000000>; | 125 | atmel,clk-input-range = <1000000 32000000>; |
126 | #atmel,pll-clk-output-range-cells = <4>; | 126 | #atmel,pll-clk-output-range-cells = <4>; |
127 | atmel,pll-clk-output-ranges = <70000000 130000000 1 1>; | 127 | atmel,pll-clk-output-ranges = <80000000 200000000 0 1>, |
128 | <190000000 240000000 2 1>; | ||
128 | }; | 129 | }; |
129 | 130 | ||
130 | mck: masterck { | 131 | mck: masterck { |
diff --git a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi index 99b26df8dbc7..0865a2e33f97 100644 --- a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi +++ b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi | |||
@@ -675,7 +675,7 @@ | |||
675 | sd4_bus8: sd4-bus-width8 { | 675 | sd4_bus8: sd4-bus-width8 { |
676 | samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6"; | 676 | samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6"; |
677 | samsung,pin-function = <4>; | 677 | samsung,pin-function = <4>; |
678 | samsung,pin-pud = <4>; | 678 | samsung,pin-pud = <3>; |
679 | samsung,pin-drv = <3>; | 679 | samsung,pin-drv = <3>; |
680 | }; | 680 | }; |
681 | 681 | ||
diff --git a/arch/arm/boot/dts/exynos5420-arndale-octa.dts b/arch/arm/boot/dts/exynos5420-arndale-octa.dts index 4f2df61c1cfc..aa7a7d727a7e 100644 --- a/arch/arm/boot/dts/exynos5420-arndale-octa.dts +++ b/arch/arm/boot/dts/exynos5420-arndale-octa.dts | |||
@@ -368,3 +368,7 @@ | |||
368 | }; | 368 | }; |
369 | }; | 369 | }; |
370 | }; | 370 | }; |
371 | |||
372 | &usbdrd_dwc3_1 { | ||
373 | dr_mode = "host"; | ||
374 | }; | ||
diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts b/arch/arm/boot/dts/exynos5420-peach-pit.dts index 9a233828539c..82cdb74484cc 100644 --- a/arch/arm/boot/dts/exynos5420-peach-pit.dts +++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts | |||
@@ -838,6 +838,14 @@ | |||
838 | status = "okay"; | 838 | status = "okay"; |
839 | }; | 839 | }; |
840 | 840 | ||
841 | &usbdrd_dwc3_0 { | ||
842 | dr_mode = "host"; | ||
843 | }; | ||
844 | |||
845 | &usbdrd_dwc3_1 { | ||
846 | dr_mode = "host"; | ||
847 | }; | ||
848 | |||
841 | &usbdrd_phy0 { | 849 | &usbdrd_phy0 { |
842 | vbus-supply = <&usb300_vbus_reg>; | 850 | vbus-supply = <&usb300_vbus_reg>; |
843 | }; | 851 | }; |
diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi index bfe056d9148c..8617a031cbc0 100644 --- a/arch/arm/boot/dts/exynos5420.dtsi +++ b/arch/arm/boot/dts/exynos5420.dtsi | |||
@@ -815,7 +815,7 @@ | |||
815 | #size-cells = <1>; | 815 | #size-cells = <1>; |
816 | ranges; | 816 | ranges; |
817 | 817 | ||
818 | dwc3 { | 818 | usbdrd_dwc3_0: dwc3 { |
819 | compatible = "snps,dwc3"; | 819 | compatible = "snps,dwc3"; |
820 | reg = <0x12000000 0x10000>; | 820 | reg = <0x12000000 0x10000>; |
821 | interrupts = <0 72 0>; | 821 | interrupts = <0 72 0>; |
@@ -841,7 +841,7 @@ | |||
841 | #size-cells = <1>; | 841 | #size-cells = <1>; |
842 | ranges; | 842 | ranges; |
843 | 843 | ||
844 | dwc3 { | 844 | usbdrd_dwc3_1: dwc3 { |
845 | compatible = "snps,dwc3"; | 845 | compatible = "snps,dwc3"; |
846 | reg = <0x12400000 0x10000>; | 846 | reg = <0x12400000 0x10000>; |
847 | interrupts = <0 73 0>; | 847 | interrupts = <0 73 0>; |
diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts b/arch/arm/boot/dts/exynos5800-peach-pi.dts index 1d31c8132558..7bb1c8dd42dd 100644 --- a/arch/arm/boot/dts/exynos5800-peach-pi.dts +++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts | |||
@@ -826,6 +826,14 @@ | |||
826 | status = "okay"; | 826 | status = "okay"; |
827 | }; | 827 | }; |
828 | 828 | ||
829 | &usbdrd_dwc3_0 { | ||
830 | dr_mode = "host"; | ||
831 | }; | ||
832 | |||
833 | &usbdrd_dwc3_1 { | ||
834 | dr_mode = "host"; | ||
835 | }; | ||
836 | |||
829 | &usbdrd_phy0 { | 837 | &usbdrd_phy0 { |
830 | vbus-supply = <&usb300_vbus_reg>; | 838 | vbus-supply = <&usb300_vbus_reg>; |
831 | }; | 839 | }; |
diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts index 09664fcf5afb..0e13b4b10a92 100644 --- a/arch/arm/boot/dts/imx28-evk.dts +++ b/arch/arm/boot/dts/imx28-evk.dts | |||
@@ -193,7 +193,6 @@ | |||
193 | i2c0: i2c@80058000 { | 193 | i2c0: i2c@80058000 { |
194 | pinctrl-names = "default"; | 194 | pinctrl-names = "default"; |
195 | pinctrl-0 = <&i2c0_pins_a>; | 195 | pinctrl-0 = <&i2c0_pins_a>; |
196 | clock-frequency = <400000>; | ||
197 | status = "okay"; | 196 | status = "okay"; |
198 | 197 | ||
199 | sgtl5000: codec@0a { | 198 | sgtl5000: codec@0a { |
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts index 286bbf620c77..bc82a12d4c2c 100644 --- a/arch/arm/boot/dts/omap3-n900.dts +++ b/arch/arm/boot/dts/omap3-n900.dts | |||
@@ -659,6 +659,9 @@ | |||
659 | 659 | ||
660 | ethernet@gpmc { | 660 | ethernet@gpmc { |
661 | compatible = "smsc,lan91c94"; | 661 | compatible = "smsc,lan91c94"; |
662 | |||
663 | status = "disabled"; | ||
664 | |||
662 | interrupt-parent = <&gpio2>; | 665 | interrupt-parent = <&gpio2>; |
663 | interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; /* gpio54 */ | 666 | interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; /* gpio54 */ |
664 | reg = <1 0x300 0xf>; /* 16 byte IO range at offset 0x300 */ | 667 | reg = <1 0x300 0xf>; /* 16 byte IO range at offset 0x300 */ |
diff --git a/arch/arm/boot/dts/qcom-apq8064-cm-qs600.dts b/arch/arm/boot/dts/qcom-apq8064-cm-qs600.dts new file mode 100644 index 000000000000..5d75666f7f6c --- /dev/null +++ b/arch/arm/boot/dts/qcom-apq8064-cm-qs600.dts | |||
@@ -0,0 +1,59 @@ | |||
1 | #include "qcom-apq8064-v2.0.dtsi" | ||
2 | |||
3 | / { | ||
4 | model = "CompuLab CM-QS600"; | ||
5 | compatible = "qcom,apq8064-cm-qs600", "qcom,apq8064"; | ||
6 | |||
7 | soc { | ||
8 | pinctrl@800000 { | ||
9 | i2c1_pins: i2c1 { | ||
10 | mux { | ||
11 | pins = "gpio20", "gpio21"; | ||
12 | function = "gsbi1"; | ||
13 | }; | ||
14 | }; | ||
15 | }; | ||
16 | |||
17 | gsbi@12440000 { | ||
18 | status = "okay"; | ||
19 | qcom,mode = <GSBI_PROT_I2C>; | ||
20 | |||
21 | i2c@12460000 { | ||
22 | status = "okay"; | ||
23 | clock-frequency = <200000>; | ||
24 | pinctrl-0 = <&i2c1_pins>; | ||
25 | pinctrl-names = "default"; | ||
26 | |||
27 | eeprom: eeprom@50 { | ||
28 | compatible = "24c02"; | ||
29 | reg = <0x50>; | ||
30 | pagesize = <32>; | ||
31 | }; | ||
32 | }; | ||
33 | }; | ||
34 | |||
35 | gsbi@16600000 { | ||
36 | status = "ok"; | ||
37 | qcom,mode = <GSBI_PROT_I2C_UART>; | ||
38 | serial@16640000 { | ||
39 | status = "ok"; | ||
40 | }; | ||
41 | }; | ||
42 | |||
43 | amba { | ||
44 | /* eMMC */ | ||
45 | sdcc1: sdcc@12400000 { | ||
46 | status = "okay"; | ||
47 | }; | ||
48 | |||
49 | /* External micro SD card */ | ||
50 | sdcc3: sdcc@12180000 { | ||
51 | status = "okay"; | ||
52 | }; | ||
53 | /* WLAN */ | ||
54 | sdcc4: sdcc@121c0000 { | ||
55 | status = "okay"; | ||
56 | }; | ||
57 | }; | ||
58 | }; | ||
59 | }; | ||
diff --git a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts index 95e64955fb8e..55b2910efd87 100644 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts | |||
@@ -81,5 +81,13 @@ | |||
81 | }; | 81 | }; |
82 | }; | 82 | }; |
83 | }; | 83 | }; |
84 | |||
85 | sata-phy@1b400000 { | ||
86 | status = "ok"; | ||
87 | }; | ||
88 | |||
89 | sata@29000000 { | ||
90 | status = "ok"; | ||
91 | }; | ||
84 | }; | 92 | }; |
85 | }; | 93 | }; |
diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi index 244f857f0e6f..63b2146f563b 100644 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi | |||
@@ -234,6 +234,39 @@ | |||
234 | }; | 234 | }; |
235 | }; | 235 | }; |
236 | 236 | ||
237 | sata_phy: sata-phy@1b400000 { | ||
238 | compatible = "qcom,ipq806x-sata-phy"; | ||
239 | reg = <0x1b400000 0x200>; | ||
240 | |||
241 | clocks = <&gcc SATA_PHY_CFG_CLK>; | ||
242 | clock-names = "cfg"; | ||
243 | |||
244 | #phy-cells = <0>; | ||
245 | status = "disabled"; | ||
246 | }; | ||
247 | |||
248 | sata@29000000 { | ||
249 | compatible = "qcom,ipq806x-ahci", "generic-ahci"; | ||
250 | reg = <0x29000000 0x180>; | ||
251 | |||
252 | interrupts = <0 209 0x0>; | ||
253 | |||
254 | clocks = <&gcc SFAB_SATA_S_H_CLK>, | ||
255 | <&gcc SATA_H_CLK>, | ||
256 | <&gcc SATA_A_CLK>, | ||
257 | <&gcc SATA_RXOOB_CLK>, | ||
258 | <&gcc SATA_PMALIVE_CLK>; | ||
259 | clock-names = "slave_face", "iface", "core", | ||
260 | "rxoob", "pmalive"; | ||
261 | |||
262 | assigned-clocks = <&gcc SATA_RXOOB_CLK>, <&gcc SATA_PMALIVE_CLK>; | ||
263 | assigned-clock-rates = <100000000>, <100000000>; | ||
264 | |||
265 | phys = <&sata_phy>; | ||
266 | phy-names = "sata-phy"; | ||
267 | status = "disabled"; | ||
268 | }; | ||
269 | |||
237 | qcom,ssbi@500000 { | 270 | qcom,ssbi@500000 { |
238 | compatible = "qcom,ssbi"; | 271 | compatible = "qcom,ssbi"; |
239 | reg = <0x00500000 0x1000>; | 272 | reg = <0x00500000 0x1000>; |
diff --git a/arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts b/arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts new file mode 100644 index 000000000000..cccc21b7c8fd --- /dev/null +++ b/arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts | |||
@@ -0,0 +1,17 @@ | |||
1 | #include "qcom-msm8974.dtsi" | ||
2 | |||
3 | / { | ||
4 | model = "Sony Xperia Z1"; | ||
5 | compatible = "sony,xperia-honami", "qcom,msm8974"; | ||
6 | |||
7 | memory@0 { | ||
8 | reg = <0 0x40000000>, <0x40000000 0x40000000>; | ||
9 | device_type = "memory"; | ||
10 | }; | ||
11 | }; | ||
12 | |||
13 | &soc { | ||
14 | serial@f991e000 { | ||
15 | status = "ok"; | ||
16 | }; | ||
17 | }; | ||
diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi index 45fce2cf6fed..4472fd92685c 100644 --- a/arch/arm/boot/dts/socfpga.dtsi +++ b/arch/arm/boot/dts/socfpga.dtsi | |||
@@ -547,7 +547,7 @@ | |||
547 | status = "disabled"; | 547 | status = "disabled"; |
548 | }; | 548 | }; |
549 | 549 | ||
550 | gpio@ff708000 { | 550 | gpio0: gpio@ff708000 { |
551 | #address-cells = <1>; | 551 | #address-cells = <1>; |
552 | #size-cells = <0>; | 552 | #size-cells = <0>; |
553 | compatible = "snps,dw-apb-gpio"; | 553 | compatible = "snps,dw-apb-gpio"; |
@@ -555,7 +555,7 @@ | |||
555 | clocks = <&per_base_clk>; | 555 | clocks = <&per_base_clk>; |
556 | status = "disabled"; | 556 | status = "disabled"; |
557 | 557 | ||
558 | gpio0: gpio-controller@0 { | 558 | porta: gpio-controller@0 { |
559 | compatible = "snps,dw-apb-gpio-port"; | 559 | compatible = "snps,dw-apb-gpio-port"; |
560 | gpio-controller; | 560 | gpio-controller; |
561 | #gpio-cells = <2>; | 561 | #gpio-cells = <2>; |
@@ -567,7 +567,7 @@ | |||
567 | }; | 567 | }; |
568 | }; | 568 | }; |
569 | 569 | ||
570 | gpio@ff709000 { | 570 | gpio1: gpio@ff709000 { |
571 | #address-cells = <1>; | 571 | #address-cells = <1>; |
572 | #size-cells = <0>; | 572 | #size-cells = <0>; |
573 | compatible = "snps,dw-apb-gpio"; | 573 | compatible = "snps,dw-apb-gpio"; |
@@ -575,7 +575,7 @@ | |||
575 | clocks = <&per_base_clk>; | 575 | clocks = <&per_base_clk>; |
576 | status = "disabled"; | 576 | status = "disabled"; |
577 | 577 | ||
578 | gpio1: gpio-controller@0 { | 578 | portb: gpio-controller@0 { |
579 | compatible = "snps,dw-apb-gpio-port"; | 579 | compatible = "snps,dw-apb-gpio-port"; |
580 | gpio-controller; | 580 | gpio-controller; |
581 | #gpio-cells = <2>; | 581 | #gpio-cells = <2>; |
@@ -587,7 +587,7 @@ | |||
587 | }; | 587 | }; |
588 | }; | 588 | }; |
589 | 589 | ||
590 | gpio@ff70a000 { | 590 | gpio2: gpio@ff70a000 { |
591 | #address-cells = <1>; | 591 | #address-cells = <1>; |
592 | #size-cells = <0>; | 592 | #size-cells = <0>; |
593 | compatible = "snps,dw-apb-gpio"; | 593 | compatible = "snps,dw-apb-gpio"; |
@@ -595,7 +595,7 @@ | |||
595 | clocks = <&per_base_clk>; | 595 | clocks = <&per_base_clk>; |
596 | status = "disabled"; | 596 | status = "disabled"; |
597 | 597 | ||
598 | gpio2: gpio-controller@0 { | 598 | portc: gpio-controller@0 { |
599 | compatible = "snps,dw-apb-gpio-port"; | 599 | compatible = "snps,dw-apb-gpio-port"; |
600 | gpio-controller; | 600 | gpio-controller; |
601 | #gpio-cells = <2>; | 601 | #gpio-cells = <2>; |
diff --git a/arch/arm/boot/dts/socfpga_arria5.dtsi b/arch/arm/boot/dts/socfpga_arria5.dtsi index 03e8268ae219..1907cc600452 100644 --- a/arch/arm/boot/dts/socfpga_arria5.dtsi +++ b/arch/arm/boot/dts/socfpga_arria5.dtsi | |||
@@ -29,7 +29,7 @@ | |||
29 | }; | 29 | }; |
30 | }; | 30 | }; |
31 | 31 | ||
32 | dwmmc0@ff704000 { | 32 | mmc0: dwmmc0@ff704000 { |
33 | num-slots = <1>; | 33 | num-slots = <1>; |
34 | broken-cd; | 34 | broken-cd; |
35 | bus-width = <4>; | 35 | bus-width = <4>; |
diff --git a/arch/arm/boot/dts/socfpga_arria5_socdk.dts b/arch/arm/boot/dts/socfpga_arria5_socdk.dts index 27d551c384d0..ccaf41742fc3 100644 --- a/arch/arm/boot/dts/socfpga_arria5_socdk.dts +++ b/arch/arm/boot/dts/socfpga_arria5_socdk.dts | |||
@@ -37,6 +37,13 @@ | |||
37 | */ | 37 | */ |
38 | ethernet0 = &gmac1; | 38 | ethernet0 = &gmac1; |
39 | }; | 39 | }; |
40 | |||
41 | regulator_3_3v: 3-3-v-regulator { | ||
42 | compatible = "regulator-fixed"; | ||
43 | regulator-name = "3.3V"; | ||
44 | regulator-min-microvolt = <3300000>; | ||
45 | regulator-max-microvolt = <3300000>; | ||
46 | }; | ||
40 | }; | 47 | }; |
41 | 48 | ||
42 | &gmac1 { | 49 | &gmac1 { |
@@ -68,6 +75,11 @@ | |||
68 | }; | 75 | }; |
69 | }; | 76 | }; |
70 | 77 | ||
78 | &mmc0 { | ||
79 | vmmc-supply = <®ulator_3_3v>; | ||
80 | vqmmc-supply = <®ulator_3_3v>; | ||
81 | }; | ||
82 | |||
71 | &usb1 { | 83 | &usb1 { |
72 | status = "okay"; | 84 | status = "okay"; |
73 | }; | 85 | }; |
diff --git a/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts b/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts index d7296a5f750c..258865da8f6a 100644 --- a/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts +++ b/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts | |||
@@ -37,6 +37,13 @@ | |||
37 | */ | 37 | */ |
38 | ethernet0 = &gmac1; | 38 | ethernet0 = &gmac1; |
39 | }; | 39 | }; |
40 | |||
41 | regulator_3_3v: 3-3-v-regulator { | ||
42 | compatible = "regulator-fixed"; | ||
43 | regulator-name = "3.3V"; | ||
44 | regulator-min-microvolt = <3300000>; | ||
45 | regulator-max-microvolt = <3300000>; | ||
46 | }; | ||
40 | }; | 47 | }; |
41 | 48 | ||
42 | &gmac1 { | 49 | &gmac1 { |
@@ -53,6 +60,10 @@ | |||
53 | rxc-skew-ps = <2000>; | 60 | rxc-skew-ps = <2000>; |
54 | }; | 61 | }; |
55 | 62 | ||
63 | &gpio1 { | ||
64 | status = "okay"; | ||
65 | }; | ||
66 | |||
56 | &i2c0 { | 67 | &i2c0 { |
57 | status = "okay"; | 68 | status = "okay"; |
58 | 69 | ||
@@ -69,7 +80,9 @@ | |||
69 | }; | 80 | }; |
70 | 81 | ||
71 | &mmc0 { | 82 | &mmc0 { |
72 | cd-gpios = <&gpio1 18 0>; | 83 | cd-gpios = <&portb 18 0>; |
84 | vmmc-supply = <®ulator_3_3v>; | ||
85 | vqmmc-supply = <®ulator_3_3v>; | ||
73 | }; | 86 | }; |
74 | 87 | ||
75 | &usb1 { | 88 | &usb1 { |
diff --git a/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts b/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts index d26f155f5fd9..16ea6f5f2ab8 100644 --- a/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts +++ b/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts | |||
@@ -37,6 +37,13 @@ | |||
37 | */ | 37 | */ |
38 | ethernet0 = &gmac1; | 38 | ethernet0 = &gmac1; |
39 | }; | 39 | }; |
40 | |||
41 | regulator_3_3v: vcc3p3-regulator { | ||
42 | compatible = "regulator-fixed"; | ||
43 | regulator-name = "VCC3P3"; | ||
44 | regulator-min-microvolt = <3300000>; | ||
45 | regulator-max-microvolt = <3300000>; | ||
46 | }; | ||
40 | }; | 47 | }; |
41 | 48 | ||
42 | &gmac1 { | 49 | &gmac1 { |
@@ -53,6 +60,11 @@ | |||
53 | rxc-skew-ps = <2000>; | 60 | rxc-skew-ps = <2000>; |
54 | }; | 61 | }; |
55 | 62 | ||
63 | &mmc0 { | ||
64 | vmmc-supply = <®ulator_3_3v>; | ||
65 | vqmmc-supply = <®ulator_3_3v>; | ||
66 | }; | ||
67 | |||
56 | &usb1 { | 68 | &usb1 { |
57 | status = "okay"; | 69 | status = "okay"; |
58 | }; | 70 | }; |
diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi index 24036c440440..ce2ef5bec4f2 100644 --- a/arch/arm/boot/dts/zynq-7000.dtsi +++ b/arch/arm/boot/dts/zynq-7000.dtsi | |||
@@ -30,7 +30,6 @@ | |||
30 | /* kHz uV */ | 30 | /* kHz uV */ |
31 | 666667 1000000 | 31 | 666667 1000000 |
32 | 333334 1000000 | 32 | 333334 1000000 |
33 | 222223 1000000 | ||
34 | >; | 33 | >; |
35 | }; | 34 | }; |
36 | 35 | ||
@@ -65,7 +64,7 @@ | |||
65 | interrupt-parent = <&intc>; | 64 | interrupt-parent = <&intc>; |
66 | ranges; | 65 | ranges; |
67 | 66 | ||
68 | adc@f8007100 { | 67 | adc: adc@f8007100 { |
69 | compatible = "xlnx,zynq-xadc-1.00.a"; | 68 | compatible = "xlnx,zynq-xadc-1.00.a"; |
70 | reg = <0xf8007100 0x20>; | 69 | reg = <0xf8007100 0x20>; |
71 | interrupts = <0 7 4>; | 70 | interrupts = <0 7 4>; |
@@ -137,7 +136,7 @@ | |||
137 | <0xF8F00100 0x100>; | 136 | <0xF8F00100 0x100>; |
138 | }; | 137 | }; |
139 | 138 | ||
140 | L2: cache-controller { | 139 | L2: cache-controller@f8f02000 { |
141 | compatible = "arm,pl310-cache"; | 140 | compatible = "arm,pl310-cache"; |
142 | reg = <0xF8F02000 0x1000>; | 141 | reg = <0xF8F02000 0x1000>; |
143 | arm,data-latency = <3 2 2>; | 142 | arm,data-latency = <3 2 2>; |
@@ -146,10 +145,10 @@ | |||
146 | cache-level = <2>; | 145 | cache-level = <2>; |
147 | }; | 146 | }; |
148 | 147 | ||
149 | memory-controller@f8006000 { | 148 | mc: memory-controller@f8006000 { |
150 | compatible = "xlnx,zynq-ddrc-a05"; | 149 | compatible = "xlnx,zynq-ddrc-a05"; |
151 | reg = <0xf8006000 0x1000>; | 150 | reg = <0xf8006000 0x1000>; |
152 | } ; | 151 | }; |
153 | 152 | ||
154 | uart0: serial@e0000000 { | 153 | uart0: serial@e0000000 { |
155 | compatible = "xlnx,xuartps", "cdns,uart-r1p8"; | 154 | compatible = "xlnx,xuartps", "cdns,uart-r1p8"; |
@@ -195,7 +194,7 @@ | |||
195 | 194 | ||
196 | gem0: ethernet@e000b000 { | 195 | gem0: ethernet@e000b000 { |
197 | compatible = "cdns,gem"; | 196 | compatible = "cdns,gem"; |
198 | reg = <0xe000b000 0x4000>; | 197 | reg = <0xe000b000 0x1000>; |
199 | status = "disabled"; | 198 | status = "disabled"; |
200 | interrupts = <0 22 4>; | 199 | interrupts = <0 22 4>; |
201 | clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>; | 200 | clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>; |
@@ -206,7 +205,7 @@ | |||
206 | 205 | ||
207 | gem1: ethernet@e000c000 { | 206 | gem1: ethernet@e000c000 { |
208 | compatible = "cdns,gem"; | 207 | compatible = "cdns,gem"; |
209 | reg = <0xe000c000 0x4000>; | 208 | reg = <0xe000c000 0x1000>; |
210 | status = "disabled"; | 209 | status = "disabled"; |
211 | interrupts = <0 45 4>; | 210 | interrupts = <0 45 4>; |
212 | clocks = <&clkc 31>, <&clkc 31>, <&clkc 14>; | 211 | clocks = <&clkc 31>, <&clkc 31>, <&clkc 14>; |
@@ -315,5 +314,16 @@ | |||
315 | reg = <0xf8f00600 0x20>; | 314 | reg = <0xf8f00600 0x20>; |
316 | clocks = <&clkc 4>; | 315 | clocks = <&clkc 4>; |
317 | }; | 316 | }; |
317 | |||
318 | watchdog0: watchdog@f8005000 { | ||
319 | clocks = <&clkc 45>; | ||
320 | compatible = "xlnx,zynq-wdt-r1p2"; | ||
321 | device_type = "watchdog"; | ||
322 | interrupt-parent = <&intc>; | ||
323 | interrupts = <0 9 1>; | ||
324 | reg = <0xf8005000 0x1000>; | ||
325 | reset = <0>; | ||
326 | timeout-sec = <10>; | ||
327 | }; | ||
318 | }; | 328 | }; |
319 | }; | 329 | }; |
diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig index fc7d1683bf67..72058b8a6f4d 100644 --- a/arch/arm/configs/exynos_defconfig +++ b/arch/arm/configs/exynos_defconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | CONFIG_SYSVIPC=y | 1 | CONFIG_SYSVIPC=y |
2 | CONFIG_NO_HZ=y | 2 | CONFIG_NO_HZ=y |
3 | CONFIG_HIGH_RES_TIMERS=y | 3 | CONFIG_HIGH_RES_TIMERS=y |
4 | CONFIG_CGROUPS=y | ||
4 | CONFIG_BLK_DEV_INITRD=y | 5 | CONFIG_BLK_DEV_INITRD=y |
5 | CONFIG_KALLSYMS_ALL=y | 6 | CONFIG_KALLSYMS_ALL=y |
6 | CONFIG_MODULES=y | 7 | CONFIG_MODULES=y |
@@ -54,12 +55,14 @@ CONFIG_SMSC911X=y | |||
54 | CONFIG_USB_USBNET=y | 55 | CONFIG_USB_USBNET=y |
55 | CONFIG_USB_NET_SMSC75XX=y | 56 | CONFIG_USB_NET_SMSC75XX=y |
56 | CONFIG_USB_NET_SMSC95XX=y | 57 | CONFIG_USB_NET_SMSC95XX=y |
58 | CONFIG_USB_GADGET=y | ||
57 | CONFIG_INPUT_EVDEV=y | 59 | CONFIG_INPUT_EVDEV=y |
58 | CONFIG_KEYBOARD_GPIO=y | 60 | CONFIG_KEYBOARD_GPIO=y |
59 | CONFIG_KEYBOARD_CROS_EC=y | 61 | CONFIG_KEYBOARD_CROS_EC=y |
60 | # CONFIG_MOUSE_PS2 is not set | 62 | # CONFIG_MOUSE_PS2 is not set |
61 | CONFIG_MOUSE_CYAPA=y | 63 | CONFIG_MOUSE_CYAPA=y |
62 | CONFIG_INPUT_TOUCHSCREEN=y | 64 | CONFIG_INPUT_TOUCHSCREEN=y |
65 | CONFIG_TOUCHSCREEN_ATMEL_MXT=y | ||
63 | CONFIG_SERIAL_8250=y | 66 | CONFIG_SERIAL_8250=y |
64 | CONFIG_SERIAL_SAMSUNG=y | 67 | CONFIG_SERIAL_SAMSUNG=y |
65 | CONFIG_SERIAL_SAMSUNG_CONSOLE=y | 68 | CONFIG_SERIAL_SAMSUNG_CONSOLE=y |
@@ -68,15 +71,18 @@ CONFIG_HW_RANDOM=y | |||
68 | CONFIG_TCG_TPM=y | 71 | CONFIG_TCG_TPM=y |
69 | CONFIG_TCG_TIS_I2C_INFINEON=y | 72 | CONFIG_TCG_TIS_I2C_INFINEON=y |
70 | CONFIG_I2C=y | 73 | CONFIG_I2C=y |
74 | CONFIG_I2C_CHARDEV=y | ||
71 | CONFIG_I2C_MUX=y | 75 | CONFIG_I2C_MUX=y |
72 | CONFIG_I2C_ARB_GPIO_CHALLENGE=y | 76 | CONFIG_I2C_ARB_GPIO_CHALLENGE=y |
73 | CONFIG_I2C_EXYNOS5=y | 77 | CONFIG_I2C_EXYNOS5=y |
78 | CONFIG_I2C_GPIO=y | ||
74 | CONFIG_I2C_CROS_EC_TUNNEL=y | 79 | CONFIG_I2C_CROS_EC_TUNNEL=y |
75 | CONFIG_SPI=y | 80 | CONFIG_SPI=y |
76 | CONFIG_SPI_S3C64XX=y | 81 | CONFIG_SPI_S3C64XX=y |
77 | CONFIG_I2C_S3C2410=y | 82 | CONFIG_I2C_S3C2410=y |
78 | CONFIG_DEBUG_GPIO=y | 83 | CONFIG_DEBUG_GPIO=y |
79 | CONFIG_POWER_SUPPLY=y | 84 | CONFIG_POWER_SUPPLY=y |
85 | CONFIG_BATTERY_SBS=y | ||
80 | CONFIG_CHARGER_TPS65090=y | 86 | CONFIG_CHARGER_TPS65090=y |
81 | # CONFIG_HWMON is not set | 87 | # CONFIG_HWMON is not set |
82 | CONFIG_THERMAL=y | 88 | CONFIG_THERMAL=y |
@@ -88,6 +94,7 @@ CONFIG_MFD_CROS_EC=y | |||
88 | CONFIG_MFD_CROS_EC_I2C=y | 94 | CONFIG_MFD_CROS_EC_I2C=y |
89 | CONFIG_MFD_CROS_EC_SPI=y | 95 | CONFIG_MFD_CROS_EC_SPI=y |
90 | CONFIG_MFD_MAX77686=y | 96 | CONFIG_MFD_MAX77686=y |
97 | CONFIG_MFD_MAX77693=y | ||
91 | CONFIG_MFD_MAX8997=y | 98 | CONFIG_MFD_MAX8997=y |
92 | CONFIG_MFD_SEC_CORE=y | 99 | CONFIG_MFD_SEC_CORE=y |
93 | CONFIG_MFD_TPS65090=y | 100 | CONFIG_MFD_TPS65090=y |
@@ -96,6 +103,8 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y | |||
96 | CONFIG_REGULATOR_GPIO=y | 103 | CONFIG_REGULATOR_GPIO=y |
97 | CONFIG_REGULATOR_MAX8997=y | 104 | CONFIG_REGULATOR_MAX8997=y |
98 | CONFIG_REGULATOR_MAX77686=y | 105 | CONFIG_REGULATOR_MAX77686=y |
106 | CONFIG_REGULATOR_MAX77802=y | ||
107 | CONFIG_REGULATOR_MAX77693=y | ||
99 | CONFIG_REGULATOR_S2MPA01=y | 108 | CONFIG_REGULATOR_S2MPA01=y |
100 | CONFIG_REGULATOR_S2MPS11=y | 109 | CONFIG_REGULATOR_S2MPS11=y |
101 | CONFIG_REGULATOR_S5M8767=y | 110 | CONFIG_REGULATOR_S5M8767=y |
@@ -115,6 +124,7 @@ CONFIG_SND_SOC=y | |||
115 | CONFIG_SND_SOC_SAMSUNG=y | 124 | CONFIG_SND_SOC_SAMSUNG=y |
116 | CONFIG_SND_SOC_SNOW=y | 125 | CONFIG_SND_SOC_SNOW=y |
117 | CONFIG_USB=y | 126 | CONFIG_USB=y |
127 | CONFIG_USB_ANNOUNCE_NEW_DEVICES=y | ||
118 | CONFIG_USB_XHCI_HCD=y | 128 | CONFIG_USB_XHCI_HCD=y |
119 | CONFIG_USB_EHCI_HCD=y | 129 | CONFIG_USB_EHCI_HCD=y |
120 | CONFIG_USB_EHCI_EXYNOS=y | 130 | CONFIG_USB_EHCI_EXYNOS=y |
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 491b7d5523bf..f1dc7fc668f3 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig | |||
@@ -261,6 +261,7 @@ CONFIG_WATCHDOG=y | |||
261 | CONFIG_XILINX_WATCHDOG=y | 261 | CONFIG_XILINX_WATCHDOG=y |
262 | CONFIG_ORION_WATCHDOG=y | 262 | CONFIG_ORION_WATCHDOG=y |
263 | CONFIG_SUNXI_WATCHDOG=y | 263 | CONFIG_SUNXI_WATCHDOG=y |
264 | CONFIG_MESON_WATCHDOG=y | ||
264 | CONFIG_MFD_AS3722=y | 265 | CONFIG_MFD_AS3722=y |
265 | CONFIG_MFD_BCM590XX=y | 266 | CONFIG_MFD_BCM590XX=y |
266 | CONFIG_MFD_CROS_EC=y | 267 | CONFIG_MFD_CROS_EC=y |
@@ -353,6 +354,7 @@ CONFIG_MMC_MVSDIO=y | |||
353 | CONFIG_MMC_SUNXI=y | 354 | CONFIG_MMC_SUNXI=y |
354 | CONFIG_MMC_DW=y | 355 | CONFIG_MMC_DW=y |
355 | CONFIG_MMC_DW_EXYNOS=y | 356 | CONFIG_MMC_DW_EXYNOS=y |
357 | CONFIG_MMC_DW_ROCKCHIP=y | ||
356 | CONFIG_NEW_LEDS=y | 358 | CONFIG_NEW_LEDS=y |
357 | CONFIG_LEDS_CLASS=y | 359 | CONFIG_LEDS_CLASS=y |
358 | CONFIG_LEDS_GPIO=y | 360 | CONFIG_LEDS_GPIO=y |
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig index 69c7bed3c634..16e719c268dd 100644 --- a/arch/arm/configs/omap2plus_defconfig +++ b/arch/arm/configs/omap2plus_defconfig | |||
@@ -51,6 +51,7 @@ CONFIG_SOC_AM43XX=y | |||
51 | CONFIG_SOC_DRA7XX=y | 51 | CONFIG_SOC_DRA7XX=y |
52 | CONFIG_ARM_THUMBEE=y | 52 | CONFIG_ARM_THUMBEE=y |
53 | CONFIG_ARM_ERRATA_411920=y | 53 | CONFIG_ARM_ERRATA_411920=y |
54 | CONFIG_ARM_ERRATA_430973=y | ||
54 | CONFIG_SMP=y | 55 | CONFIG_SMP=y |
55 | CONFIG_NR_CPUS=2 | 56 | CONFIG_NR_CPUS=2 |
56 | CONFIG_CMA=y | 57 | CONFIG_CMA=y |
diff --git a/arch/arm/configs/sunxi_defconfig b/arch/arm/configs/sunxi_defconfig index c1a4ca4f6e6d..f7ac0379850f 100644 --- a/arch/arm/configs/sunxi_defconfig +++ b/arch/arm/configs/sunxi_defconfig | |||
@@ -75,6 +75,8 @@ CONFIG_POWER_RESET_SUN6I=y | |||
75 | CONFIG_WATCHDOG=y | 75 | CONFIG_WATCHDOG=y |
76 | CONFIG_SUNXI_WATCHDOG=y | 76 | CONFIG_SUNXI_WATCHDOG=y |
77 | CONFIG_MFD_AXP20X=y | 77 | CONFIG_MFD_AXP20X=y |
78 | CONFIG_REGULATOR=y | ||
79 | CONFIG_REGULATOR_FIXED_VOLTAGE=y | ||
78 | CONFIG_REGULATOR_GPIO=y | 80 | CONFIG_REGULATOR_GPIO=y |
79 | CONFIG_USB=y | 81 | CONFIG_USB=y |
80 | CONFIG_USB_EHCI_HCD=y | 82 | CONFIG_USB_EHCI_HCD=y |
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 713e807621d2..2d2d6087b9b1 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c | |||
@@ -10,6 +10,7 @@ | |||
10 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | */ | 12 | */ |
13 | #include <linux/compiler.h> | ||
13 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
14 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
15 | #include <linux/dma-mapping.h> | 16 | #include <linux/dma-mapping.h> |
@@ -39,10 +40,19 @@ | |||
39 | * GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c | 40 | * GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c |
40 | * (http://gcc.gnu.org/PR8896) and incorrect structure | 41 | * (http://gcc.gnu.org/PR8896) and incorrect structure |
41 | * initialisation in fs/jffs2/erase.c | 42 | * initialisation in fs/jffs2/erase.c |
43 | * GCC 4.8.0-4.8.2: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854 | ||
44 | * miscompiles find_get_entry(), and can result in EXT3 and EXT4 | ||
45 | * filesystem corruption (possibly other FS too). | ||
42 | */ | 46 | */ |
47 | #ifdef __GNUC__ | ||
43 | #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | 48 | #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) |
44 | #error Your compiler is too buggy; it is known to miscompile kernels. | 49 | #error Your compiler is too buggy; it is known to miscompile kernels. |
45 | #error Known good compilers: 3.3 | 50 | #error Known good compilers: 3.3, 4.x |
51 | #endif | ||
52 | #if GCC_VERSION >= 40800 && GCC_VERSION < 40803 | ||
53 | #error Your compiler is too buggy; it is known to miscompile kernels | ||
54 | #error and result in filesystem corruption and oopses. | ||
55 | #endif | ||
46 | #endif | 56 | #endif |
47 | 57 | ||
48 | int main(void) | 58 | int main(void) |
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 5e772a21ab97..ef9119f7462e 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -949,8 +949,8 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno) | |||
949 | if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) | 949 | if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) |
950 | trace_sys_enter(regs, scno); | 950 | trace_sys_enter(regs, scno); |
951 | 951 | ||
952 | audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, regs->ARM_r1, | 952 | audit_syscall_entry(scno, regs->ARM_r0, regs->ARM_r1, regs->ARM_r2, |
953 | regs->ARM_r2, regs->ARM_r3); | 953 | regs->ARM_r3); |
954 | 954 | ||
955 | return scno; | 955 | return scno; |
956 | } | 956 | } |
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index b89e5f35db84..6b283eb3202e 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c | |||
@@ -161,7 +161,9 @@ static void exynos_restart(enum reboot_mode mode, const char *cmd) | |||
161 | 161 | ||
162 | static struct platform_device exynos_cpuidle = { | 162 | static struct platform_device exynos_cpuidle = { |
163 | .name = "exynos_cpuidle", | 163 | .name = "exynos_cpuidle", |
164 | #ifdef CONFIG_ARM_EXYNOS_CPUIDLE | ||
164 | .dev.platform_data = exynos_enter_aftr, | 165 | .dev.platform_data = exynos_enter_aftr, |
166 | #endif | ||
165 | .id = -1, | 167 | .id = -1, |
166 | }; | 168 | }; |
167 | 169 | ||
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index 8c35ae4ff176..07a09570175d 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/input.h> | 20 | #include <linux/input.h> |
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/irqchip.h> | 22 | #include <linux/irqchip.h> |
23 | #include <linux/mailbox.h> | 23 | #include <linux/pl320-ipc.h> |
24 | #include <linux/of.h> | 24 | #include <linux/of.h> |
25 | #include <linux/of_irq.h> | 25 | #include <linux/of_irq.h> |
26 | #include <linux/of_platform.h> | 26 | #include <linux/of_platform.h> |
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 1412daf4a714..4e79da7c5e30 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c | |||
@@ -50,8 +50,8 @@ static const char *pcie_axi_sels[] = { "axi", "ahb", }; | |||
50 | static const char *ssi_sels[] = { "pll3_pfd2_508m", "pll3_pfd3_454m", "pll4_audio_div", }; | 50 | static const char *ssi_sels[] = { "pll3_pfd2_508m", "pll3_pfd3_454m", "pll4_audio_div", }; |
51 | static const char *usdhc_sels[] = { "pll2_pfd2_396m", "pll2_pfd0_352m", }; | 51 | static const char *usdhc_sels[] = { "pll2_pfd2_396m", "pll2_pfd0_352m", }; |
52 | static const char *enfc_sels[] = { "pll2_pfd0_352m", "pll2_bus", "pll3_usb_otg", "pll2_pfd2_396m", }; | 52 | static const char *enfc_sels[] = { "pll2_pfd0_352m", "pll2_bus", "pll3_usb_otg", "pll2_pfd2_396m", }; |
53 | static const char *emi_sels[] = { "pll2_pfd2_396m", "pll3_usb_otg", "axi", "pll2_pfd0_352m", }; | 53 | static const char *eim_sels[] = { "pll2_pfd2_396m", "pll3_usb_otg", "axi", "pll2_pfd0_352m", }; |
54 | static const char *emi_slow_sels[] = { "axi", "pll3_usb_otg", "pll2_pfd2_396m", "pll2_pfd0_352m", }; | 54 | static const char *eim_slow_sels[] = { "axi", "pll3_usb_otg", "pll2_pfd2_396m", "pll2_pfd0_352m", }; |
55 | static const char *vdo_axi_sels[] = { "axi", "ahb", }; | 55 | static const char *vdo_axi_sels[] = { "axi", "ahb", }; |
56 | static const char *vpu_axi_sels[] = { "axi", "pll2_pfd2_396m", "pll2_pfd0_352m", }; | 56 | static const char *vpu_axi_sels[] = { "axi", "pll2_pfd2_396m", "pll2_pfd0_352m", }; |
57 | static const char *cko1_sels[] = { "pll3_usb_otg", "pll2_bus", "pll1_sys", "pll5_video_div", | 57 | static const char *cko1_sels[] = { "pll3_usb_otg", "pll2_bus", "pll1_sys", "pll5_video_div", |
@@ -302,8 +302,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
302 | clk[IMX6QDL_CLK_USDHC3_SEL] = imx_clk_fixup_mux("usdhc3_sel", base + 0x1c, 18, 1, usdhc_sels, ARRAY_SIZE(usdhc_sels), imx_cscmr1_fixup); | 302 | clk[IMX6QDL_CLK_USDHC3_SEL] = imx_clk_fixup_mux("usdhc3_sel", base + 0x1c, 18, 1, usdhc_sels, ARRAY_SIZE(usdhc_sels), imx_cscmr1_fixup); |
303 | clk[IMX6QDL_CLK_USDHC4_SEL] = imx_clk_fixup_mux("usdhc4_sel", base + 0x1c, 19, 1, usdhc_sels, ARRAY_SIZE(usdhc_sels), imx_cscmr1_fixup); | 303 | clk[IMX6QDL_CLK_USDHC4_SEL] = imx_clk_fixup_mux("usdhc4_sel", base + 0x1c, 19, 1, usdhc_sels, ARRAY_SIZE(usdhc_sels), imx_cscmr1_fixup); |
304 | clk[IMX6QDL_CLK_ENFC_SEL] = imx_clk_mux("enfc_sel", base + 0x2c, 16, 2, enfc_sels, ARRAY_SIZE(enfc_sels)); | 304 | clk[IMX6QDL_CLK_ENFC_SEL] = imx_clk_mux("enfc_sel", base + 0x2c, 16, 2, enfc_sels, ARRAY_SIZE(enfc_sels)); |
305 | clk[IMX6QDL_CLK_EMI_SEL] = imx_clk_fixup_mux("emi_sel", base + 0x1c, 27, 2, emi_sels, ARRAY_SIZE(emi_sels), imx_cscmr1_fixup); | 305 | clk[IMX6QDL_CLK_EIM_SEL] = imx_clk_fixup_mux("eim_sel", base + 0x1c, 27, 2, eim_sels, ARRAY_SIZE(eim_sels), imx_cscmr1_fixup); |
306 | clk[IMX6QDL_CLK_EMI_SLOW_SEL] = imx_clk_fixup_mux("emi_slow_sel", base + 0x1c, 29, 2, emi_slow_sels, ARRAY_SIZE(emi_slow_sels), imx_cscmr1_fixup); | 306 | clk[IMX6QDL_CLK_EIM_SLOW_SEL] = imx_clk_fixup_mux("eim_slow_sel", base + 0x1c, 29, 2, eim_slow_sels, ARRAY_SIZE(eim_slow_sels), imx_cscmr1_fixup); |
307 | clk[IMX6QDL_CLK_VDO_AXI_SEL] = imx_clk_mux("vdo_axi_sel", base + 0x18, 11, 1, vdo_axi_sels, ARRAY_SIZE(vdo_axi_sels)); | 307 | clk[IMX6QDL_CLK_VDO_AXI_SEL] = imx_clk_mux("vdo_axi_sel", base + 0x18, 11, 1, vdo_axi_sels, ARRAY_SIZE(vdo_axi_sels)); |
308 | clk[IMX6QDL_CLK_VPU_AXI_SEL] = imx_clk_mux("vpu_axi_sel", base + 0x18, 14, 2, vpu_axi_sels, ARRAY_SIZE(vpu_axi_sels)); | 308 | clk[IMX6QDL_CLK_VPU_AXI_SEL] = imx_clk_mux("vpu_axi_sel", base + 0x18, 14, 2, vpu_axi_sels, ARRAY_SIZE(vpu_axi_sels)); |
309 | clk[IMX6QDL_CLK_CKO1_SEL] = imx_clk_mux("cko1_sel", base + 0x60, 0, 4, cko1_sels, ARRAY_SIZE(cko1_sels)); | 309 | clk[IMX6QDL_CLK_CKO1_SEL] = imx_clk_mux("cko1_sel", base + 0x60, 0, 4, cko1_sels, ARRAY_SIZE(cko1_sels)); |
@@ -354,8 +354,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
354 | clk[IMX6QDL_CLK_USDHC4_PODF] = imx_clk_divider("usdhc4_podf", "usdhc4_sel", base + 0x24, 22, 3); | 354 | clk[IMX6QDL_CLK_USDHC4_PODF] = imx_clk_divider("usdhc4_podf", "usdhc4_sel", base + 0x24, 22, 3); |
355 | clk[IMX6QDL_CLK_ENFC_PRED] = imx_clk_divider("enfc_pred", "enfc_sel", base + 0x2c, 18, 3); | 355 | clk[IMX6QDL_CLK_ENFC_PRED] = imx_clk_divider("enfc_pred", "enfc_sel", base + 0x2c, 18, 3); |
356 | clk[IMX6QDL_CLK_ENFC_PODF] = imx_clk_divider("enfc_podf", "enfc_pred", base + 0x2c, 21, 6); | 356 | clk[IMX6QDL_CLK_ENFC_PODF] = imx_clk_divider("enfc_podf", "enfc_pred", base + 0x2c, 21, 6); |
357 | clk[IMX6QDL_CLK_EMI_PODF] = imx_clk_fixup_divider("emi_podf", "emi_sel", base + 0x1c, 20, 3, imx_cscmr1_fixup); | 357 | clk[IMX6QDL_CLK_EIM_PODF] = imx_clk_fixup_divider("eim_podf", "eim_sel", base + 0x1c, 20, 3, imx_cscmr1_fixup); |
358 | clk[IMX6QDL_CLK_EMI_SLOW_PODF] = imx_clk_fixup_divider("emi_slow_podf", "emi_slow_sel", base + 0x1c, 23, 3, imx_cscmr1_fixup); | 358 | clk[IMX6QDL_CLK_EIM_SLOW_PODF] = imx_clk_fixup_divider("eim_slow_podf", "eim_slow_sel", base + 0x1c, 23, 3, imx_cscmr1_fixup); |
359 | clk[IMX6QDL_CLK_VPU_AXI_PODF] = imx_clk_divider("vpu_axi_podf", "vpu_axi_sel", base + 0x24, 25, 3); | 359 | clk[IMX6QDL_CLK_VPU_AXI_PODF] = imx_clk_divider("vpu_axi_podf", "vpu_axi_sel", base + 0x24, 25, 3); |
360 | clk[IMX6QDL_CLK_CKO1_PODF] = imx_clk_divider("cko1_podf", "cko1_sel", base + 0x60, 4, 3); | 360 | clk[IMX6QDL_CLK_CKO1_PODF] = imx_clk_divider("cko1_podf", "cko1_sel", base + 0x60, 4, 3); |
361 | clk[IMX6QDL_CLK_CKO2_PODF] = imx_clk_divider("cko2_podf", "cko2_sel", base + 0x60, 21, 3); | 361 | clk[IMX6QDL_CLK_CKO2_PODF] = imx_clk_divider("cko2_podf", "cko2_sel", base + 0x60, 21, 3); |
@@ -456,7 +456,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
456 | clk[IMX6QDL_CLK_USDHC2] = imx_clk_gate2("usdhc2", "usdhc2_podf", base + 0x80, 4); | 456 | clk[IMX6QDL_CLK_USDHC2] = imx_clk_gate2("usdhc2", "usdhc2_podf", base + 0x80, 4); |
457 | clk[IMX6QDL_CLK_USDHC3] = imx_clk_gate2("usdhc3", "usdhc3_podf", base + 0x80, 6); | 457 | clk[IMX6QDL_CLK_USDHC3] = imx_clk_gate2("usdhc3", "usdhc3_podf", base + 0x80, 6); |
458 | clk[IMX6QDL_CLK_USDHC4] = imx_clk_gate2("usdhc4", "usdhc4_podf", base + 0x80, 8); | 458 | clk[IMX6QDL_CLK_USDHC4] = imx_clk_gate2("usdhc4", "usdhc4_podf", base + 0x80, 8); |
459 | clk[IMX6QDL_CLK_EIM_SLOW] = imx_clk_gate2("eim_slow", "emi_slow_podf", base + 0x80, 10); | 459 | clk[IMX6QDL_CLK_EIM_SLOW] = imx_clk_gate2("eim_slow", "eim_slow_podf", base + 0x80, 10); |
460 | clk[IMX6QDL_CLK_VDO_AXI] = imx_clk_gate2("vdo_axi", "vdo_axi_sel", base + 0x80, 12); | 460 | clk[IMX6QDL_CLK_VDO_AXI] = imx_clk_gate2("vdo_axi", "vdo_axi_sel", base + 0x80, 12); |
461 | clk[IMX6QDL_CLK_VPU_AXI] = imx_clk_gate2("vpu_axi", "vpu_axi_podf", base + 0x80, 14); | 461 | clk[IMX6QDL_CLK_VPU_AXI] = imx_clk_gate2("vpu_axi", "vpu_axi_podf", base + 0x80, 14); |
462 | clk[IMX6QDL_CLK_CKO1] = imx_clk_gate("cko1", "cko1_podf", base + 0x60, 7); | 462 | clk[IMX6QDL_CLK_CKO1] = imx_clk_gate("cko1", "cko1_podf", base + 0x60, 7); |
diff --git a/arch/arm/mach-socfpga/core.h b/arch/arm/mach-socfpga/core.h index 572b8f719ffb..60c443dadb58 100644 --- a/arch/arm/mach-socfpga/core.h +++ b/arch/arm/mach-socfpga/core.h | |||
@@ -40,7 +40,7 @@ extern void __iomem *rst_manager_base_addr; | |||
40 | extern struct smp_operations socfpga_smp_ops; | 40 | extern struct smp_operations socfpga_smp_ops; |
41 | extern char secondary_trampoline, secondary_trampoline_end; | 41 | extern char secondary_trampoline, secondary_trampoline_end; |
42 | 42 | ||
43 | extern unsigned long cpu1start_addr; | 43 | extern unsigned long socfpga_cpu1start_addr; |
44 | 44 | ||
45 | #define SOCFPGA_SCU_VIRT_BASE 0xfffec000 | 45 | #define SOCFPGA_SCU_VIRT_BASE 0xfffec000 |
46 | 46 | ||
diff --git a/arch/arm/mach-socfpga/headsmp.S b/arch/arm/mach-socfpga/headsmp.S index 95c115d8b5ee..f65ea0af4af3 100644 --- a/arch/arm/mach-socfpga/headsmp.S +++ b/arch/arm/mach-socfpga/headsmp.S | |||
@@ -9,21 +9,26 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <asm/memory.h> | ||
12 | 13 | ||
13 | .arch armv7-a | 14 | .arch armv7-a |
14 | 15 | ||
15 | ENTRY(secondary_trampoline) | 16 | ENTRY(secondary_trampoline) |
16 | movw r2, #:lower16:cpu1start_addr | 17 | /* CPU1 will always fetch from 0x0 when it is brought out of reset. |
17 | movt r2, #:upper16:cpu1start_addr | 18 | * Thus, we can just subtract the PAGE_OFFSET to get the physical |
18 | 19 | * address of &cpu1start_addr. This would not work for platforms | |
19 | /* The socfpga VT cannot handle a 0xC0000000 page offset when loading | 20 | * where the physical memory does not start at 0x0. |
20 | the cpu1start_addr, we bit clear it. Tested on HW and VT. */ | 21 | */ |
21 | bic r2, r2, #0x40000000 | 22 | adr r0, 1f |
22 | 23 | ldmia r0, {r1, r2} | |
23 | ldr r0, [r2] | 24 | sub r2, r2, #PAGE_OFFSET |
24 | ldr r1, [r0] | 25 | ldr r3, [r2] |
25 | bx r1 | 26 | ldr r4, [r3] |
27 | bx r4 | ||
26 | 28 | ||
29 | .align | ||
30 | 1: .long . | ||
31 | .long socfpga_cpu1start_addr | ||
27 | ENTRY(secondary_trampoline_end) | 32 | ENTRY(secondary_trampoline_end) |
28 | 33 | ||
29 | ENTRY(socfpga_secondary_startup) | 34 | ENTRY(socfpga_secondary_startup) |
diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c index 5356a72bc8ce..16ca97b039f9 100644 --- a/arch/arm/mach-socfpga/platsmp.c +++ b/arch/arm/mach-socfpga/platsmp.c | |||
@@ -33,11 +33,11 @@ static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
33 | { | 33 | { |
34 | int trampoline_size = &secondary_trampoline_end - &secondary_trampoline; | 34 | int trampoline_size = &secondary_trampoline_end - &secondary_trampoline; |
35 | 35 | ||
36 | if (cpu1start_addr) { | 36 | if (socfpga_cpu1start_addr) { |
37 | memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size); | 37 | memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size); |
38 | 38 | ||
39 | __raw_writel(virt_to_phys(socfpga_secondary_startup), | 39 | __raw_writel(virt_to_phys(socfpga_secondary_startup), |
40 | (sys_manager_base_addr + (cpu1start_addr & 0x000000ff))); | 40 | (sys_manager_base_addr + (socfpga_cpu1start_addr & 0x000000ff))); |
41 | 41 | ||
42 | flush_cache_all(); | 42 | flush_cache_all(); |
43 | smp_wmb(); | 43 | smp_wmb(); |
diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c index adbf38314ca8..383d61e138af 100644 --- a/arch/arm/mach-socfpga/socfpga.c +++ b/arch/arm/mach-socfpga/socfpga.c | |||
@@ -29,7 +29,7 @@ | |||
29 | void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE)); | 29 | void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE)); |
30 | void __iomem *sys_manager_base_addr; | 30 | void __iomem *sys_manager_base_addr; |
31 | void __iomem *rst_manager_base_addr; | 31 | void __iomem *rst_manager_base_addr; |
32 | unsigned long cpu1start_addr; | 32 | unsigned long socfpga_cpu1start_addr; |
33 | 33 | ||
34 | static struct map_desc scu_io_desc __initdata = { | 34 | static struct map_desc scu_io_desc __initdata = { |
35 | .virtual = SOCFPGA_SCU_VIRT_BASE, | 35 | .virtual = SOCFPGA_SCU_VIRT_BASE, |
@@ -70,7 +70,7 @@ void __init socfpga_sysmgr_init(void) | |||
70 | np = of_find_compatible_node(NULL, NULL, "altr,sys-mgr"); | 70 | np = of_find_compatible_node(NULL, NULL, "altr,sys-mgr"); |
71 | 71 | ||
72 | if (of_property_read_u32(np, "cpu1-start-addr", | 72 | if (of_property_read_u32(np, "cpu1-start-addr", |
73 | (u32 *) &cpu1start_addr)) | 73 | (u32 *) &socfpga_cpu1start_addr)) |
74 | pr_err("SMP: Need cpu1-start-addr in device tree.\n"); | 74 | pr_err("SMP: Need cpu1-start-addr in device tree.\n"); |
75 | 75 | ||
76 | sys_manager_base_addr = of_iomap(np, 0); | 76 | sys_manager_base_addr = of_iomap(np, 0); |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 92bba32d9230..9481f85c56e6 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -559,10 +559,10 @@ void __init mem_init(void) | |||
559 | #ifdef CONFIG_MODULES | 559 | #ifdef CONFIG_MODULES |
560 | " modules : 0x%08lx - 0x%08lx (%4ld MB)\n" | 560 | " modules : 0x%08lx - 0x%08lx (%4ld MB)\n" |
561 | #endif | 561 | #endif |
562 | " .text : 0x%p" " - 0x%p" " (%4d kB)\n" | 562 | " .text : 0x%p" " - 0x%p" " (%4td kB)\n" |
563 | " .init : 0x%p" " - 0x%p" " (%4d kB)\n" | 563 | " .init : 0x%p" " - 0x%p" " (%4td kB)\n" |
564 | " .data : 0x%p" " - 0x%p" " (%4d kB)\n" | 564 | " .data : 0x%p" " - 0x%p" " (%4td kB)\n" |
565 | " .bss : 0x%p" " - 0x%p" " (%4d kB)\n", | 565 | " .bss : 0x%p" " - 0x%p" " (%4td kB)\n", |
566 | 566 | ||
567 | MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) + | 567 | MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) + |
568 | (PAGE_SIZE)), | 568 | (PAGE_SIZE)), |
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S index ee1d80593958..ba1196c968d8 100644 --- a/arch/arm/mm/proc-macros.S +++ b/arch/arm/mm/proc-macros.S | |||
@@ -279,7 +279,7 @@ ENTRY(\name\()_processor_functions) | |||
279 | 279 | ||
280 | .if \suspend | 280 | .if \suspend |
281 | .word cpu_\name\()_suspend_size | 281 | .word cpu_\name\()_suspend_size |
282 | #ifdef CONFIG_PM_SLEEP | 282 | #ifdef CONFIG_ARM_CPU_SUSPEND |
283 | .word cpu_\name\()_do_suspend | 283 | .word cpu_\name\()_do_suspend |
284 | .word cpu_\name\()_do_resume | 284 | .word cpu_\name\()_do_resume |
285 | #else | 285 | #else |
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index c87aefbf3a13..9bd2776e7d05 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig | |||
@@ -268,8 +268,9 @@ config S5P_DEV_MFC | |||
268 | comment "Power management" | 268 | comment "Power management" |
269 | 269 | ||
270 | config SAMSUNG_PM_DEBUG | 270 | config SAMSUNG_PM_DEBUG |
271 | bool "S3C2410 PM Suspend debug" | 271 | bool "Samsung PM Suspend debug" |
272 | depends on PM && DEBUG_KERNEL && DEBUG_S3C_UART | 272 | depends on PM && DEBUG_KERNEL |
273 | depends on DEBUG_EXYNOS_UART || DEBUG_S3C24XX_UART || DEBUG_S3C2410_UART | ||
273 | help | 274 | help |
274 | Say Y here if you want verbose debugging from the PM Suspend and | 275 | Say Y here if you want verbose debugging from the PM Suspend and |
275 | Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt> | 276 | Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt> |
diff --git a/arch/arm/plat-samsung/pm-debug.c b/arch/arm/plat-samsung/pm-debug.c index 8f19f66388dd..39609601f407 100644 --- a/arch/arm/plat-samsung/pm-debug.c +++ b/arch/arm/plat-samsung/pm-debug.c | |||
@@ -14,6 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/serial_core.h> | 16 | #include <linux/serial_core.h> |
17 | #include <linux/serial_s3c.h> | ||
17 | #include <linux/io.h> | 18 | #include <linux/io.h> |
18 | 19 | ||
19 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index ac9afde76dea..9532f8d5857e 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -1,5 +1,6 @@ | |||
1 | config ARM64 | 1 | config ARM64 |
2 | def_bool y | 2 | def_bool y |
3 | select ARCH_BINFMT_ELF_RANDOMIZE_PIE | ||
3 | select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE | 4 | select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE |
4 | select ARCH_HAS_SG_CHAIN | 5 | select ARCH_HAS_SG_CHAIN |
5 | select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST | 6 | select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST |
@@ -232,7 +233,7 @@ config ARM64_VA_BITS_42 | |||
232 | 233 | ||
233 | config ARM64_VA_BITS_48 | 234 | config ARM64_VA_BITS_48 |
234 | bool "48-bit" | 235 | bool "48-bit" |
235 | depends on BROKEN | 236 | depends on !ARM_SMMU |
236 | 237 | ||
237 | endchoice | 238 | endchoice |
238 | 239 | ||
diff --git a/arch/arm64/boot/dts/rtsm_ve-motherboard.dtsi b/arch/arm64/boot/dts/rtsm_ve-motherboard.dtsi index ac2cb2418025..c46cbb29f3c6 100644 --- a/arch/arm64/boot/dts/rtsm_ve-motherboard.dtsi +++ b/arch/arm64/boot/dts/rtsm_ve-motherboard.dtsi | |||
@@ -22,7 +22,7 @@ | |||
22 | bank-width = <4>; | 22 | bank-width = <4>; |
23 | }; | 23 | }; |
24 | 24 | ||
25 | vram@2,00000000 { | 25 | v2m_video_ram: vram@2,00000000 { |
26 | compatible = "arm,vexpress-vram"; | 26 | compatible = "arm,vexpress-vram"; |
27 | reg = <2 0x00000000 0x00800000>; | 27 | reg = <2 0x00000000 0x00800000>; |
28 | }; | 28 | }; |
@@ -179,9 +179,42 @@ | |||
179 | clcd@1f0000 { | 179 | clcd@1f0000 { |
180 | compatible = "arm,pl111", "arm,primecell"; | 180 | compatible = "arm,pl111", "arm,primecell"; |
181 | reg = <0x1f0000 0x1000>; | 181 | reg = <0x1f0000 0x1000>; |
182 | interrupt-names = "combined"; | ||
182 | interrupts = <14>; | 183 | interrupts = <14>; |
183 | clocks = <&v2m_oscclk1>, <&v2m_clk24mhz>; | 184 | clocks = <&v2m_oscclk1>, <&v2m_clk24mhz>; |
184 | clock-names = "clcdclk", "apb_pclk"; | 185 | clock-names = "clcdclk", "apb_pclk"; |
186 | arm,pl11x,framebuffer = <0x18000000 0x00180000>; | ||
187 | memory-region = <&v2m_video_ram>; | ||
188 | max-memory-bandwidth = <130000000>; /* 16bpp @ 63.5MHz */ | ||
189 | |||
190 | port { | ||
191 | v2m_clcd_pads: endpoint { | ||
192 | remote-endpoint = <&v2m_clcd_panel>; | ||
193 | arm,pl11x,tft-r0g0b0-pads = <0 8 16>; | ||
194 | }; | ||
195 | }; | ||
196 | |||
197 | panel { | ||
198 | compatible = "panel-dpi"; | ||
199 | |||
200 | port { | ||
201 | v2m_clcd_panel: endpoint { | ||
202 | remote-endpoint = <&v2m_clcd_pads>; | ||
203 | }; | ||
204 | }; | ||
205 | |||
206 | panel-timing { | ||
207 | clock-frequency = <63500127>; | ||
208 | hactive = <1024>; | ||
209 | hback-porch = <152>; | ||
210 | hfront-porch = <48>; | ||
211 | hsync-len = <104>; | ||
212 | vactive = <768>; | ||
213 | vback-porch = <23>; | ||
214 | vfront-porch = <3>; | ||
215 | vsync-len = <4>; | ||
216 | }; | ||
217 | }; | ||
185 | }; | 218 | }; |
186 | 219 | ||
187 | virtio_block@0130000 { | 220 | virtio_block@0130000 { |
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 9cd37de9aa8d..4ce602c2c6de 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig | |||
@@ -78,6 +78,7 @@ CONFIG_NET_XGENE=y | |||
78 | # CONFIG_WLAN is not set | 78 | # CONFIG_WLAN is not set |
79 | CONFIG_INPUT_EVDEV=y | 79 | CONFIG_INPUT_EVDEV=y |
80 | # CONFIG_SERIO_SERPORT is not set | 80 | # CONFIG_SERIO_SERPORT is not set |
81 | CONFIG_SERIO_AMBAKMI=y | ||
81 | CONFIG_LEGACY_PTY_COUNT=16 | 82 | CONFIG_LEGACY_PTY_COUNT=16 |
82 | CONFIG_SERIAL_8250=y | 83 | CONFIG_SERIAL_8250=y |
83 | CONFIG_SERIAL_8250_CONSOLE=y | 84 | CONFIG_SERIAL_8250_CONSOLE=y |
@@ -90,6 +91,7 @@ CONFIG_VIRTIO_CONSOLE=y | |||
90 | CONFIG_REGULATOR=y | 91 | CONFIG_REGULATOR=y |
91 | CONFIG_REGULATOR_FIXED_VOLTAGE=y | 92 | CONFIG_REGULATOR_FIXED_VOLTAGE=y |
92 | CONFIG_FB=y | 93 | CONFIG_FB=y |
94 | CONFIG_FB_ARMCLCD=y | ||
93 | CONFIG_FRAMEBUFFER_CONSOLE=y | 95 | CONFIG_FRAMEBUFFER_CONSOLE=y |
94 | CONFIG_LOGO=y | 96 | CONFIG_LOGO=y |
95 | # CONFIG_LOGO_LINUX_MONO is not set | 97 | # CONFIG_LOGO_LINUX_MONO is not set |
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 253e33bc94fb..56de5aadede2 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h | |||
@@ -37,8 +37,8 @@ typedef s32 compat_ssize_t; | |||
37 | typedef s32 compat_time_t; | 37 | typedef s32 compat_time_t; |
38 | typedef s32 compat_clock_t; | 38 | typedef s32 compat_clock_t; |
39 | typedef s32 compat_pid_t; | 39 | typedef s32 compat_pid_t; |
40 | typedef u32 __compat_uid_t; | 40 | typedef u16 __compat_uid_t; |
41 | typedef u32 __compat_gid_t; | 41 | typedef u16 __compat_gid_t; |
42 | typedef u16 __compat_uid16_t; | 42 | typedef u16 __compat_uid16_t; |
43 | typedef u16 __compat_gid16_t; | 43 | typedef u16 __compat_gid16_t; |
44 | typedef u32 __compat_uid32_t; | 44 | typedef u32 __compat_uid32_t; |
diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index 01d3aab64b79..1f65be393139 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h | |||
@@ -126,7 +126,7 @@ typedef struct user_fpsimd_state elf_fpregset_t; | |||
126 | * that it will "exec", and that there is sufficient room for the brk. | 126 | * that it will "exec", and that there is sufficient room for the brk. |
127 | */ | 127 | */ |
128 | extern unsigned long randomize_et_dyn(unsigned long base); | 128 | extern unsigned long randomize_et_dyn(unsigned long base); |
129 | #define ELF_ET_DYN_BASE (randomize_et_dyn(2 * TASK_SIZE_64 / 3)) | 129 | #define ELF_ET_DYN_BASE (2 * TASK_SIZE_64 / 3) |
130 | 130 | ||
131 | /* | 131 | /* |
132 | * When the program starts, a1 contains a pointer to a function to be | 132 | * When the program starts, a1 contains a pointer to a function to be |
@@ -169,7 +169,7 @@ extern unsigned long arch_randomize_brk(struct mm_struct *mm); | |||
169 | #define COMPAT_ELF_PLATFORM ("v8l") | 169 | #define COMPAT_ELF_PLATFORM ("v8l") |
170 | #endif | 170 | #endif |
171 | 171 | ||
172 | #define COMPAT_ELF_ET_DYN_BASE (randomize_et_dyn(2 * TASK_SIZE_32 / 3)) | 172 | #define COMPAT_ELF_ET_DYN_BASE (2 * TASK_SIZE_32 / 3) |
173 | 173 | ||
174 | /* AArch32 registers. */ | 174 | /* AArch32 registers. */ |
175 | #define COMPAT_ELF_NGREG 18 | 175 | #define COMPAT_ELF_NGREG 18 |
diff --git a/arch/arm64/include/asm/irq_work.h b/arch/arm64/include/asm/irq_work.h index 8e24ef3f7c82..b4f6b19a8a68 100644 --- a/arch/arm64/include/asm/irq_work.h +++ b/arch/arm64/include/asm/irq_work.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __ASM_IRQ_WORK_H | 1 | #ifndef __ASM_IRQ_WORK_H |
2 | #define __ASM_IRQ_WORK_H | 2 | #define __ASM_IRQ_WORK_H |
3 | 3 | ||
4 | #ifdef CONFIG_SMP | ||
5 | |||
4 | #include <asm/smp.h> | 6 | #include <asm/smp.h> |
5 | 7 | ||
6 | static inline bool arch_irq_work_has_interrupt(void) | 8 | static inline bool arch_irq_work_has_interrupt(void) |
@@ -8,4 +10,13 @@ static inline bool arch_irq_work_has_interrupt(void) | |||
8 | return !!__smp_cross_call; | 10 | return !!__smp_cross_call; |
9 | } | 11 | } |
10 | 12 | ||
13 | #else | ||
14 | |||
15 | static inline bool arch_irq_work_has_interrupt(void) | ||
16 | { | ||
17 | return false; | ||
18 | } | ||
19 | |||
20 | #endif | ||
21 | |||
11 | #endif /* __ASM_IRQ_WORK_H */ | 22 | #endif /* __ASM_IRQ_WORK_H */ |
diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 03aaa99e1ea0..95c49ebc660d 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c | |||
@@ -89,7 +89,8 @@ static int __init uefi_init(void) | |||
89 | */ | 89 | */ |
90 | if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) { | 90 | if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) { |
91 | pr_err("System table signature incorrect\n"); | 91 | pr_err("System table signature incorrect\n"); |
92 | return -EINVAL; | 92 | retval = -EINVAL; |
93 | goto out; | ||
93 | } | 94 | } |
94 | if ((efi.systab->hdr.revision >> 16) < 2) | 95 | if ((efi.systab->hdr.revision >> 16) < 2) |
95 | pr_warn("Warning: EFI system table version %d.%02d, expected 2.00 or greater\n", | 96 | pr_warn("Warning: EFI system table version %d.%02d, expected 2.00 or greater\n", |
@@ -103,6 +104,7 @@ static int __init uefi_init(void) | |||
103 | for (i = 0; i < (int) sizeof(vendor) - 1 && *c16; ++i) | 104 | for (i = 0; i < (int) sizeof(vendor) - 1 && *c16; ++i) |
104 | vendor[i] = c16[i]; | 105 | vendor[i] = c16[i]; |
105 | vendor[i] = '\0'; | 106 | vendor[i] = '\0'; |
107 | early_memunmap(c16, sizeof(vendor)); | ||
106 | } | 108 | } |
107 | 109 | ||
108 | pr_info("EFI v%u.%.02u by %s\n", | 110 | pr_info("EFI v%u.%.02u by %s\n", |
@@ -113,29 +115,11 @@ static int __init uefi_init(void) | |||
113 | if (retval == 0) | 115 | if (retval == 0) |
114 | set_bit(EFI_CONFIG_TABLES, &efi.flags); | 116 | set_bit(EFI_CONFIG_TABLES, &efi.flags); |
115 | 117 | ||
116 | early_memunmap(c16, sizeof(vendor)); | 118 | out: |
117 | early_memunmap(efi.systab, sizeof(efi_system_table_t)); | 119 | early_memunmap(efi.systab, sizeof(efi_system_table_t)); |
118 | |||
119 | return retval; | 120 | return retval; |
120 | } | 121 | } |
121 | 122 | ||
122 | static __initdata char memory_type_name[][32] = { | ||
123 | {"Reserved"}, | ||
124 | {"Loader Code"}, | ||
125 | {"Loader Data"}, | ||
126 | {"Boot Code"}, | ||
127 | {"Boot Data"}, | ||
128 | {"Runtime Code"}, | ||
129 | {"Runtime Data"}, | ||
130 | {"Conventional Memory"}, | ||
131 | {"Unusable Memory"}, | ||
132 | {"ACPI Reclaim Memory"}, | ||
133 | {"ACPI Memory NVS"}, | ||
134 | {"Memory Mapped I/O"}, | ||
135 | {"MMIO Port Space"}, | ||
136 | {"PAL Code"}, | ||
137 | }; | ||
138 | |||
139 | /* | 123 | /* |
140 | * Return true for RAM regions we want to permanently reserve. | 124 | * Return true for RAM regions we want to permanently reserve. |
141 | */ | 125 | */ |
@@ -166,10 +150,13 @@ static __init void reserve_regions(void) | |||
166 | paddr = md->phys_addr; | 150 | paddr = md->phys_addr; |
167 | npages = md->num_pages; | 151 | npages = md->num_pages; |
168 | 152 | ||
169 | if (uefi_debug) | 153 | if (uefi_debug) { |
170 | pr_info(" 0x%012llx-0x%012llx [%s]", | 154 | char buf[64]; |
155 | |||
156 | pr_info(" 0x%012llx-0x%012llx %s", | ||
171 | paddr, paddr + (npages << EFI_PAGE_SHIFT) - 1, | 157 | paddr, paddr + (npages << EFI_PAGE_SHIFT) - 1, |
172 | memory_type_name[md->type]); | 158 | efi_md_typeattr_format(buf, sizeof(buf), md)); |
159 | } | ||
173 | 160 | ||
174 | memrange_efi_to_native(&paddr, &npages); | 161 | memrange_efi_to_native(&paddr, &npages); |
175 | size = npages << PAGE_SHIFT; | 162 | size = npages << PAGE_SHIFT; |
@@ -393,11 +380,16 @@ static int __init arm64_enter_virtual_mode(void) | |||
393 | return -1; | 380 | return -1; |
394 | } | 381 | } |
395 | 382 | ||
396 | pr_info("Remapping and enabling EFI services.\n"); | ||
397 | |||
398 | /* replace early memmap mapping with permanent mapping */ | ||
399 | mapsize = memmap.map_end - memmap.map; | 383 | mapsize = memmap.map_end - memmap.map; |
400 | early_memunmap(memmap.map, mapsize); | 384 | early_memunmap(memmap.map, mapsize); |
385 | |||
386 | if (efi_runtime_disabled()) { | ||
387 | pr_info("EFI runtime services will be disabled.\n"); | ||
388 | return -1; | ||
389 | } | ||
390 | |||
391 | pr_info("Remapping and enabling EFI services.\n"); | ||
392 | /* replace early memmap mapping with permanent mapping */ | ||
401 | memmap.map = (__force void *)ioremap_cache((phys_addr_t)memmap.phys_map, | 393 | memmap.map = (__force void *)ioremap_cache((phys_addr_t)memmap.phys_map, |
402 | mapsize); | 394 | mapsize); |
403 | memmap.map_end = memmap.map + mapsize; | 395 | memmap.map_end = memmap.map + mapsize; |
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index c3065dbc4fa2..fde9923af859 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c | |||
@@ -378,8 +378,3 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) | |||
378 | { | 378 | { |
379 | return randomize_base(mm->brk); | 379 | return randomize_base(mm->brk); |
380 | } | 380 | } |
381 | |||
382 | unsigned long randomize_et_dyn(unsigned long base) | ||
383 | { | ||
384 | return randomize_base(base); | ||
385 | } | ||
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index fe63ac5e9bf5..8a4ae8e73213 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c | |||
@@ -1120,8 +1120,8 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs) | |||
1120 | if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) | 1120 | if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) |
1121 | trace_sys_enter(regs, regs->syscallno); | 1121 | trace_sys_enter(regs, regs->syscallno); |
1122 | 1122 | ||
1123 | audit_syscall_entry(syscall_get_arch(), regs->syscallno, | 1123 | audit_syscall_entry(regs->syscallno, regs->orig_x0, regs->regs[1], |
1124 | regs->orig_x0, regs->regs[1], regs->regs[2], regs->regs[3]); | 1124 | regs->regs[2], regs->regs[3]); |
1125 | 1125 | ||
1126 | return regs->syscallno; | 1126 | return regs->syscallno; |
1127 | } | 1127 | } |
diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c index fa324bd5a5c4..4a07630a6616 100644 --- a/arch/arm64/mm/ioremap.c +++ b/arch/arm64/mm/ioremap.c | |||
@@ -105,10 +105,10 @@ EXPORT_SYMBOL(ioremap_cache); | |||
105 | 105 | ||
106 | static pte_t bm_pte[PTRS_PER_PTE] __page_aligned_bss; | 106 | static pte_t bm_pte[PTRS_PER_PTE] __page_aligned_bss; |
107 | #if CONFIG_ARM64_PGTABLE_LEVELS > 2 | 107 | #if CONFIG_ARM64_PGTABLE_LEVELS > 2 |
108 | static pte_t bm_pmd[PTRS_PER_PMD] __page_aligned_bss; | 108 | static pmd_t bm_pmd[PTRS_PER_PMD] __page_aligned_bss; |
109 | #endif | 109 | #endif |
110 | #if CONFIG_ARM64_PGTABLE_LEVELS > 3 | 110 | #if CONFIG_ARM64_PGTABLE_LEVELS > 3 |
111 | static pte_t bm_pud[PTRS_PER_PUD] __page_aligned_bss; | 111 | static pud_t bm_pud[PTRS_PER_PUD] __page_aligned_bss; |
112 | #endif | 112 | #endif |
113 | 113 | ||
114 | static inline pud_t * __init early_ioremap_pud(unsigned long addr) | 114 | static inline pud_t * __init early_ioremap_pud(unsigned long addr) |
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 6894ef3e6234..0bf90d26e745 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c | |||
@@ -297,11 +297,15 @@ static void __init map_mem(void) | |||
297 | * create_mapping requires puds, pmds and ptes to be allocated from | 297 | * create_mapping requires puds, pmds and ptes to be allocated from |
298 | * memory addressable from the initial direct kernel mapping. | 298 | * memory addressable from the initial direct kernel mapping. |
299 | * | 299 | * |
300 | * The initial direct kernel mapping, located at swapper_pg_dir, | 300 | * The initial direct kernel mapping, located at swapper_pg_dir, gives |
301 | * gives us PUD_SIZE memory starting from PHYS_OFFSET (which must be | 301 | * us PUD_SIZE (4K pages) or PMD_SIZE (64K pages) memory starting from |
302 | * aligned to 2MB as per Documentation/arm64/booting.txt). | 302 | * PHYS_OFFSET (which must be aligned to 2MB as per |
303 | * Documentation/arm64/booting.txt). | ||
303 | */ | 304 | */ |
304 | limit = PHYS_OFFSET + PUD_SIZE; | 305 | if (IS_ENABLED(CONFIG_ARM64_64K_PAGES)) |
306 | limit = PHYS_OFFSET + PMD_SIZE; | ||
307 | else | ||
308 | limit = PHYS_OFFSET + PUD_SIZE; | ||
305 | memblock_set_current_limit(limit); | 309 | memblock_set_current_limit(limit); |
306 | 310 | ||
307 | /* map all the memory banks */ | 311 | /* map all the memory banks */ |
diff --git a/arch/arm64/mm/pgd.c b/arch/arm64/mm/pgd.c index 62c6101df260..6682b361d3ac 100644 --- a/arch/arm64/mm/pgd.c +++ b/arch/arm64/mm/pgd.c | |||
@@ -30,12 +30,14 @@ | |||
30 | 30 | ||
31 | #define PGD_SIZE (PTRS_PER_PGD * sizeof(pgd_t)) | 31 | #define PGD_SIZE (PTRS_PER_PGD * sizeof(pgd_t)) |
32 | 32 | ||
33 | static struct kmem_cache *pgd_cache; | ||
34 | |||
33 | pgd_t *pgd_alloc(struct mm_struct *mm) | 35 | pgd_t *pgd_alloc(struct mm_struct *mm) |
34 | { | 36 | { |
35 | if (PGD_SIZE == PAGE_SIZE) | 37 | if (PGD_SIZE == PAGE_SIZE) |
36 | return (pgd_t *)get_zeroed_page(GFP_KERNEL); | 38 | return (pgd_t *)get_zeroed_page(GFP_KERNEL); |
37 | else | 39 | else |
38 | return kzalloc(PGD_SIZE, GFP_KERNEL); | 40 | return kmem_cache_zalloc(pgd_cache, GFP_KERNEL); |
39 | } | 41 | } |
40 | 42 | ||
41 | void pgd_free(struct mm_struct *mm, pgd_t *pgd) | 43 | void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
@@ -43,5 +45,17 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd) | |||
43 | if (PGD_SIZE == PAGE_SIZE) | 45 | if (PGD_SIZE == PAGE_SIZE) |
44 | free_page((unsigned long)pgd); | 46 | free_page((unsigned long)pgd); |
45 | else | 47 | else |
46 | kfree(pgd); | 48 | kmem_cache_free(pgd_cache, pgd); |
49 | } | ||
50 | |||
51 | static int __init pgd_cache_init(void) | ||
52 | { | ||
53 | /* | ||
54 | * Naturally aligned pgds required by the architecture. | ||
55 | */ | ||
56 | if (PGD_SIZE != PAGE_SIZE) | ||
57 | pgd_cache = kmem_cache_create("pgd_cache", PGD_SIZE, PGD_SIZE, | ||
58 | SLAB_PANIC, NULL); | ||
59 | return 0; | ||
47 | } | 60 | } |
61 | core_initcall(pgd_cache_init); | ||
diff --git a/arch/arm64/net/bpf_jit.h b/arch/arm64/net/bpf_jit.h index 2134f7e6c288..de0a81a539a0 100644 --- a/arch/arm64/net/bpf_jit.h +++ b/arch/arm64/net/bpf_jit.h | |||
@@ -144,8 +144,12 @@ | |||
144 | 144 | ||
145 | /* Data-processing (2 source) */ | 145 | /* Data-processing (2 source) */ |
146 | /* Rd = Rn OP Rm */ | 146 | /* Rd = Rn OP Rm */ |
147 | #define A64_UDIV(sf, Rd, Rn, Rm) aarch64_insn_gen_data2(Rd, Rn, Rm, \ | 147 | #define A64_DATA2(sf, Rd, Rn, Rm, type) aarch64_insn_gen_data2(Rd, Rn, Rm, \ |
148 | A64_VARIANT(sf), AARCH64_INSN_DATA2_UDIV) | 148 | A64_VARIANT(sf), AARCH64_INSN_DATA2_##type) |
149 | #define A64_UDIV(sf, Rd, Rn, Rm) A64_DATA2(sf, Rd, Rn, Rm, UDIV) | ||
150 | #define A64_LSLV(sf, Rd, Rn, Rm) A64_DATA2(sf, Rd, Rn, Rm, LSLV) | ||
151 | #define A64_LSRV(sf, Rd, Rn, Rm) A64_DATA2(sf, Rd, Rn, Rm, LSRV) | ||
152 | #define A64_ASRV(sf, Rd, Rn, Rm) A64_DATA2(sf, Rd, Rn, Rm, ASRV) | ||
149 | 153 | ||
150 | /* Data-processing (3 source) */ | 154 | /* Data-processing (3 source) */ |
151 | /* Rd = Ra + Rn * Rm */ | 155 | /* Rd = Ra + Rn * Rm */ |
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 7ae33545535b..41f1e3e2ea24 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c | |||
@@ -19,12 +19,13 @@ | |||
19 | #define pr_fmt(fmt) "bpf_jit: " fmt | 19 | #define pr_fmt(fmt) "bpf_jit: " fmt |
20 | 20 | ||
21 | #include <linux/filter.h> | 21 | #include <linux/filter.h> |
22 | #include <linux/moduleloader.h> | ||
23 | #include <linux/printk.h> | 22 | #include <linux/printk.h> |
24 | #include <linux/skbuff.h> | 23 | #include <linux/skbuff.h> |
25 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | |||
26 | #include <asm/byteorder.h> | 26 | #include <asm/byteorder.h> |
27 | #include <asm/cacheflush.h> | 27 | #include <asm/cacheflush.h> |
28 | #include <asm/debug-monitors.h> | ||
28 | 29 | ||
29 | #include "bpf_jit.h" | 30 | #include "bpf_jit.h" |
30 | 31 | ||
@@ -119,6 +120,14 @@ static inline int bpf2a64_offset(int bpf_to, int bpf_from, | |||
119 | return to - from; | 120 | return to - from; |
120 | } | 121 | } |
121 | 122 | ||
123 | static void jit_fill_hole(void *area, unsigned int size) | ||
124 | { | ||
125 | u32 *ptr; | ||
126 | /* We are guaranteed to have aligned memory. */ | ||
127 | for (ptr = area; size >= sizeof(u32); size -= sizeof(u32)) | ||
128 | *ptr++ = cpu_to_le32(AARCH64_BREAK_FAULT); | ||
129 | } | ||
130 | |||
122 | static inline int epilogue_offset(const struct jit_ctx *ctx) | 131 | static inline int epilogue_offset(const struct jit_ctx *ctx) |
123 | { | 132 | { |
124 | int to = ctx->offset[ctx->prog->len - 1]; | 133 | int to = ctx->offset[ctx->prog->len - 1]; |
@@ -196,6 +205,12 @@ static void build_epilogue(struct jit_ctx *ctx) | |||
196 | emit(A64_RET(A64_LR), ctx); | 205 | emit(A64_RET(A64_LR), ctx); |
197 | } | 206 | } |
198 | 207 | ||
208 | /* JITs an eBPF instruction. | ||
209 | * Returns: | ||
210 | * 0 - successfully JITed an 8-byte eBPF instruction. | ||
211 | * >0 - successfully JITed a 16-byte eBPF instruction. | ||
212 | * <0 - failed to JIT. | ||
213 | */ | ||
199 | static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) | 214 | static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) |
200 | { | 215 | { |
201 | const u8 code = insn->code; | 216 | const u8 code = insn->code; |
@@ -252,6 +267,18 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) | |||
252 | emit(A64_MUL(is64, tmp, tmp, src), ctx); | 267 | emit(A64_MUL(is64, tmp, tmp, src), ctx); |
253 | emit(A64_SUB(is64, dst, dst, tmp), ctx); | 268 | emit(A64_SUB(is64, dst, dst, tmp), ctx); |
254 | break; | 269 | break; |
270 | case BPF_ALU | BPF_LSH | BPF_X: | ||
271 | case BPF_ALU64 | BPF_LSH | BPF_X: | ||
272 | emit(A64_LSLV(is64, dst, dst, src), ctx); | ||
273 | break; | ||
274 | case BPF_ALU | BPF_RSH | BPF_X: | ||
275 | case BPF_ALU64 | BPF_RSH | BPF_X: | ||
276 | emit(A64_LSRV(is64, dst, dst, src), ctx); | ||
277 | break; | ||
278 | case BPF_ALU | BPF_ARSH | BPF_X: | ||
279 | case BPF_ALU64 | BPF_ARSH | BPF_X: | ||
280 | emit(A64_ASRV(is64, dst, dst, src), ctx); | ||
281 | break; | ||
255 | /* dst = -dst */ | 282 | /* dst = -dst */ |
256 | case BPF_ALU | BPF_NEG: | 283 | case BPF_ALU | BPF_NEG: |
257 | case BPF_ALU64 | BPF_NEG: | 284 | case BPF_ALU64 | BPF_NEG: |
@@ -443,6 +470,27 @@ emit_cond_jmp: | |||
443 | emit(A64_B(jmp_offset), ctx); | 470 | emit(A64_B(jmp_offset), ctx); |
444 | break; | 471 | break; |
445 | 472 | ||
473 | /* dst = imm64 */ | ||
474 | case BPF_LD | BPF_IMM | BPF_DW: | ||
475 | { | ||
476 | const struct bpf_insn insn1 = insn[1]; | ||
477 | u64 imm64; | ||
478 | |||
479 | if (insn1.code != 0 || insn1.src_reg != 0 || | ||
480 | insn1.dst_reg != 0 || insn1.off != 0) { | ||
481 | /* Note: verifier in BPF core must catch invalid | ||
482 | * instructions. | ||
483 | */ | ||
484 | pr_err_once("Invalid BPF_LD_IMM64 instruction\n"); | ||
485 | return -EINVAL; | ||
486 | } | ||
487 | |||
488 | imm64 = (u64)insn1.imm << 32 | imm; | ||
489 | emit_a64_mov_i64(dst, imm64, ctx); | ||
490 | |||
491 | return 1; | ||
492 | } | ||
493 | |||
446 | /* LDX: dst = *(size *)(src + off) */ | 494 | /* LDX: dst = *(size *)(src + off) */ |
447 | case BPF_LDX | BPF_MEM | BPF_W: | 495 | case BPF_LDX | BPF_MEM | BPF_W: |
448 | case BPF_LDX | BPF_MEM | BPF_H: | 496 | case BPF_LDX | BPF_MEM | BPF_H: |
@@ -594,6 +642,10 @@ static int build_body(struct jit_ctx *ctx) | |||
594 | ctx->offset[i] = ctx->idx; | 642 | ctx->offset[i] = ctx->idx; |
595 | 643 | ||
596 | ret = build_insn(insn, ctx); | 644 | ret = build_insn(insn, ctx); |
645 | if (ret > 0) { | ||
646 | i++; | ||
647 | continue; | ||
648 | } | ||
597 | if (ret) | 649 | if (ret) |
598 | return ret; | 650 | return ret; |
599 | } | 651 | } |
@@ -613,8 +665,10 @@ void bpf_jit_compile(struct bpf_prog *prog) | |||
613 | 665 | ||
614 | void bpf_int_jit_compile(struct bpf_prog *prog) | 666 | void bpf_int_jit_compile(struct bpf_prog *prog) |
615 | { | 667 | { |
668 | struct bpf_binary_header *header; | ||
616 | struct jit_ctx ctx; | 669 | struct jit_ctx ctx; |
617 | int image_size; | 670 | int image_size; |
671 | u8 *image_ptr; | ||
618 | 672 | ||
619 | if (!bpf_jit_enable) | 673 | if (!bpf_jit_enable) |
620 | return; | 674 | return; |
@@ -636,23 +690,25 @@ void bpf_int_jit_compile(struct bpf_prog *prog) | |||
636 | goto out; | 690 | goto out; |
637 | 691 | ||
638 | build_prologue(&ctx); | 692 | build_prologue(&ctx); |
639 | |||
640 | build_epilogue(&ctx); | 693 | build_epilogue(&ctx); |
641 | 694 | ||
642 | /* Now we know the actual image size. */ | 695 | /* Now we know the actual image size. */ |
643 | image_size = sizeof(u32) * ctx.idx; | 696 | image_size = sizeof(u32) * ctx.idx; |
644 | ctx.image = module_alloc(image_size); | 697 | header = bpf_jit_binary_alloc(image_size, &image_ptr, |
645 | if (unlikely(ctx.image == NULL)) | 698 | sizeof(u32), jit_fill_hole); |
699 | if (header == NULL) | ||
646 | goto out; | 700 | goto out; |
647 | 701 | ||
648 | /* 2. Now, the actual pass. */ | 702 | /* 2. Now, the actual pass. */ |
649 | 703 | ||
704 | ctx.image = (u32 *)image_ptr; | ||
650 | ctx.idx = 0; | 705 | ctx.idx = 0; |
706 | |||
651 | build_prologue(&ctx); | 707 | build_prologue(&ctx); |
652 | 708 | ||
653 | ctx.body_offset = ctx.idx; | 709 | ctx.body_offset = ctx.idx; |
654 | if (build_body(&ctx)) { | 710 | if (build_body(&ctx)) { |
655 | module_free(NULL, ctx.image); | 711 | bpf_jit_binary_free(header); |
656 | goto out; | 712 | goto out; |
657 | } | 713 | } |
658 | 714 | ||
@@ -663,17 +719,25 @@ void bpf_int_jit_compile(struct bpf_prog *prog) | |||
663 | bpf_jit_dump(prog->len, image_size, 2, ctx.image); | 719 | bpf_jit_dump(prog->len, image_size, 2, ctx.image); |
664 | 720 | ||
665 | bpf_flush_icache(ctx.image, ctx.image + ctx.idx); | 721 | bpf_flush_icache(ctx.image, ctx.image + ctx.idx); |
666 | prog->bpf_func = (void *)ctx.image; | ||
667 | prog->jited = 1; | ||
668 | 722 | ||
723 | set_memory_ro((unsigned long)header, header->pages); | ||
724 | prog->bpf_func = (void *)ctx.image; | ||
725 | prog->jited = true; | ||
669 | out: | 726 | out: |
670 | kfree(ctx.offset); | 727 | kfree(ctx.offset); |
671 | } | 728 | } |
672 | 729 | ||
673 | void bpf_jit_free(struct bpf_prog *prog) | 730 | void bpf_jit_free(struct bpf_prog *prog) |
674 | { | 731 | { |
675 | if (prog->jited) | 732 | unsigned long addr = (unsigned long)prog->bpf_func & PAGE_MASK; |
676 | module_free(NULL, prog->bpf_func); | 733 | struct bpf_binary_header *header = (void *)addr; |
734 | |||
735 | if (!prog->jited) | ||
736 | goto free_filter; | ||
737 | |||
738 | set_memory_rw(addr, header->pages); | ||
739 | bpf_jit_binary_free(header); | ||
677 | 740 | ||
678 | kfree(prog); | 741 | free_filter: |
742 | bpf_prog_unlock_free(prog); | ||
679 | } | 743 | } |
diff --git a/arch/ia64/include/asm/syscall.h b/arch/ia64/include/asm/syscall.h index a7ff1c6ab068..1d0b875fec44 100644 --- a/arch/ia64/include/asm/syscall.h +++ b/arch/ia64/include/asm/syscall.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #ifndef _ASM_SYSCALL_H | 13 | #ifndef _ASM_SYSCALL_H |
14 | #define _ASM_SYSCALL_H 1 | 14 | #define _ASM_SYSCALL_H 1 |
15 | 15 | ||
16 | #include <uapi/linux/audit.h> | ||
16 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
17 | #include <linux/err.h> | 18 | #include <linux/err.h> |
18 | 19 | ||
@@ -79,4 +80,9 @@ static inline void syscall_set_arguments(struct task_struct *task, | |||
79 | 80 | ||
80 | ia64_syscall_get_set_arguments(task, regs, i, n, args, 1); | 81 | ia64_syscall_get_set_arguments(task, regs, i, n, args, 1); |
81 | } | 82 | } |
83 | |||
84 | static inline int syscall_get_arch(void) | ||
85 | { | ||
86 | return AUDIT_ARCH_IA64; | ||
87 | } | ||
82 | #endif /* _ASM_SYSCALL_H */ | 88 | #endif /* _ASM_SYSCALL_H */ |
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 741b99c1a0b1..c52d7540dc05 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c | |||
@@ -568,6 +568,7 @@ efi_init (void) | |||
568 | { | 568 | { |
569 | const char *unit; | 569 | const char *unit; |
570 | unsigned long size; | 570 | unsigned long size; |
571 | char buf[64]; | ||
571 | 572 | ||
572 | md = p; | 573 | md = p; |
573 | size = md->num_pages << EFI_PAGE_SHIFT; | 574 | size = md->num_pages << EFI_PAGE_SHIFT; |
@@ -586,9 +587,10 @@ efi_init (void) | |||
586 | unit = "KB"; | 587 | unit = "KB"; |
587 | } | 588 | } |
588 | 589 | ||
589 | printk("mem%02d: type=%2u, attr=0x%016lx, " | 590 | printk("mem%02d: %s " |
590 | "range=[0x%016lx-0x%016lx) (%4lu%s)\n", | 591 | "range=[0x%016lx-0x%016lx) (%4lu%s)\n", |
591 | i, md->type, md->attribute, md->phys_addr, | 592 | i, efi_md_typeattr_format(buf, sizeof(buf), md), |
593 | md->phys_addr, | ||
592 | md->phys_addr + efi_md_size(md), size, unit); | 594 | md->phys_addr + efi_md_size(md), size, unit); |
593 | } | 595 | } |
594 | } | 596 | } |
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c index b7a5fffe0924..6f54d511cc50 100644 --- a/arch/ia64/kernel/ptrace.c +++ b/arch/ia64/kernel/ptrace.c | |||
@@ -1219,7 +1219,7 @@ syscall_trace_enter (long arg0, long arg1, long arg2, long arg3, | |||
1219 | ia64_sync_krbs(); | 1219 | ia64_sync_krbs(); |
1220 | 1220 | ||
1221 | 1221 | ||
1222 | audit_syscall_entry(AUDIT_ARCH_IA64, regs.r15, arg0, arg1, arg2, arg3); | 1222 | audit_syscall_entry(regs.r15, arg0, arg1, arg2, arg3); |
1223 | 1223 | ||
1224 | return 0; | 1224 | return 0; |
1225 | } | 1225 | } |
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 6feded3b0c4c..a7736fa0580c 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig | |||
@@ -129,6 +129,10 @@ endmenu | |||
129 | 129 | ||
130 | menu "Kernel features" | 130 | menu "Kernel features" |
131 | 131 | ||
132 | config NR_CPUS | ||
133 | int | ||
134 | default "1" | ||
135 | |||
132 | config ADVANCED_OPTIONS | 136 | config ADVANCED_OPTIONS |
133 | bool "Prompt for advanced kernel configuration options" | 137 | bool "Prompt for advanced kernel configuration options" |
134 | help | 138 | help |
diff --git a/arch/microblaze/include/asm/syscall.h b/arch/microblaze/include/asm/syscall.h index 9bc431783105..53cfaf34c343 100644 --- a/arch/microblaze/include/asm/syscall.h +++ b/arch/microblaze/include/asm/syscall.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __ASM_MICROBLAZE_SYSCALL_H | 1 | #ifndef __ASM_MICROBLAZE_SYSCALL_H |
2 | #define __ASM_MICROBLAZE_SYSCALL_H | 2 | #define __ASM_MICROBLAZE_SYSCALL_H |
3 | 3 | ||
4 | #include <uapi/linux/audit.h> | ||
4 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
5 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
6 | #include <asm/ptrace.h> | 7 | #include <asm/ptrace.h> |
@@ -99,4 +100,8 @@ static inline void syscall_set_arguments(struct task_struct *task, | |||
99 | asmlinkage long do_syscall_trace_enter(struct pt_regs *regs); | 100 | asmlinkage long do_syscall_trace_enter(struct pt_regs *regs); |
100 | asmlinkage void do_syscall_trace_leave(struct pt_regs *regs); | 101 | asmlinkage void do_syscall_trace_leave(struct pt_regs *regs); |
101 | 102 | ||
103 | static inline int syscall_get_arch(void) | ||
104 | { | ||
105 | return AUDIT_ARCH_MICROBLAZE; | ||
106 | } | ||
102 | #endif /* __ASM_MICROBLAZE_SYSCALL_H */ | 107 | #endif /* __ASM_MICROBLAZE_SYSCALL_H */ |
diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h index ea4b233647c1..0a53362d5548 100644 --- a/arch/microblaze/include/asm/unistd.h +++ b/arch/microblaze/include/asm/unistd.h | |||
@@ -38,6 +38,6 @@ | |||
38 | 38 | ||
39 | #endif /* __ASSEMBLY__ */ | 39 | #endif /* __ASSEMBLY__ */ |
40 | 40 | ||
41 | #define __NR_syscalls 387 | 41 | #define __NR_syscalls 388 |
42 | 42 | ||
43 | #endif /* _ASM_MICROBLAZE_UNISTD_H */ | 43 | #endif /* _ASM_MICROBLAZE_UNISTD_H */ |
diff --git a/arch/microblaze/include/uapi/asm/unistd.h b/arch/microblaze/include/uapi/asm/unistd.h index 1c2380bf8fe6..c712677f8a2a 100644 --- a/arch/microblaze/include/uapi/asm/unistd.h +++ b/arch/microblaze/include/uapi/asm/unistd.h | |||
@@ -402,5 +402,6 @@ | |||
402 | #define __NR_seccomp 384 | 402 | #define __NR_seccomp 384 |
403 | #define __NR_getrandom 385 | 403 | #define __NR_getrandom 385 |
404 | #define __NR_memfd_create 386 | 404 | #define __NR_memfd_create 386 |
405 | #define __NR_bpf 387 | ||
405 | 406 | ||
406 | #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ | 407 | #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ |
diff --git a/arch/microblaze/kernel/ptrace.c b/arch/microblaze/kernel/ptrace.c index 39cf50841f6d..bb10637ce688 100644 --- a/arch/microblaze/kernel/ptrace.c +++ b/arch/microblaze/kernel/ptrace.c | |||
@@ -147,8 +147,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) | |||
147 | */ | 147 | */ |
148 | ret = -1L; | 148 | ret = -1L; |
149 | 149 | ||
150 | audit_syscall_entry(EM_MICROBLAZE, regs->r12, regs->r5, regs->r6, | 150 | audit_syscall_entry(regs->r12, regs->r5, regs->r6, regs->r7, regs->r8); |
151 | regs->r7, regs->r8); | ||
152 | 151 | ||
153 | return ret ?: regs->r12; | 152 | return ret ?: regs->r12; |
154 | } | 153 | } |
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S index de59ee1d7010..0166e890486c 100644 --- a/arch/microblaze/kernel/syscall_table.S +++ b/arch/microblaze/kernel/syscall_table.S | |||
@@ -387,3 +387,4 @@ ENTRY(sys_call_table) | |||
387 | .long sys_seccomp | 387 | .long sys_seccomp |
388 | .long sys_getrandom /* 385 */ | 388 | .long sys_getrandom /* 385 */ |
389 | .long sys_memfd_create | 389 | .long sys_memfd_create |
390 | .long sys_bpf | ||
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 9037914f6985..b30e41c0c033 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c | |||
@@ -660,8 +660,13 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose, | |||
660 | res = &hose->mem_resources[memno++]; | 660 | res = &hose->mem_resources[memno++]; |
661 | break; | 661 | break; |
662 | } | 662 | } |
663 | if (res != NULL) | 663 | if (res != NULL) { |
664 | of_pci_range_to_resource(&range, dev, res); | 664 | res->name = dev->full_name; |
665 | res->flags = range.flags; | ||
666 | res->start = range.cpu_addr; | ||
667 | res->end = range.cpu_addr + range.size - 1; | ||
668 | res->parent = res->child = res->sibling = NULL; | ||
669 | } | ||
665 | } | 670 | } |
666 | 671 | ||
667 | /* If there's an ISA hole and the pci_mem_offset is -not- matching | 672 | /* If there's an ISA hole and the pci_mem_offset is -not- matching |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index ad6badb6be71..f43aa536c517 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -2066,6 +2066,7 @@ config MIPS_CPS | |||
2066 | support is unavailable. | 2066 | support is unavailable. |
2067 | 2067 | ||
2068 | config MIPS_CPS_PM | 2068 | config MIPS_CPS_PM |
2069 | depends on MIPS_CPS | ||
2069 | select MIPS_CPC | 2070 | select MIPS_CPC |
2070 | bool | 2071 | bool |
2071 | 2072 | ||
diff --git a/arch/mips/ath79/mach-db120.c b/arch/mips/ath79/mach-db120.c index 4d661a1d2dae..9423f5aed287 100644 --- a/arch/mips/ath79/mach-db120.c +++ b/arch/mips/ath79/mach-db120.c | |||
@@ -113,7 +113,7 @@ static void __init db120_pci_init(u8 *eeprom) | |||
113 | ath79_register_pci(); | 113 | ath79_register_pci(); |
114 | } | 114 | } |
115 | #else | 115 | #else |
116 | static inline void db120_pci_init(void) {} | 116 | static inline void db120_pci_init(u8 *eeprom) {} |
117 | #endif /* CONFIG_PCI */ | 117 | #endif /* CONFIG_PCI */ |
118 | 118 | ||
119 | static void __init db120_setup(void) | 119 | static void __init db120_setup(void) |
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c index 38f4c32e2816..5ebdb32d9a2b 100644 --- a/arch/mips/cavium-octeon/setup.c +++ b/arch/mips/cavium-octeon/setup.c | |||
@@ -806,15 +806,6 @@ void __init prom_init(void) | |||
806 | #endif | 806 | #endif |
807 | } | 807 | } |
808 | 808 | ||
809 | if (octeon_is_simulation()) { | ||
810 | /* | ||
811 | * The simulator uses a mtdram device pre filled with | ||
812 | * the filesystem. Also specify the calibration delay | ||
813 | * to avoid calculating it every time. | ||
814 | */ | ||
815 | strcat(arcs_cmdline, " rw root=1f00 slram=root,0x40000000,+1073741824"); | ||
816 | } | ||
817 | |||
818 | mips_hpt_frequency = octeon_get_clock_rate(); | 809 | mips_hpt_frequency = octeon_get_clock_rate(); |
819 | 810 | ||
820 | octeon_init_cvmcount(); | 811 | octeon_init_cvmcount(); |
diff --git a/arch/mips/include/asm/cop2.h b/arch/mips/include/asm/cop2.h index 51f80bd36fcc..63b3468ede4c 100644 --- a/arch/mips/include/asm/cop2.h +++ b/arch/mips/include/asm/cop2.h | |||
@@ -37,15 +37,15 @@ extern void nlm_cop2_restore(struct nlm_cop2_state *); | |||
37 | 37 | ||
38 | #define cop2_present 1 | 38 | #define cop2_present 1 |
39 | #define cop2_lazy_restore 1 | 39 | #define cop2_lazy_restore 1 |
40 | #define cop2_save(r) do { (r); } while (0) | 40 | #define cop2_save(r) do { (void)(r); } while (0) |
41 | #define cop2_restore(r) do { (r); } while (0) | 41 | #define cop2_restore(r) do { (void)(r); } while (0) |
42 | 42 | ||
43 | #else | 43 | #else |
44 | 44 | ||
45 | #define cop2_present 0 | 45 | #define cop2_present 0 |
46 | #define cop2_lazy_restore 0 | 46 | #define cop2_lazy_restore 0 |
47 | #define cop2_save(r) do { (r); } while (0) | 47 | #define cop2_save(r) do { (void)(r); } while (0) |
48 | #define cop2_restore(r) do { (r); } while (0) | 48 | #define cop2_restore(r) do { (void)(r); } while (0) |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | enum cu2_ops { | 51 | enum cu2_ops { |
diff --git a/arch/mips/include/asm/ftrace.h b/arch/mips/include/asm/ftrace.h index 992aaba603b5..b463f2aa5a61 100644 --- a/arch/mips/include/asm/ftrace.h +++ b/arch/mips/include/asm/ftrace.h | |||
@@ -24,7 +24,7 @@ do { \ | |||
24 | asm volatile ( \ | 24 | asm volatile ( \ |
25 | "1: " load " %[tmp_dst], 0(%[tmp_src])\n" \ | 25 | "1: " load " %[tmp_dst], 0(%[tmp_src])\n" \ |
26 | " li %[tmp_err], 0\n" \ | 26 | " li %[tmp_err], 0\n" \ |
27 | "2:\n" \ | 27 | "2: .insn\n" \ |
28 | \ | 28 | \ |
29 | ".section .fixup, \"ax\"\n" \ | 29 | ".section .fixup, \"ax\"\n" \ |
30 | "3: li %[tmp_err], 1\n" \ | 30 | "3: li %[tmp_err], 1\n" \ |
@@ -46,7 +46,7 @@ do { \ | |||
46 | asm volatile ( \ | 46 | asm volatile ( \ |
47 | "1: " store " %[tmp_src], 0(%[tmp_dst])\n"\ | 47 | "1: " store " %[tmp_src], 0(%[tmp_dst])\n"\ |
48 | " li %[tmp_err], 0\n" \ | 48 | " li %[tmp_err], 0\n" \ |
49 | "2:\n" \ | 49 | "2: .insn\n" \ |
50 | \ | 50 | \ |
51 | ".section .fixup, \"ax\"\n" \ | 51 | ".section .fixup, \"ax\"\n" \ |
52 | "3: li %[tmp_err], 1\n" \ | 52 | "3: li %[tmp_err], 1\n" \ |
diff --git a/arch/mips/include/asm/idle.h b/arch/mips/include/asm/idle.h index d9f932de80e9..1c967abd545c 100644 --- a/arch/mips/include/asm/idle.h +++ b/arch/mips/include/asm/idle.h | |||
@@ -8,19 +8,12 @@ extern void (*cpu_wait)(void); | |||
8 | extern void r4k_wait(void); | 8 | extern void r4k_wait(void); |
9 | extern asmlinkage void __r4k_wait(void); | 9 | extern asmlinkage void __r4k_wait(void); |
10 | extern void r4k_wait_irqoff(void); | 10 | extern void r4k_wait_irqoff(void); |
11 | extern void __pastwait(void); | ||
12 | 11 | ||
13 | static inline int using_rollback_handler(void) | 12 | static inline int using_rollback_handler(void) |
14 | { | 13 | { |
15 | return cpu_wait == r4k_wait; | 14 | return cpu_wait == r4k_wait; |
16 | } | 15 | } |
17 | 16 | ||
18 | static inline int address_is_in_r4k_wait_irqoff(unsigned long addr) | ||
19 | { | ||
20 | return addr >= (unsigned long)r4k_wait_irqoff && | ||
21 | addr < (unsigned long)__pastwait; | ||
22 | } | ||
23 | |||
24 | extern int mips_cpuidle_wait_enter(struct cpuidle_device *dev, | 17 | extern int mips_cpuidle_wait_enter(struct cpuidle_device *dev, |
25 | struct cpuidle_driver *drv, int index); | 18 | struct cpuidle_driver *drv, int index); |
26 | 19 | ||
diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h index cdf68b33bd65..bb7963753730 100644 --- a/arch/mips/include/asm/syscall.h +++ b/arch/mips/include/asm/syscall.h | |||
@@ -129,7 +129,7 @@ extern const unsigned long sysn32_call_table[]; | |||
129 | 129 | ||
130 | static inline int syscall_get_arch(void) | 130 | static inline int syscall_get_arch(void) |
131 | { | 131 | { |
132 | int arch = EM_MIPS; | 132 | int arch = AUDIT_ARCH_MIPS; |
133 | #ifdef CONFIG_64BIT | 133 | #ifdef CONFIG_64BIT |
134 | if (!test_thread_flag(TIF_32BIT_REGS)) { | 134 | if (!test_thread_flag(TIF_32BIT_REGS)) { |
135 | arch |= __AUDIT_ARCH_64BIT; | 135 | arch |= __AUDIT_ARCH_64BIT; |
diff --git a/arch/mips/include/uapi/asm/ptrace.h b/arch/mips/include/uapi/asm/ptrace.h index bbcfb8ba8106..91a3d197ede3 100644 --- a/arch/mips/include/uapi/asm/ptrace.h +++ b/arch/mips/include/uapi/asm/ptrace.h | |||
@@ -9,6 +9,8 @@ | |||
9 | #ifndef _UAPI_ASM_PTRACE_H | 9 | #ifndef _UAPI_ASM_PTRACE_H |
10 | #define _UAPI_ASM_PTRACE_H | 10 | #define _UAPI_ASM_PTRACE_H |
11 | 11 | ||
12 | #include <linux/types.h> | ||
13 | |||
12 | /* 0 - 31 are integer registers, 32 - 63 are fp registers. */ | 14 | /* 0 - 31 are integer registers, 32 - 63 are fp registers. */ |
13 | #define FPR_BASE 32 | 15 | #define FPR_BASE 32 |
14 | #define PC 64 | 16 | #define PC 64 |
diff --git a/arch/mips/kernel/idle.c b/arch/mips/kernel/idle.c index 09ce45980758..0b9082b6b683 100644 --- a/arch/mips/kernel/idle.c +++ b/arch/mips/kernel/idle.c | |||
@@ -68,9 +68,6 @@ void r4k_wait_irqoff(void) | |||
68 | " wait \n" | 68 | " wait \n" |
69 | " .set pop \n"); | 69 | " .set pop \n"); |
70 | local_irq_enable(); | 70 | local_irq_enable(); |
71 | __asm__( | ||
72 | " .globl __pastwait \n" | ||
73 | "__pastwait: \n"); | ||
74 | } | 71 | } |
75 | 72 | ||
76 | /* | 73 | /* |
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index f7aac5b57b4b..9d1487d83293 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c | |||
@@ -780,9 +780,7 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall) | |||
780 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 780 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
781 | trace_sys_enter(regs, regs->regs[2]); | 781 | trace_sys_enter(regs, regs->regs[2]); |
782 | 782 | ||
783 | audit_syscall_entry(syscall_get_arch(), | 783 | audit_syscall_entry(syscall, regs->regs[4], regs->regs[5], |
784 | syscall, | ||
785 | regs->regs[4], regs->regs[5], | ||
786 | regs->regs[6], regs->regs[7]); | 784 | regs->regs[6], regs->regs[7]); |
787 | return syscall; | 785 | return syscall; |
788 | } | 786 | } |
diff --git a/arch/mips/lasat/Kconfig b/arch/mips/lasat/Kconfig index 1d2ee8a9be13..8776d0a34274 100644 --- a/arch/mips/lasat/Kconfig +++ b/arch/mips/lasat/Kconfig | |||
@@ -4,7 +4,7 @@ config PICVUE | |||
4 | 4 | ||
5 | config PICVUE_PROC | 5 | config PICVUE_PROC |
6 | tristate "PICVUE LCD display driver /proc interface" | 6 | tristate "PICVUE LCD display driver /proc interface" |
7 | depends on PICVUE | 7 | depends on PICVUE && PROC_FS |
8 | 8 | ||
9 | config DS1603 | 9 | config DS1603 |
10 | bool "DS1603 RTC driver" | 10 | bool "DS1603 RTC driver" |
diff --git a/arch/mips/loongson/lemote-2f/clock.c b/arch/mips/loongson/lemote-2f/clock.c index a217061beee3..462e34d46b4a 100644 --- a/arch/mips/loongson/lemote-2f/clock.c +++ b/arch/mips/loongson/lemote-2f/clock.c | |||
@@ -91,6 +91,7 @@ EXPORT_SYMBOL(clk_put); | |||
91 | 91 | ||
92 | int clk_set_rate(struct clk *clk, unsigned long rate) | 92 | int clk_set_rate(struct clk *clk, unsigned long rate) |
93 | { | 93 | { |
94 | unsigned int rate_khz = rate / 1000; | ||
94 | struct cpufreq_frequency_table *pos; | 95 | struct cpufreq_frequency_table *pos; |
95 | int ret = 0; | 96 | int ret = 0; |
96 | int regval; | 97 | int regval; |
@@ -107,9 +108,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
107 | propagate_rate(clk); | 108 | propagate_rate(clk); |
108 | 109 | ||
109 | cpufreq_for_each_valid_entry(pos, loongson2_clockmod_table) | 110 | cpufreq_for_each_valid_entry(pos, loongson2_clockmod_table) |
110 | if (rate == pos->frequency) | 111 | if (rate_khz == pos->frequency) |
111 | break; | 112 | break; |
112 | if (rate != pos->frequency) | 113 | if (rate_khz != pos->frequency) |
113 | return -ENOTSUPP; | 114 | return -ENOTSUPP; |
114 | 115 | ||
115 | clk->rate = rate; | 116 | clk->rate = rate; |
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c index 7a4727795a70..51a0fde4bec1 100644 --- a/arch/mips/math-emu/cp1emu.c +++ b/arch/mips/math-emu/cp1emu.c | |||
@@ -1023,7 +1023,7 @@ emul: | |||
1023 | goto emul; | 1023 | goto emul; |
1024 | 1024 | ||
1025 | case cop1x_op: | 1025 | case cop1x_op: |
1026 | if (cpu_has_mips_4_5 || cpu_has_mips64) | 1026 | if (cpu_has_mips_4_5 || cpu_has_mips64 || cpu_has_mips32r2) |
1027 | /* its one of ours */ | 1027 | /* its one of ours */ |
1028 | goto emul; | 1028 | goto emul; |
1029 | 1029 | ||
@@ -1068,7 +1068,7 @@ emul: | |||
1068 | break; | 1068 | break; |
1069 | 1069 | ||
1070 | case cop1x_op: | 1070 | case cop1x_op: |
1071 | if (!cpu_has_mips_4_5 && !cpu_has_mips64) | 1071 | if (!cpu_has_mips_4_5 && !cpu_has_mips64 && !cpu_has_mips32r2) |
1072 | return SIGILL; | 1072 | return SIGILL; |
1073 | 1073 | ||
1074 | sig = fpux_emu(xcp, ctx, ir, fault_addr); | 1074 | sig = fpux_emu(xcp, ctx, ir, fault_addr); |
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index a08dd53a1cc5..b5f228e7eae6 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -1062,6 +1062,7 @@ static void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep) | |||
1062 | struct mips_huge_tlb_info { | 1062 | struct mips_huge_tlb_info { |
1063 | int huge_pte; | 1063 | int huge_pte; |
1064 | int restore_scratch; | 1064 | int restore_scratch; |
1065 | bool need_reload_pte; | ||
1065 | }; | 1066 | }; |
1066 | 1067 | ||
1067 | static struct mips_huge_tlb_info | 1068 | static struct mips_huge_tlb_info |
@@ -1076,6 +1077,7 @@ build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l, | |||
1076 | 1077 | ||
1077 | rv.huge_pte = scratch; | 1078 | rv.huge_pte = scratch; |
1078 | rv.restore_scratch = 0; | 1079 | rv.restore_scratch = 0; |
1080 | rv.need_reload_pte = false; | ||
1079 | 1081 | ||
1080 | if (check_for_high_segbits) { | 1082 | if (check_for_high_segbits) { |
1081 | UASM_i_MFC0(p, tmp, C0_BADVADDR); | 1083 | UASM_i_MFC0(p, tmp, C0_BADVADDR); |
@@ -1264,6 +1266,7 @@ static void build_r4000_tlb_refill_handler(void) | |||
1264 | } else { | 1266 | } else { |
1265 | htlb_info.huge_pte = K0; | 1267 | htlb_info.huge_pte = K0; |
1266 | htlb_info.restore_scratch = 0; | 1268 | htlb_info.restore_scratch = 0; |
1269 | htlb_info.need_reload_pte = true; | ||
1267 | vmalloc_mode = refill_noscratch; | 1270 | vmalloc_mode = refill_noscratch; |
1268 | /* | 1271 | /* |
1269 | * create the plain linear handler | 1272 | * create the plain linear handler |
@@ -1300,7 +1303,8 @@ static void build_r4000_tlb_refill_handler(void) | |||
1300 | } | 1303 | } |
1301 | #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT | 1304 | #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT |
1302 | uasm_l_tlb_huge_update(&l, p); | 1305 | uasm_l_tlb_huge_update(&l, p); |
1303 | UASM_i_LW(&p, K0, 0, K1); | 1306 | if (htlb_info.need_reload_pte) |
1307 | UASM_i_LW(&p, htlb_info.huge_pte, 0, K1); | ||
1304 | build_huge_update_entries(&p, htlb_info.huge_pte, K1); | 1308 | build_huge_update_entries(&p, htlb_info.huge_pte, K1); |
1305 | build_huge_tlb_write_entry(&p, &l, &r, K0, tlb_random, | 1309 | build_huge_tlb_write_entry(&p, &l, &r, K0, tlb_random, |
1306 | htlb_info.restore_scratch); | 1310 | htlb_info.restore_scratch); |
diff --git a/arch/mips/mti-malta/Makefile b/arch/mips/mti-malta/Makefile index b9510ea8db56..6510ace272d4 100644 --- a/arch/mips/mti-malta/Makefile +++ b/arch/mips/mti-malta/Makefile | |||
@@ -5,8 +5,9 @@ | |||
5 | # Copyright (C) 2008 Wind River Systems, Inc. | 5 | # Copyright (C) 2008 Wind River Systems, Inc. |
6 | # written by Ralf Baechle <ralf@linux-mips.org> | 6 | # written by Ralf Baechle <ralf@linux-mips.org> |
7 | # | 7 | # |
8 | obj-y := malta-amon.o malta-display.o malta-init.o \ | 8 | obj-y := malta-display.o malta-init.o \ |
9 | malta-int.o malta-memory.o malta-platform.o \ | 9 | malta-int.o malta-memory.o malta-platform.o \ |
10 | malta-reset.o malta-setup.o malta-time.o | 10 | malta-reset.o malta-setup.o malta-time.o |
11 | 11 | ||
12 | obj-$(CONFIG_MIPS_CMP) += malta-amon.o | ||
12 | obj-$(CONFIG_MIPS_MALTA_PM) += malta-pm.o | 13 | obj-$(CONFIG_MIPS_MALTA_PM) += malta-pm.o |
diff --git a/arch/mips/mti-sead3/Makefile b/arch/mips/mti-sead3/Makefile index febf4334545e..2ae49e99eb67 100644 --- a/arch/mips/mti-sead3/Makefile +++ b/arch/mips/mti-sead3/Makefile | |||
@@ -14,7 +14,6 @@ obj-y := sead3-lcd.o sead3-display.o sead3-init.o \ | |||
14 | sead3-setup.o sead3-time.o | 14 | sead3-setup.o sead3-time.o |
15 | 15 | ||
16 | obj-y += sead3-i2c-dev.o sead3-i2c.o \ | 16 | obj-y += sead3-i2c-dev.o sead3-i2c.o \ |
17 | sead3-pic32-i2c-drv.o sead3-pic32-bus.o \ | ||
18 | leds-sead3.o sead3-leds.o | 17 | leds-sead3.o sead3-leds.o |
19 | 18 | ||
20 | obj-$(CONFIG_EARLY_PRINTK) += sead3-console.o | 19 | obj-$(CONFIG_EARLY_PRINTK) += sead3-console.o |
diff --git a/arch/mips/mti-sead3/sead3-i2c.c b/arch/mips/mti-sead3/sead3-i2c.c index f70d5fc58ef5..795ae83894e0 100644 --- a/arch/mips/mti-sead3/sead3-i2c.c +++ b/arch/mips/mti-sead3/sead3-i2c.c | |||
@@ -5,10 +5,8 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. | 6 | * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. |
7 | */ | 7 | */ |
8 | #include <linux/module.h> | ||
9 | #include <linux/init.h> | 8 | #include <linux/init.h> |
10 | #include <linux/platform_device.h> | 9 | #include <linux/platform_device.h> |
11 | #include <irq.h> | ||
12 | 10 | ||
13 | struct resource sead3_i2c_resources[] = { | 11 | struct resource sead3_i2c_resources[] = { |
14 | { | 12 | { |
@@ -30,8 +28,4 @@ static int __init sead3_i2c_init(void) | |||
30 | return platform_device_register(&sead3_i2c_device); | 28 | return platform_device_register(&sead3_i2c_device); |
31 | } | 29 | } |
32 | 30 | ||
33 | module_init(sead3_i2c_init); | 31 | device_initcall(sead3_i2c_init); |
34 | |||
35 | MODULE_AUTHOR("Chris Dearman <chris@mips.com>"); | ||
36 | MODULE_LICENSE("GPL"); | ||
37 | MODULE_DESCRIPTION("I2C probe driver for SEAD3"); | ||
diff --git a/arch/mips/mti-sead3/sead3-pic32-bus.c b/arch/mips/mti-sead3/sead3-pic32-bus.c deleted file mode 100644 index 3b12aa5a7c88..000000000000 --- a/arch/mips/mti-sead3/sead3-pic32-bus.c +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. | ||
7 | */ | ||
8 | #include <linux/delay.h> | ||
9 | #include <linux/kernel.h> | ||
10 | #include <linux/spinlock.h> | ||
11 | #include <linux/io.h> | ||
12 | #include <linux/errno.h> | ||
13 | |||
14 | #define PIC32_NULL 0x00 | ||
15 | #define PIC32_RD 0x01 | ||
16 | #define PIC32_SYSRD 0x02 | ||
17 | #define PIC32_WR 0x10 | ||
18 | #define PIC32_SYSWR 0x20 | ||
19 | #define PIC32_IRQ_CLR 0x40 | ||
20 | #define PIC32_STATUS 0x80 | ||
21 | |||
22 | #define DELAY() udelay(100) /* FIXME: needed? */ | ||
23 | |||
24 | /* spinlock to ensure atomic access to PIC32 */ | ||
25 | static DEFINE_SPINLOCK(pic32_bus_lock); | ||
26 | |||
27 | /* FIXME: io_remap these */ | ||
28 | static void __iomem *bus_xfer = (void __iomem *)0xbf000600; | ||
29 | static void __iomem *bus_status = (void __iomem *)0xbf000060; | ||
30 | |||
31 | static inline unsigned int ioready(void) | ||
32 | { | ||
33 | return readl(bus_status) & 1; | ||
34 | } | ||
35 | |||
36 | static inline void wait_ioready(void) | ||
37 | { | ||
38 | do { } while (!ioready()); | ||
39 | } | ||
40 | |||
41 | static inline void wait_ioclear(void) | ||
42 | { | ||
43 | do { } while (ioready()); | ||
44 | } | ||
45 | |||
46 | static inline void check_ioclear(void) | ||
47 | { | ||
48 | if (ioready()) { | ||
49 | pr_debug("ioclear: initially busy\n"); | ||
50 | do { | ||
51 | (void) readl(bus_xfer); | ||
52 | DELAY(); | ||
53 | } while (ioready()); | ||
54 | pr_debug("ioclear: cleared busy\n"); | ||
55 | } | ||
56 | } | ||
57 | |||
58 | u32 pic32_bus_readl(u32 reg) | ||
59 | { | ||
60 | unsigned long flags; | ||
61 | u32 status, val; | ||
62 | |||
63 | spin_lock_irqsave(&pic32_bus_lock, flags); | ||
64 | |||
65 | check_ioclear(); | ||
66 | |||
67 | writel((PIC32_RD << 24) | (reg & 0x00ffffff), bus_xfer); | ||
68 | DELAY(); | ||
69 | wait_ioready(); | ||
70 | status = readl(bus_xfer); | ||
71 | DELAY(); | ||
72 | val = readl(bus_xfer); | ||
73 | wait_ioclear(); | ||
74 | |||
75 | pr_debug("pic32_bus_readl: *%x -> %x (status=%x)\n", reg, val, status); | ||
76 | |||
77 | spin_unlock_irqrestore(&pic32_bus_lock, flags); | ||
78 | |||
79 | return val; | ||
80 | } | ||
81 | |||
82 | void pic32_bus_writel(u32 val, u32 reg) | ||
83 | { | ||
84 | unsigned long flags; | ||
85 | u32 status; | ||
86 | |||
87 | spin_lock_irqsave(&pic32_bus_lock, flags); | ||
88 | |||
89 | check_ioclear(); | ||
90 | |||
91 | writel((PIC32_WR << 24) | (reg & 0x00ffffff), bus_xfer); | ||
92 | DELAY(); | ||
93 | writel(val, bus_xfer); | ||
94 | DELAY(); | ||
95 | wait_ioready(); | ||
96 | status = readl(bus_xfer); | ||
97 | wait_ioclear(); | ||
98 | |||
99 | pr_debug("pic32_bus_writel: *%x <- %x (status=%x)\n", reg, val, status); | ||
100 | |||
101 | spin_unlock_irqrestore(&pic32_bus_lock, flags); | ||
102 | } | ||
diff --git a/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c b/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c deleted file mode 100644 index 80fe194cfa53..000000000000 --- a/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c +++ /dev/null | |||
@@ -1,423 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. | ||
7 | */ | ||
8 | #include <linux/delay.h> | ||
9 | #include <linux/kernel.h> | ||
10 | #include <linux/module.h> | ||
11 | #include <linux/spinlock.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/errno.h> | ||
15 | #include <linux/i2c.h> | ||
16 | #include <linux/slab.h> | ||
17 | |||
18 | #define PIC32_I2CxCON 0x0000 | ||
19 | #define PIC32_I2CxCONCLR 0x0004 | ||
20 | #define PIC32_I2CxCONSET 0x0008 | ||
21 | #define PIC32_I2CxCONINV 0x000C | ||
22 | #define I2CCON_ON (1<<15) | ||
23 | #define I2CCON_FRZ (1<<14) | ||
24 | #define I2CCON_SIDL (1<<13) | ||
25 | #define I2CCON_SCLREL (1<<12) | ||
26 | #define I2CCON_STRICT (1<<11) | ||
27 | #define I2CCON_A10M (1<<10) | ||
28 | #define I2CCON_DISSLW (1<<9) | ||
29 | #define I2CCON_SMEN (1<<8) | ||
30 | #define I2CCON_GCEN (1<<7) | ||
31 | #define I2CCON_STREN (1<<6) | ||
32 | #define I2CCON_ACKDT (1<<5) | ||
33 | #define I2CCON_ACKEN (1<<4) | ||
34 | #define I2CCON_RCEN (1<<3) | ||
35 | #define I2CCON_PEN (1<<2) | ||
36 | #define I2CCON_RSEN (1<<1) | ||
37 | #define I2CCON_SEN (1<<0) | ||
38 | |||
39 | #define PIC32_I2CxSTAT 0x0010 | ||
40 | #define PIC32_I2CxSTATCLR 0x0014 | ||
41 | #define PIC32_I2CxSTATSET 0x0018 | ||
42 | #define PIC32_I2CxSTATINV 0x001C | ||
43 | #define I2CSTAT_ACKSTAT (1<<15) | ||
44 | #define I2CSTAT_TRSTAT (1<<14) | ||
45 | #define I2CSTAT_BCL (1<<10) | ||
46 | #define I2CSTAT_GCSTAT (1<<9) | ||
47 | #define I2CSTAT_ADD10 (1<<8) | ||
48 | #define I2CSTAT_IWCOL (1<<7) | ||
49 | #define I2CSTAT_I2COV (1<<6) | ||
50 | #define I2CSTAT_DA (1<<5) | ||
51 | #define I2CSTAT_P (1<<4) | ||
52 | #define I2CSTAT_S (1<<3) | ||
53 | #define I2CSTAT_RW (1<<2) | ||
54 | #define I2CSTAT_RBF (1<<1) | ||
55 | #define I2CSTAT_TBF (1<<0) | ||
56 | |||
57 | #define PIC32_I2CxADD 0x0020 | ||
58 | #define PIC32_I2CxADDCLR 0x0024 | ||
59 | #define PIC32_I2CxADDSET 0x0028 | ||
60 | #define PIC32_I2CxADDINV 0x002C | ||
61 | #define PIC32_I2CxMSK 0x0030 | ||
62 | #define PIC32_I2CxMSKCLR 0x0034 | ||
63 | #define PIC32_I2CxMSKSET 0x0038 | ||
64 | #define PIC32_I2CxMSKINV 0x003C | ||
65 | #define PIC32_I2CxBRG 0x0040 | ||
66 | #define PIC32_I2CxBRGCLR 0x0044 | ||
67 | #define PIC32_I2CxBRGSET 0x0048 | ||
68 | #define PIC32_I2CxBRGINV 0x004C | ||
69 | #define PIC32_I2CxTRN 0x0050 | ||
70 | #define PIC32_I2CxTRNCLR 0x0054 | ||
71 | #define PIC32_I2CxTRNSET 0x0058 | ||
72 | #define PIC32_I2CxTRNINV 0x005C | ||
73 | #define PIC32_I2CxRCV 0x0060 | ||
74 | |||
75 | struct i2c_platform_data { | ||
76 | u32 base; | ||
77 | struct i2c_adapter adap; | ||
78 | u32 xfer_timeout; | ||
79 | u32 ack_timeout; | ||
80 | u32 ctl_timeout; | ||
81 | }; | ||
82 | |||
83 | extern u32 pic32_bus_readl(u32 reg); | ||
84 | extern void pic32_bus_writel(u32 val, u32 reg); | ||
85 | |||
86 | static inline void | ||
87 | StartI2C(struct i2c_platform_data *adap) | ||
88 | { | ||
89 | pr_debug("StartI2C\n"); | ||
90 | pic32_bus_writel(I2CCON_SEN, adap->base + PIC32_I2CxCONSET); | ||
91 | } | ||
92 | |||
93 | static inline void | ||
94 | StopI2C(struct i2c_platform_data *adap) | ||
95 | { | ||
96 | pr_debug("StopI2C\n"); | ||
97 | pic32_bus_writel(I2CCON_PEN, adap->base + PIC32_I2CxCONSET); | ||
98 | } | ||
99 | |||
100 | static inline void | ||
101 | AckI2C(struct i2c_platform_data *adap) | ||
102 | { | ||
103 | pr_debug("AckI2C\n"); | ||
104 | pic32_bus_writel(I2CCON_ACKDT, adap->base + PIC32_I2CxCONCLR); | ||
105 | pic32_bus_writel(I2CCON_ACKEN, adap->base + PIC32_I2CxCONSET); | ||
106 | } | ||
107 | |||
108 | static inline void | ||
109 | NotAckI2C(struct i2c_platform_data *adap) | ||
110 | { | ||
111 | pr_debug("NakI2C\n"); | ||
112 | pic32_bus_writel(I2CCON_ACKDT, adap->base + PIC32_I2CxCONSET); | ||
113 | pic32_bus_writel(I2CCON_ACKEN, adap->base + PIC32_I2CxCONSET); | ||
114 | } | ||
115 | |||
116 | static inline int | ||
117 | IdleI2C(struct i2c_platform_data *adap) | ||
118 | { | ||
119 | int i; | ||
120 | |||
121 | pr_debug("IdleI2C\n"); | ||
122 | for (i = 0; i < adap->ctl_timeout; i++) { | ||
123 | if (((pic32_bus_readl(adap->base + PIC32_I2CxCON) & | ||
124 | (I2CCON_ACKEN | I2CCON_RCEN | I2CCON_PEN | I2CCON_RSEN | | ||
125 | I2CCON_SEN)) == 0) && | ||
126 | ((pic32_bus_readl(adap->base + PIC32_I2CxSTAT) & | ||
127 | (I2CSTAT_TRSTAT)) == 0)) | ||
128 | return 0; | ||
129 | udelay(1); | ||
130 | } | ||
131 | return -ETIMEDOUT; | ||
132 | } | ||
133 | |||
134 | static inline u32 | ||
135 | MasterWriteI2C(struct i2c_platform_data *adap, u32 byte) | ||
136 | { | ||
137 | pr_debug("MasterWriteI2C\n"); | ||
138 | |||
139 | pic32_bus_writel(byte, adap->base + PIC32_I2CxTRN); | ||
140 | |||
141 | return pic32_bus_readl(adap->base + PIC32_I2CxSTAT) & I2CSTAT_IWCOL; | ||
142 | } | ||
143 | |||
144 | static inline u32 | ||
145 | MasterReadI2C(struct i2c_platform_data *adap) | ||
146 | { | ||
147 | pr_debug("MasterReadI2C\n"); | ||
148 | |||
149 | pic32_bus_writel(I2CCON_RCEN, adap->base + PIC32_I2CxCONSET); | ||
150 | |||
151 | while (pic32_bus_readl(adap->base + PIC32_I2CxCON) & I2CCON_RCEN) | ||
152 | ; | ||
153 | |||
154 | pic32_bus_writel(I2CSTAT_I2COV, adap->base + PIC32_I2CxSTATCLR); | ||
155 | |||
156 | return pic32_bus_readl(adap->base + PIC32_I2CxRCV); | ||
157 | } | ||
158 | |||
159 | static int | ||
160 | do_address(struct i2c_platform_data *adap, unsigned int addr, int rd) | ||
161 | { | ||
162 | pr_debug("doaddress\n"); | ||
163 | |||
164 | IdleI2C(adap); | ||
165 | StartI2C(adap); | ||
166 | IdleI2C(adap); | ||
167 | |||
168 | addr <<= 1; | ||
169 | if (rd) | ||
170 | addr |= 1; | ||
171 | |||
172 | if (MasterWriteI2C(adap, addr)) | ||
173 | return -EIO; | ||
174 | IdleI2C(adap); | ||
175 | if (pic32_bus_readl(adap->base + PIC32_I2CxSTAT) & I2CSTAT_ACKSTAT) | ||
176 | return -EIO; | ||
177 | return 0; | ||
178 | } | ||
179 | |||
180 | static int | ||
181 | i2c_read(struct i2c_platform_data *adap, unsigned char *buf, | ||
182 | unsigned int len) | ||
183 | { | ||
184 | int i; | ||
185 | u32 data; | ||
186 | |||
187 | pr_debug("i2c_read\n"); | ||
188 | |||
189 | i = 0; | ||
190 | while (i < len) { | ||
191 | data = MasterReadI2C(adap); | ||
192 | buf[i++] = data; | ||
193 | if (i < len) | ||
194 | AckI2C(adap); | ||
195 | else | ||
196 | NotAckI2C(adap); | ||
197 | } | ||
198 | |||
199 | StopI2C(adap); | ||
200 | IdleI2C(adap); | ||
201 | return 0; | ||
202 | } | ||
203 | |||
204 | static int | ||
205 | i2c_write(struct i2c_platform_data *adap, unsigned char *buf, | ||
206 | unsigned int len) | ||
207 | { | ||
208 | int i; | ||
209 | u32 data; | ||
210 | |||
211 | pr_debug("i2c_write\n"); | ||
212 | |||
213 | i = 0; | ||
214 | while (i < len) { | ||
215 | data = buf[i]; | ||
216 | if (MasterWriteI2C(adap, data)) | ||
217 | return -EIO; | ||
218 | IdleI2C(adap); | ||
219 | if (pic32_bus_readl(adap->base + PIC32_I2CxSTAT) & | ||
220 | I2CSTAT_ACKSTAT) | ||
221 | return -EIO; | ||
222 | i++; | ||
223 | } | ||
224 | |||
225 | StopI2C(adap); | ||
226 | IdleI2C(adap); | ||
227 | return 0; | ||
228 | } | ||
229 | |||
230 | static int | ||
231 | platform_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) | ||
232 | { | ||
233 | struct i2c_platform_data *adap = i2c_adap->algo_data; | ||
234 | struct i2c_msg *p; | ||
235 | int i, err = 0; | ||
236 | |||
237 | pr_debug("platform_xfer\n"); | ||
238 | for (i = 0; i < num; i++) { | ||
239 | #define __BUFSIZE 80 | ||
240 | int ii; | ||
241 | static char buf[__BUFSIZE]; | ||
242 | char *b = buf; | ||
243 | |||
244 | p = &msgs[i]; | ||
245 | b += sprintf(buf, " [%d bytes]", p->len); | ||
246 | if ((p->flags & I2C_M_RD) == 0) { | ||
247 | for (ii = 0; ii < p->len; ii++) { | ||
248 | if (b < &buf[__BUFSIZE-4]) { | ||
249 | b += sprintf(b, " %02x", p->buf[ii]); | ||
250 | } else { | ||
251 | strcat(b, "..."); | ||
252 | break; | ||
253 | } | ||
254 | } | ||
255 | } | ||
256 | pr_debug("xfer%d: DevAddr: %04x Op:%s Data:%s\n", i, p->addr, | ||
257 | (p->flags & I2C_M_RD) ? "Rd" : "Wr", buf); | ||
258 | } | ||
259 | |||
260 | |||
261 | for (i = 0; !err && i < num; i++) { | ||
262 | p = &msgs[i]; | ||
263 | err = do_address(adap, p->addr, p->flags & I2C_M_RD); | ||
264 | if (err || !p->len) | ||
265 | continue; | ||
266 | if (p->flags & I2C_M_RD) | ||
267 | err = i2c_read(adap, p->buf, p->len); | ||
268 | else | ||
269 | err = i2c_write(adap, p->buf, p->len); | ||
270 | } | ||
271 | |||
272 | /* Return the number of messages processed, or the error code. */ | ||
273 | if (err == 0) | ||
274 | err = num; | ||
275 | |||
276 | return err; | ||
277 | } | ||
278 | |||
279 | static u32 | ||
280 | platform_func(struct i2c_adapter *adap) | ||
281 | { | ||
282 | pr_debug("platform_algo\n"); | ||
283 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; | ||
284 | } | ||
285 | |||
286 | static const struct i2c_algorithm platform_algo = { | ||
287 | .master_xfer = platform_xfer, | ||
288 | .functionality = platform_func, | ||
289 | }; | ||
290 | |||
291 | static void i2c_platform_setup(struct i2c_platform_data *priv) | ||
292 | { | ||
293 | pr_debug("i2c_platform_setup\n"); | ||
294 | |||
295 | pic32_bus_writel(500, priv->base + PIC32_I2CxBRG); | ||
296 | pic32_bus_writel(I2CCON_ON, priv->base + PIC32_I2CxCONCLR); | ||
297 | pic32_bus_writel(I2CCON_ON, priv->base + PIC32_I2CxCONSET); | ||
298 | pic32_bus_writel((I2CSTAT_BCL | I2CSTAT_IWCOL), | ||
299 | (priv->base + PIC32_I2CxSTATCLR)); | ||
300 | } | ||
301 | |||
302 | static void i2c_platform_disable(struct i2c_platform_data *priv) | ||
303 | { | ||
304 | pr_debug("i2c_platform_disable\n"); | ||
305 | } | ||
306 | |||
307 | static int i2c_platform_probe(struct platform_device *pdev) | ||
308 | { | ||
309 | struct i2c_platform_data *priv; | ||
310 | struct resource *r; | ||
311 | int ret; | ||
312 | |||
313 | pr_debug("i2c_platform_probe\n"); | ||
314 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
315 | if (!r) | ||
316 | return -ENODEV; | ||
317 | |||
318 | priv = devm_kzalloc(&pdev->dev, sizeof(struct i2c_platform_data), | ||
319 | GFP_KERNEL); | ||
320 | if (!priv) | ||
321 | return -ENOMEM; | ||
322 | |||
323 | /* FIXME: need to allocate resource in PIC32 space */ | ||
324 | #if 0 | ||
325 | priv->base = bus_request_region(r->start, resource_size(r), | ||
326 | pdev->name); | ||
327 | #else | ||
328 | priv->base = r->start; | ||
329 | #endif | ||
330 | if (!priv->base) | ||
331 | return -EBUSY; | ||
332 | |||
333 | priv->xfer_timeout = 200; | ||
334 | priv->ack_timeout = 200; | ||
335 | priv->ctl_timeout = 200; | ||
336 | |||
337 | priv->adap.nr = pdev->id; | ||
338 | priv->adap.algo = &platform_algo; | ||
339 | priv->adap.algo_data = priv; | ||
340 | priv->adap.dev.parent = &pdev->dev; | ||
341 | strlcpy(priv->adap.name, "PIC32 I2C", sizeof(priv->adap.name)); | ||
342 | |||
343 | i2c_platform_setup(priv); | ||
344 | |||
345 | ret = i2c_add_numbered_adapter(&priv->adap); | ||
346 | if (ret) { | ||
347 | i2c_platform_disable(priv); | ||
348 | return ret; | ||
349 | } | ||
350 | |||
351 | platform_set_drvdata(pdev, priv); | ||
352 | return 0; | ||
353 | } | ||
354 | |||
355 | static int i2c_platform_remove(struct platform_device *pdev) | ||
356 | { | ||
357 | struct i2c_platform_data *priv = platform_get_drvdata(pdev); | ||
358 | |||
359 | pr_debug("i2c_platform_remove\n"); | ||
360 | platform_set_drvdata(pdev, NULL); | ||
361 | i2c_del_adapter(&priv->adap); | ||
362 | i2c_platform_disable(priv); | ||
363 | return 0; | ||
364 | } | ||
365 | |||
366 | #ifdef CONFIG_PM | ||
367 | static int | ||
368 | i2c_platform_suspend(struct platform_device *pdev, pm_message_t state) | ||
369 | { | ||
370 | struct i2c_platform_data *priv = platform_get_drvdata(pdev); | ||
371 | |||
372 | dev_dbg(&pdev->dev, "i2c_platform_disable\n"); | ||
373 | i2c_platform_disable(priv); | ||
374 | |||
375 | return 0; | ||
376 | } | ||
377 | |||
378 | static int | ||
379 | i2c_platform_resume(struct platform_device *pdev) | ||
380 | { | ||
381 | struct i2c_platform_data *priv = platform_get_drvdata(pdev); | ||
382 | |||
383 | dev_dbg(&pdev->dev, "i2c_platform_setup\n"); | ||
384 | i2c_platform_setup(priv); | ||
385 | |||
386 | return 0; | ||
387 | } | ||
388 | #else | ||
389 | #define i2c_platform_suspend NULL | ||
390 | #define i2c_platform_resume NULL | ||
391 | #endif | ||
392 | |||
393 | static struct platform_driver i2c_platform_driver = { | ||
394 | .driver = { | ||
395 | .name = "i2c_pic32", | ||
396 | .owner = THIS_MODULE, | ||
397 | }, | ||
398 | .probe = i2c_platform_probe, | ||
399 | .remove = i2c_platform_remove, | ||
400 | .suspend = i2c_platform_suspend, | ||
401 | .resume = i2c_platform_resume, | ||
402 | }; | ||
403 | |||
404 | static int __init | ||
405 | i2c_platform_init(void) | ||
406 | { | ||
407 | pr_debug("i2c_platform_init\n"); | ||
408 | return platform_driver_register(&i2c_platform_driver); | ||
409 | } | ||
410 | |||
411 | static void __exit | ||
412 | i2c_platform_exit(void) | ||
413 | { | ||
414 | pr_debug("i2c_platform_exit\n"); | ||
415 | platform_driver_unregister(&i2c_platform_driver); | ||
416 | } | ||
417 | |||
418 | MODULE_AUTHOR("Chris Dearman, MIPS Technologies INC."); | ||
419 | MODULE_DESCRIPTION("PIC32 I2C driver"); | ||
420 | MODULE_LICENSE("GPL"); | ||
421 | |||
422 | module_init(i2c_platform_init); | ||
423 | module_exit(i2c_platform_exit); | ||
diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c index 37fe8e7887e2..d3ed15b2b2d1 100644 --- a/arch/mips/pci/pci-lantiq.c +++ b/arch/mips/pci/pci-lantiq.c | |||
@@ -215,17 +215,12 @@ static int ltq_pci_probe(struct platform_device *pdev) | |||
215 | 215 | ||
216 | pci_clear_flags(PCI_PROBE_ONLY); | 216 | pci_clear_flags(PCI_PROBE_ONLY); |
217 | 217 | ||
218 | res_cfg = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
219 | res_bridge = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 218 | res_bridge = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
220 | if (!res_cfg || !res_bridge) { | ||
221 | dev_err(&pdev->dev, "missing memory resources\n"); | ||
222 | return -EINVAL; | ||
223 | } | ||
224 | |||
225 | ltq_pci_membase = devm_ioremap_resource(&pdev->dev, res_bridge); | 219 | ltq_pci_membase = devm_ioremap_resource(&pdev->dev, res_bridge); |
226 | if (IS_ERR(ltq_pci_membase)) | 220 | if (IS_ERR(ltq_pci_membase)) |
227 | return PTR_ERR(ltq_pci_membase); | 221 | return PTR_ERR(ltq_pci_membase); |
228 | 222 | ||
223 | res_cfg = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
229 | ltq_pci_mapped_cfg = devm_ioremap_resource(&pdev->dev, res_cfg); | 224 | ltq_pci_mapped_cfg = devm_ioremap_resource(&pdev->dev, res_cfg); |
230 | if (IS_ERR(ltq_pci_mapped_cfg)) | 225 | if (IS_ERR(ltq_pci_mapped_cfg)) |
231 | return PTR_ERR(ltq_pci_mapped_cfg); | 226 | return PTR_ERR(ltq_pci_mapped_cfg); |
diff --git a/arch/mips/pmcs-msp71xx/msp_irq.c b/arch/mips/pmcs-msp71xx/msp_irq.c index f914c753de21..8d53d7a2ed45 100644 --- a/arch/mips/pmcs-msp71xx/msp_irq.c +++ b/arch/mips/pmcs-msp71xx/msp_irq.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/time.h> | 16 | #include <linux/time.h> |
17 | 17 | ||
18 | #include <asm/irq_cpu.h> | 18 | #include <asm/irq_cpu.h> |
19 | #include <asm/setup.h> | ||
19 | 20 | ||
20 | #include <msp_int.h> | 21 | #include <msp_int.h> |
21 | 22 | ||
diff --git a/arch/mips/pmcs-msp71xx/msp_irq_cic.c b/arch/mips/pmcs-msp71xx/msp_irq_cic.c index b8df2f7b3328..1207ec4dfb77 100644 --- a/arch/mips/pmcs-msp71xx/msp_irq_cic.c +++ b/arch/mips/pmcs-msp71xx/msp_irq_cic.c | |||
@@ -131,11 +131,11 @@ static int msp_cic_irq_set_affinity(struct irq_data *d, | |||
131 | int cpu; | 131 | int cpu; |
132 | unsigned long flags; | 132 | unsigned long flags; |
133 | unsigned int mtflags; | 133 | unsigned int mtflags; |
134 | unsigned long imask = (1 << (irq - MSP_CIC_INTBASE)); | 134 | unsigned long imask = (1 << (d->irq - MSP_CIC_INTBASE)); |
135 | volatile u32 *cic_mask = (volatile u32 *)CIC_VPE0_MSK_REG; | 135 | volatile u32 *cic_mask = (volatile u32 *)CIC_VPE0_MSK_REG; |
136 | 136 | ||
137 | /* timer balancing should be disabled in kernel code */ | 137 | /* timer balancing should be disabled in kernel code */ |
138 | BUG_ON(irq == MSP_INT_VPE0_TIMER || irq == MSP_INT_VPE1_TIMER); | 138 | BUG_ON(d->irq == MSP_INT_VPE0_TIMER || d->irq == MSP_INT_VPE1_TIMER); |
139 | 139 | ||
140 | LOCK_CORE(flags, mtflags); | 140 | LOCK_CORE(flags, mtflags); |
141 | /* enable if any of each VPE's TCs require this IRQ */ | 141 | /* enable if any of each VPE's TCs require this IRQ */ |
diff --git a/arch/mips/sibyte/Makefile b/arch/mips/sibyte/Makefile index c8ed2c807e69..455c40d6d625 100644 --- a/arch/mips/sibyte/Makefile +++ b/arch/mips/sibyte/Makefile | |||
@@ -25,3 +25,4 @@ obj-$(CONFIG_SIBYTE_RHONE) += swarm/ | |||
25 | obj-$(CONFIG_SIBYTE_SENTOSA) += swarm/ | 25 | obj-$(CONFIG_SIBYTE_SENTOSA) += swarm/ |
26 | obj-$(CONFIG_SIBYTE_SWARM) += swarm/ | 26 | obj-$(CONFIG_SIBYTE_SWARM) += swarm/ |
27 | obj-$(CONFIG_SIBYTE_BIGSUR) += swarm/ | 27 | obj-$(CONFIG_SIBYTE_BIGSUR) += swarm/ |
28 | obj-$(CONFIG_SIBYTE_LITTLESUR) += swarm/ | ||
diff --git a/arch/openrisc/include/asm/syscall.h b/arch/openrisc/include/asm/syscall.h index b752bb67891d..2db9f1cf0694 100644 --- a/arch/openrisc/include/asm/syscall.h +++ b/arch/openrisc/include/asm/syscall.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #ifndef __ASM_OPENRISC_SYSCALL_H__ | 19 | #ifndef __ASM_OPENRISC_SYSCALL_H__ |
20 | #define __ASM_OPENRISC_SYSCALL_H__ | 20 | #define __ASM_OPENRISC_SYSCALL_H__ |
21 | 21 | ||
22 | #include <uapi/linux/audit.h> | ||
22 | #include <linux/err.h> | 23 | #include <linux/err.h> |
23 | #include <linux/sched.h> | 24 | #include <linux/sched.h> |
24 | 25 | ||
@@ -71,4 +72,8 @@ syscall_set_arguments(struct task_struct *task, struct pt_regs *regs, | |||
71 | memcpy(®s->gpr[3 + i], args, n * sizeof(args[0])); | 72 | memcpy(®s->gpr[3 + i], args, n * sizeof(args[0])); |
72 | } | 73 | } |
73 | 74 | ||
75 | static inline int syscall_get_arch(void) | ||
76 | { | ||
77 | return AUDIT_ARCH_OPENRISC; | ||
78 | } | ||
74 | #endif | 79 | #endif |
diff --git a/arch/openrisc/include/uapi/asm/elf.h b/arch/openrisc/include/uapi/asm/elf.h index f02ea5830420..88842760e66f 100644 --- a/arch/openrisc/include/uapi/asm/elf.h +++ b/arch/openrisc/include/uapi/asm/elf.h | |||
@@ -55,9 +55,8 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | |||
55 | /* A placeholder; OR32 does not have fp support yes, so no fp regs for now. */ | 55 | /* A placeholder; OR32 does not have fp support yes, so no fp regs for now. */ |
56 | typedef unsigned long elf_fpregset_t; | 56 | typedef unsigned long elf_fpregset_t; |
57 | 57 | ||
58 | /* This should be moved to include/linux/elf.h */ | 58 | /* EM_OPENRISC is defined in linux/elf-em.h */ |
59 | #define EM_OR32 0x8472 | 59 | #define EM_OR32 0x8472 |
60 | #define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ | ||
61 | 60 | ||
62 | /* | 61 | /* |
63 | * These are used to set parameters in the core dumps. | 62 | * These are used to set parameters in the core dumps. |
diff --git a/arch/openrisc/kernel/ptrace.c b/arch/openrisc/kernel/ptrace.c index 71a2a0c34c65..4f59fa4e34e5 100644 --- a/arch/openrisc/kernel/ptrace.c +++ b/arch/openrisc/kernel/ptrace.c | |||
@@ -187,8 +187,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) | |||
187 | */ | 187 | */ |
188 | ret = -1L; | 188 | ret = -1L; |
189 | 189 | ||
190 | audit_syscall_entry(AUDIT_ARCH_OPENRISC, regs->gpr[11], | 190 | audit_syscall_entry(regs->gpr[11], regs->gpr[3], regs->gpr[4], |
191 | regs->gpr[3], regs->gpr[4], | ||
192 | regs->gpr[5], regs->gpr[6]); | 191 | regs->gpr[5], regs->gpr[6]); |
193 | 192 | ||
194 | return ret ? : regs->gpr[11]; | 193 | return ret ? : regs->gpr[11]; |
diff --git a/arch/parisc/include/asm/syscall.h b/arch/parisc/include/asm/syscall.h index 8bdfd2c8c39f..a5eba95d87fe 100644 --- a/arch/parisc/include/asm/syscall.h +++ b/arch/parisc/include/asm/syscall.h | |||
@@ -3,6 +3,8 @@ | |||
3 | #ifndef _ASM_PARISC_SYSCALL_H_ | 3 | #ifndef _ASM_PARISC_SYSCALL_H_ |
4 | #define _ASM_PARISC_SYSCALL_H_ | 4 | #define _ASM_PARISC_SYSCALL_H_ |
5 | 5 | ||
6 | #include <uapi/linux/audit.h> | ||
7 | #include <linux/compat.h> | ||
6 | #include <linux/err.h> | 8 | #include <linux/err.h> |
7 | #include <asm/ptrace.h> | 9 | #include <asm/ptrace.h> |
8 | 10 | ||
@@ -37,4 +39,13 @@ static inline void syscall_get_arguments(struct task_struct *tsk, | |||
37 | } | 39 | } |
38 | } | 40 | } |
39 | 41 | ||
42 | static inline int syscall_get_arch(void) | ||
43 | { | ||
44 | int arch = AUDIT_ARCH_PARISC; | ||
45 | #ifdef CONFIG_64BIT | ||
46 | if (!is_compat_task()) | ||
47 | arch = AUDIT_ARCH_PARISC64; | ||
48 | #endif | ||
49 | return arch; | ||
50 | } | ||
40 | #endif /*_ASM_PARISC_SYSCALL_H_*/ | 51 | #endif /*_ASM_PARISC_SYSCALL_H_*/ |
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c index 92438c21d453..9585c81f755f 100644 --- a/arch/parisc/kernel/ptrace.c +++ b/arch/parisc/kernel/ptrace.c | |||
@@ -280,14 +280,11 @@ long do_syscall_trace_enter(struct pt_regs *regs) | |||
280 | 280 | ||
281 | #ifdef CONFIG_64BIT | 281 | #ifdef CONFIG_64BIT |
282 | if (!is_compat_task()) | 282 | if (!is_compat_task()) |
283 | audit_syscall_entry(AUDIT_ARCH_PARISC64, | 283 | audit_syscall_entry(regs->gr[20], regs->gr[26], regs->gr[25], |
284 | regs->gr[20], | 284 | regs->gr[24], regs->gr[23]); |
285 | regs->gr[26], regs->gr[25], | ||
286 | regs->gr[24], regs->gr[23]); | ||
287 | else | 285 | else |
288 | #endif | 286 | #endif |
289 | audit_syscall_entry(AUDIT_ARCH_PARISC, | 287 | audit_syscall_entry(regs->gr[20] & 0xffffffff, |
290 | regs->gr[20] & 0xffffffff, | ||
291 | regs->gr[26] & 0xffffffff, | 288 | regs->gr[26] & 0xffffffff, |
292 | regs->gr[25] & 0xffffffff, | 289 | regs->gr[25] & 0xffffffff, |
293 | regs->gr[24] & 0xffffffff, | 290 | regs->gr[24] & 0xffffffff, |
diff --git a/arch/powerpc/configs/pseries_le_defconfig b/arch/powerpc/configs/pseries_le_defconfig index 63392f4b29a4..d2008887eb8c 100644 --- a/arch/powerpc/configs/pseries_le_defconfig +++ b/arch/powerpc/configs/pseries_le_defconfig | |||
@@ -48,7 +48,6 @@ CONFIG_KEXEC=y | |||
48 | CONFIG_IRQ_ALL_CPUS=y | 48 | CONFIG_IRQ_ALL_CPUS=y |
49 | CONFIG_MEMORY_HOTPLUG=y | 49 | CONFIG_MEMORY_HOTPLUG=y |
50 | CONFIG_MEMORY_HOTREMOVE=y | 50 | CONFIG_MEMORY_HOTREMOVE=y |
51 | CONFIG_CMA=y | ||
52 | CONFIG_PPC_64K_PAGES=y | 51 | CONFIG_PPC_64K_PAGES=y |
53 | CONFIG_PPC_SUBPAGE_PROT=y | 52 | CONFIG_PPC_SUBPAGE_PROT=y |
54 | CONFIG_SCHED_SMT=y | 53 | CONFIG_SCHED_SMT=y |
@@ -138,6 +137,7 @@ CONFIG_NETCONSOLE=y | |||
138 | CONFIG_NETPOLL_TRAP=y | 137 | CONFIG_NETPOLL_TRAP=y |
139 | CONFIG_TUN=m | 138 | CONFIG_TUN=m |
140 | CONFIG_VIRTIO_NET=m | 139 | CONFIG_VIRTIO_NET=m |
140 | CONFIG_VHOST_NET=m | ||
141 | CONFIG_VORTEX=y | 141 | CONFIG_VORTEX=y |
142 | CONFIG_ACENIC=m | 142 | CONFIG_ACENIC=m |
143 | CONFIG_ACENIC_OMIT_TIGON_I=y | 143 | CONFIG_ACENIC_OMIT_TIGON_I=y |
@@ -303,4 +303,9 @@ CONFIG_CRYPTO_LZO=m | |||
303 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | 303 | # CONFIG_CRYPTO_ANSI_CPRNG is not set |
304 | CONFIG_CRYPTO_DEV_NX=y | 304 | CONFIG_CRYPTO_DEV_NX=y |
305 | CONFIG_CRYPTO_DEV_NX_ENCRYPT=m | 305 | CONFIG_CRYPTO_DEV_NX_ENCRYPT=m |
306 | CONFIG_VIRTUALIZATION=y | ||
307 | CONFIG_KVM_BOOK3S_64=m | ||
308 | CONFIG_KVM_BOOK3S_64_HV=y | ||
309 | CONFIG_TRANSPARENT_HUGEPAGE=y | ||
310 | CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y | ||
306 | CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y | 311 | CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y |
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h index 3b260efbfbf9..ca07f9c27335 100644 --- a/arch/powerpc/include/asm/eeh.h +++ b/arch/powerpc/include/asm/eeh.h | |||
@@ -71,9 +71,10 @@ struct device_node; | |||
71 | 71 | ||
72 | #define EEH_PE_ISOLATED (1 << 0) /* Isolated PE */ | 72 | #define EEH_PE_ISOLATED (1 << 0) /* Isolated PE */ |
73 | #define EEH_PE_RECOVERING (1 << 1) /* Recovering PE */ | 73 | #define EEH_PE_RECOVERING (1 << 1) /* Recovering PE */ |
74 | #define EEH_PE_RESET (1 << 2) /* PE reset in progress */ | 74 | #define EEH_PE_CFG_BLOCKED (1 << 2) /* Block config access */ |
75 | 75 | ||
76 | #define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */ | 76 | #define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */ |
77 | #define EEH_PE_CFG_RESTRICTED (1 << 9) /* Block config on error */ | ||
77 | 78 | ||
78 | struct eeh_pe { | 79 | struct eeh_pe { |
79 | int type; /* PE type: PHB/Bus/Device */ | 80 | int type; /* PE type: PHB/Bus/Device */ |
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index 623f2971ce0e..766b77d527ac 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h | |||
@@ -71,7 +71,7 @@ pte_t *huge_pte_offset_and_shift(struct mm_struct *mm, | |||
71 | 71 | ||
72 | void flush_dcache_icache_hugepage(struct page *page); | 72 | void flush_dcache_icache_hugepage(struct page *page); |
73 | 73 | ||
74 | #if defined(CONFIG_PPC_MM_SLICES) || defined(CONFIG_PPC_SUBPAGE_PROT) | 74 | #if defined(CONFIG_PPC_MM_SLICES) |
75 | int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr, | 75 | int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr, |
76 | unsigned long len); | 76 | unsigned long len); |
77 | #else | 77 | #else |
diff --git a/arch/powerpc/include/asm/perf_event.h b/arch/powerpc/include/asm/perf_event.h index 0bb23725b1e7..8bf1b6351716 100644 --- a/arch/powerpc/include/asm/perf_event.h +++ b/arch/powerpc/include/asm/perf_event.h | |||
@@ -34,7 +34,7 @@ | |||
34 | do { \ | 34 | do { \ |
35 | (regs)->result = 0; \ | 35 | (regs)->result = 0; \ |
36 | (regs)->nip = __ip; \ | 36 | (regs)->nip = __ip; \ |
37 | (regs)->gpr[1] = *(unsigned long *)__get_SP(); \ | 37 | (regs)->gpr[1] = current_stack_pointer(); \ |
38 | asm volatile("mfmsr %0" : "=r" ((regs)->msr)); \ | 38 | asm volatile("mfmsr %0" : "=r" ((regs)->msr)); \ |
39 | } while (0) | 39 | } while (0) |
40 | #endif | 40 | #endif |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index fe3f9488f321..c998279bd85b 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -1265,8 +1265,7 @@ static inline unsigned long mfvtb (void) | |||
1265 | 1265 | ||
1266 | #define proc_trap() asm volatile("trap") | 1266 | #define proc_trap() asm volatile("trap") |
1267 | 1267 | ||
1268 | #define __get_SP() ({unsigned long sp; \ | 1268 | extern unsigned long current_stack_pointer(void); |
1269 | asm volatile("mr %0,1": "=r" (sp)); sp;}) | ||
1270 | 1269 | ||
1271 | extern unsigned long scom970_read(unsigned int address); | 1270 | extern unsigned long scom970_read(unsigned int address); |
1272 | extern void scom970_write(unsigned int address, unsigned long value); | 1271 | extern void scom970_write(unsigned int address, unsigned long value); |
diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h index b54b2add07be..6240698fee9a 100644 --- a/arch/powerpc/include/asm/syscall.h +++ b/arch/powerpc/include/asm/syscall.h | |||
@@ -13,11 +13,13 @@ | |||
13 | #ifndef _ASM_SYSCALL_H | 13 | #ifndef _ASM_SYSCALL_H |
14 | #define _ASM_SYSCALL_H 1 | 14 | #define _ASM_SYSCALL_H 1 |
15 | 15 | ||
16 | #include <uapi/linux/audit.h> | ||
16 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
18 | #include <linux/thread_info.h> | ||
17 | 19 | ||
18 | /* ftrace syscalls requires exporting the sys_call_table */ | 20 | /* ftrace syscalls requires exporting the sys_call_table */ |
19 | #ifdef CONFIG_FTRACE_SYSCALLS | 21 | #ifdef CONFIG_FTRACE_SYSCALLS |
20 | extern const unsigned long *sys_call_table; | 22 | extern const unsigned long sys_call_table[]; |
21 | #endif /* CONFIG_FTRACE_SYSCALLS */ | 23 | #endif /* CONFIG_FTRACE_SYSCALLS */ |
22 | 24 | ||
23 | static inline long syscall_get_nr(struct task_struct *task, | 25 | static inline long syscall_get_nr(struct task_struct *task, |
@@ -86,4 +88,8 @@ static inline void syscall_set_arguments(struct task_struct *task, | |||
86 | memcpy(®s->gpr[3 + i], args, n * sizeof(args[0])); | 88 | memcpy(®s->gpr[3 + i], args, n * sizeof(args[0])); |
87 | } | 89 | } |
88 | 90 | ||
91 | static inline int syscall_get_arch(void) | ||
92 | { | ||
93 | return is_32bit_task() ? AUDIT_ARCH_PPC : AUDIT_ARCH_PPC64; | ||
94 | } | ||
89 | #endif /* _ASM_SYSCALL_H */ | 95 | #endif /* _ASM_SYSCALL_H */ |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index 7d8a60068805..ce9577d693be 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -365,3 +365,4 @@ SYSCALL_SPU(renameat2) | |||
365 | SYSCALL_SPU(seccomp) | 365 | SYSCALL_SPU(seccomp) |
366 | SYSCALL_SPU(getrandom) | 366 | SYSCALL_SPU(getrandom) |
367 | SYSCALL_SPU(memfd_create) | 367 | SYSCALL_SPU(memfd_create) |
368 | SYSCALL_SPU(bpf) | ||
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index 4e9af3fd43e7..e0da021caa00 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <uapi/asm/unistd.h> | 12 | #include <uapi/asm/unistd.h> |
13 | 13 | ||
14 | 14 | ||
15 | #define __NR_syscalls 361 | 15 | #define __NR_syscalls 362 |
16 | 16 | ||
17 | #define __NR__exit __NR_exit | 17 | #define __NR__exit __NR_exit |
18 | #define NR_syscalls __NR_syscalls | 18 | #define NR_syscalls __NR_syscalls |
diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h index 0688fc06e183..f55351f2e66e 100644 --- a/arch/powerpc/include/uapi/asm/unistd.h +++ b/arch/powerpc/include/uapi/asm/unistd.h | |||
@@ -383,5 +383,6 @@ | |||
383 | #define __NR_seccomp 358 | 383 | #define __NR_seccomp 358 |
384 | #define __NR_getrandom 359 | 384 | #define __NR_getrandom 359 |
385 | #define __NR_memfd_create 360 | 385 | #define __NR_memfd_create 360 |
386 | #define __NR_bpf 361 | ||
386 | 387 | ||
387 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ | 388 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index adac9dc54aee..484b2d4462c1 100644 --- a/arch/powerpc/kernel/dma.c +++ b/arch/powerpc/kernel/dma.c | |||
@@ -53,9 +53,16 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size, | |||
53 | #else | 53 | #else |
54 | struct page *page; | 54 | struct page *page; |
55 | int node = dev_to_node(dev); | 55 | int node = dev_to_node(dev); |
56 | #ifdef CONFIG_FSL_SOC | ||
56 | u64 pfn = get_pfn_limit(dev); | 57 | u64 pfn = get_pfn_limit(dev); |
57 | int zone; | 58 | int zone; |
58 | 59 | ||
60 | /* | ||
61 | * This code should be OK on other platforms, but we have drivers that | ||
62 | * don't set coherent_dma_mask. As a workaround we just ifdef it. This | ||
63 | * whole routine needs some serious cleanup. | ||
64 | */ | ||
65 | |||
59 | zone = dma_pfn_limit_to_zone(pfn); | 66 | zone = dma_pfn_limit_to_zone(pfn); |
60 | if (zone < 0) { | 67 | if (zone < 0) { |
61 | dev_err(dev, "%s: No suitable zone for pfn %#llx\n", | 68 | dev_err(dev, "%s: No suitable zone for pfn %#llx\n", |
@@ -73,6 +80,7 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size, | |||
73 | break; | 80 | break; |
74 | #endif | 81 | #endif |
75 | }; | 82 | }; |
83 | #endif /* CONFIG_FSL_SOC */ | ||
76 | 84 | ||
77 | /* ignore region specifiers */ | 85 | /* ignore region specifiers */ |
78 | flag &= ~(__GFP_HIGHMEM); | 86 | flag &= ~(__GFP_HIGHMEM); |
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index d543e4179c18..2248a1999c64 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c | |||
@@ -257,6 +257,13 @@ static void *eeh_dump_pe_log(void *data, void *flag) | |||
257 | struct eeh_dev *edev, *tmp; | 257 | struct eeh_dev *edev, *tmp; |
258 | size_t *plen = flag; | 258 | size_t *plen = flag; |
259 | 259 | ||
260 | /* If the PE's config space is blocked, 0xFF's will be | ||
261 | * returned. It's pointless to collect the log in this | ||
262 | * case. | ||
263 | */ | ||
264 | if (pe->state & EEH_PE_CFG_BLOCKED) | ||
265 | return NULL; | ||
266 | |||
260 | eeh_pe_for_each_dev(pe, edev, tmp) | 267 | eeh_pe_for_each_dev(pe, edev, tmp) |
261 | *plen += eeh_dump_dev_log(edev, pci_regs_buf + *plen, | 268 | *plen += eeh_dump_dev_log(edev, pci_regs_buf + *plen, |
262 | EEH_PCI_REGS_LOG_LEN - *plen); | 269 | EEH_PCI_REGS_LOG_LEN - *plen); |
@@ -673,18 +680,18 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state stat | |||
673 | switch (state) { | 680 | switch (state) { |
674 | case pcie_deassert_reset: | 681 | case pcie_deassert_reset: |
675 | eeh_ops->reset(pe, EEH_RESET_DEACTIVATE); | 682 | eeh_ops->reset(pe, EEH_RESET_DEACTIVATE); |
676 | eeh_pe_state_clear(pe, EEH_PE_RESET); | 683 | eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED); |
677 | break; | 684 | break; |
678 | case pcie_hot_reset: | 685 | case pcie_hot_reset: |
679 | eeh_pe_state_mark(pe, EEH_PE_RESET); | 686 | eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED); |
680 | eeh_ops->reset(pe, EEH_RESET_HOT); | 687 | eeh_ops->reset(pe, EEH_RESET_HOT); |
681 | break; | 688 | break; |
682 | case pcie_warm_reset: | 689 | case pcie_warm_reset: |
683 | eeh_pe_state_mark(pe, EEH_PE_RESET); | 690 | eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED); |
684 | eeh_ops->reset(pe, EEH_RESET_FUNDAMENTAL); | 691 | eeh_ops->reset(pe, EEH_RESET_FUNDAMENTAL); |
685 | break; | 692 | break; |
686 | default: | 693 | default: |
687 | eeh_pe_state_clear(pe, EEH_PE_RESET); | 694 | eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED); |
688 | return -EINVAL; | 695 | return -EINVAL; |
689 | }; | 696 | }; |
690 | 697 | ||
@@ -1523,7 +1530,7 @@ int eeh_pe_reset(struct eeh_pe *pe, int option) | |||
1523 | switch (option) { | 1530 | switch (option) { |
1524 | case EEH_RESET_DEACTIVATE: | 1531 | case EEH_RESET_DEACTIVATE: |
1525 | ret = eeh_ops->reset(pe, option); | 1532 | ret = eeh_ops->reset(pe, option); |
1526 | eeh_pe_state_clear(pe, EEH_PE_RESET); | 1533 | eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED); |
1527 | if (ret) | 1534 | if (ret) |
1528 | break; | 1535 | break; |
1529 | 1536 | ||
@@ -1538,7 +1545,7 @@ int eeh_pe_reset(struct eeh_pe *pe, int option) | |||
1538 | */ | 1545 | */ |
1539 | eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE); | 1546 | eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE); |
1540 | 1547 | ||
1541 | eeh_pe_state_mark(pe, EEH_PE_RESET); | 1548 | eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED); |
1542 | ret = eeh_ops->reset(pe, option); | 1549 | ret = eeh_ops->reset(pe, option); |
1543 | break; | 1550 | break; |
1544 | default: | 1551 | default: |
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c index 3fd514f8e4b2..6535936bdf27 100644 --- a/arch/powerpc/kernel/eeh_driver.c +++ b/arch/powerpc/kernel/eeh_driver.c | |||
@@ -528,13 +528,13 @@ int eeh_pe_reset_and_recover(struct eeh_pe *pe) | |||
528 | eeh_pe_dev_traverse(pe, eeh_report_error, &result); | 528 | eeh_pe_dev_traverse(pe, eeh_report_error, &result); |
529 | 529 | ||
530 | /* Issue reset */ | 530 | /* Issue reset */ |
531 | eeh_pe_state_mark(pe, EEH_PE_RESET); | 531 | eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED); |
532 | ret = eeh_reset_pe(pe); | 532 | ret = eeh_reset_pe(pe); |
533 | if (ret) { | 533 | if (ret) { |
534 | eeh_pe_state_clear(pe, EEH_PE_RECOVERING | EEH_PE_RESET); | 534 | eeh_pe_state_clear(pe, EEH_PE_RECOVERING | EEH_PE_CFG_BLOCKED); |
535 | return ret; | 535 | return ret; |
536 | } | 536 | } |
537 | eeh_pe_state_clear(pe, EEH_PE_RESET); | 537 | eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED); |
538 | 538 | ||
539 | /* Unfreeze the PE */ | 539 | /* Unfreeze the PE */ |
540 | ret = eeh_clear_pe_frozen_state(pe, true); | 540 | ret = eeh_clear_pe_frozen_state(pe, true); |
@@ -601,10 +601,10 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus) | |||
601 | * config accesses. So we prefer to block them. However, controlled | 601 | * config accesses. So we prefer to block them. However, controlled |
602 | * PCI config accesses initiated from EEH itself are allowed. | 602 | * PCI config accesses initiated from EEH itself are allowed. |
603 | */ | 603 | */ |
604 | eeh_pe_state_mark(pe, EEH_PE_RESET); | 604 | eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED); |
605 | rc = eeh_reset_pe(pe); | 605 | rc = eeh_reset_pe(pe); |
606 | if (rc) { | 606 | if (rc) { |
607 | eeh_pe_state_clear(pe, EEH_PE_RESET); | 607 | eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED); |
608 | return rc; | 608 | return rc; |
609 | } | 609 | } |
610 | 610 | ||
@@ -613,7 +613,7 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus) | |||
613 | /* Restore PE */ | 613 | /* Restore PE */ |
614 | eeh_ops->configure_bridge(pe); | 614 | eeh_ops->configure_bridge(pe); |
615 | eeh_pe_restore_bars(pe); | 615 | eeh_pe_restore_bars(pe); |
616 | eeh_pe_state_clear(pe, EEH_PE_RESET); | 616 | eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED); |
617 | 617 | ||
618 | /* Clear frozen state */ | 618 | /* Clear frozen state */ |
619 | rc = eeh_clear_pe_frozen_state(pe, false); | 619 | rc = eeh_clear_pe_frozen_state(pe, false); |
diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c index 53dd0915e690..5a63e2b0f65b 100644 --- a/arch/powerpc/kernel/eeh_pe.c +++ b/arch/powerpc/kernel/eeh_pe.c | |||
@@ -525,7 +525,7 @@ static void *__eeh_pe_state_mark(void *data, void *flag) | |||
525 | pe->state |= state; | 525 | pe->state |= state; |
526 | 526 | ||
527 | /* Offline PCI devices if applicable */ | 527 | /* Offline PCI devices if applicable */ |
528 | if (state != EEH_PE_ISOLATED) | 528 | if (!(state & EEH_PE_ISOLATED)) |
529 | return NULL; | 529 | return NULL; |
530 | 530 | ||
531 | eeh_pe_for_each_dev(pe, edev, tmp) { | 531 | eeh_pe_for_each_dev(pe, edev, tmp) { |
@@ -534,6 +534,10 @@ static void *__eeh_pe_state_mark(void *data, void *flag) | |||
534 | pdev->error_state = pci_channel_io_frozen; | 534 | pdev->error_state = pci_channel_io_frozen; |
535 | } | 535 | } |
536 | 536 | ||
537 | /* Block PCI config access if required */ | ||
538 | if (pe->state & EEH_PE_CFG_RESTRICTED) | ||
539 | pe->state |= EEH_PE_CFG_BLOCKED; | ||
540 | |||
537 | return NULL; | 541 | return NULL; |
538 | } | 542 | } |
539 | 543 | ||
@@ -611,6 +615,10 @@ static void *__eeh_pe_state_clear(void *data, void *flag) | |||
611 | pdev->error_state = pci_channel_io_normal; | 615 | pdev->error_state = pci_channel_io_normal; |
612 | } | 616 | } |
613 | 617 | ||
618 | /* Unblock PCI config access if required */ | ||
619 | if (pe->state & EEH_PE_CFG_RESTRICTED) | ||
620 | pe->state &= ~EEH_PE_CFG_BLOCKED; | ||
621 | |||
614 | return NULL; | 622 | return NULL; |
615 | } | 623 | } |
616 | 624 | ||
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 050f79a4a168..72e783ea0681 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
@@ -1270,11 +1270,6 @@ hmi_exception_early: | |||
1270 | addi r3,r1,STACK_FRAME_OVERHEAD | 1270 | addi r3,r1,STACK_FRAME_OVERHEAD |
1271 | bl hmi_exception_realmode | 1271 | bl hmi_exception_realmode |
1272 | /* Windup the stack. */ | 1272 | /* Windup the stack. */ |
1273 | /* Clear MSR_RI before setting SRR0 and SRR1. */ | ||
1274 | li r0,MSR_RI | ||
1275 | mfmsr r9 /* get MSR value */ | ||
1276 | andc r9,r9,r0 | ||
1277 | mtmsrd r9,1 /* Clear MSR_RI */ | ||
1278 | /* Move original HSRR0 and HSRR1 into the respective regs */ | 1273 | /* Move original HSRR0 and HSRR1 into the respective regs */ |
1279 | ld r9,_MSR(r1) | 1274 | ld r9,_MSR(r1) |
1280 | mtspr SPRN_HSRR1,r9 | 1275 | mtspr SPRN_HSRR1,r9 |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 8eb857f216c1..c14383575fe8 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -466,7 +466,7 @@ static inline void check_stack_overflow(void) | |||
466 | #ifdef CONFIG_DEBUG_STACKOVERFLOW | 466 | #ifdef CONFIG_DEBUG_STACKOVERFLOW |
467 | long sp; | 467 | long sp; |
468 | 468 | ||
469 | sp = __get_SP() & (THREAD_SIZE-1); | 469 | sp = current_stack_pointer() & (THREAD_SIZE-1); |
470 | 470 | ||
471 | /* check for stack overflow: is there less than 2KB free? */ | 471 | /* check for stack overflow: is there less than 2KB free? */ |
472 | if (unlikely(sp < (sizeof(struct thread_info) + 2048))) { | 472 | if (unlikely(sp < (sizeof(struct thread_info) + 2048))) { |
diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S index 7ce26d45777e..0d432194c018 100644 --- a/arch/powerpc/kernel/misc.S +++ b/arch/powerpc/kernel/misc.S | |||
@@ -114,3 +114,7 @@ _GLOBAL(longjmp) | |||
114 | mtlr r0 | 114 | mtlr r0 |
115 | mr r3,r4 | 115 | mr r3,r4 |
116 | blr | 116 | blr |
117 | |||
118 | _GLOBAL(current_stack_pointer) | ||
119 | PPC_LL r3,0(r1) | ||
120 | blr | ||
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index c4dfff6c2719..202963ee013a 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c | |||
@@ -41,3 +41,5 @@ EXPORT_SYMBOL(giveup_spe); | |||
41 | #ifdef CONFIG_EPAPR_PARAVIRT | 41 | #ifdef CONFIG_EPAPR_PARAVIRT |
42 | EXPORT_SYMBOL(epapr_hypercall_start); | 42 | EXPORT_SYMBOL(epapr_hypercall_start); |
43 | #endif | 43 | #endif |
44 | |||
45 | EXPORT_SYMBOL(current_stack_pointer); | ||
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index aa1df89c8b2a..923cd2daba89 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -1545,7 +1545,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack) | |||
1545 | tsk = current; | 1545 | tsk = current; |
1546 | if (sp == 0) { | 1546 | if (sp == 0) { |
1547 | if (tsk == current) | 1547 | if (tsk == current) |
1548 | asm("mr %0,1" : "=r" (sp)); | 1548 | sp = current_stack_pointer(); |
1549 | else | 1549 | else |
1550 | sp = tsk->thread.ksp; | 1550 | sp = tsk->thread.ksp; |
1551 | } | 1551 | } |
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index cdb404ea3468..f21897b42057 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c | |||
@@ -1788,14 +1788,11 @@ long do_syscall_trace_enter(struct pt_regs *regs) | |||
1788 | 1788 | ||
1789 | #ifdef CONFIG_PPC64 | 1789 | #ifdef CONFIG_PPC64 |
1790 | if (!is_32bit_task()) | 1790 | if (!is_32bit_task()) |
1791 | audit_syscall_entry(AUDIT_ARCH_PPC64, | 1791 | audit_syscall_entry(regs->gpr[0], regs->gpr[3], regs->gpr[4], |
1792 | regs->gpr[0], | ||
1793 | regs->gpr[3], regs->gpr[4], | ||
1794 | regs->gpr[5], regs->gpr[6]); | 1792 | regs->gpr[5], regs->gpr[6]); |
1795 | else | 1793 | else |
1796 | #endif | 1794 | #endif |
1797 | audit_syscall_entry(AUDIT_ARCH_PPC, | 1795 | audit_syscall_entry(regs->gpr[0], |
1798 | regs->gpr[0], | ||
1799 | regs->gpr[3] & 0xffffffff, | 1796 | regs->gpr[3] & 0xffffffff, |
1800 | regs->gpr[4] & 0xffffffff, | 1797 | regs->gpr[4] & 0xffffffff, |
1801 | regs->gpr[5] & 0xffffffff, | 1798 | regs->gpr[5] & 0xffffffff, |
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c index c168337aef9d..7c55b86206b3 100644 --- a/arch/powerpc/kernel/rtas_pci.c +++ b/arch/powerpc/kernel/rtas_pci.c | |||
@@ -66,6 +66,11 @@ int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val) | |||
66 | return PCIBIOS_DEVICE_NOT_FOUND; | 66 | return PCIBIOS_DEVICE_NOT_FOUND; |
67 | if (!config_access_valid(pdn, where)) | 67 | if (!config_access_valid(pdn, where)) |
68 | return PCIBIOS_BAD_REGISTER_NUMBER; | 68 | return PCIBIOS_BAD_REGISTER_NUMBER; |
69 | #ifdef CONFIG_EEH | ||
70 | if (pdn->edev && pdn->edev->pe && | ||
71 | (pdn->edev->pe->state & EEH_PE_CFG_BLOCKED)) | ||
72 | return PCIBIOS_SET_FAILED; | ||
73 | #endif | ||
69 | 74 | ||
70 | addr = rtas_config_addr(pdn->busno, pdn->devfn, where); | 75 | addr = rtas_config_addr(pdn->busno, pdn->devfn, where); |
71 | buid = pdn->phb->buid; | 76 | buid = pdn->phb->buid; |
@@ -90,9 +95,6 @@ static int rtas_pci_read_config(struct pci_bus *bus, | |||
90 | struct device_node *busdn, *dn; | 95 | struct device_node *busdn, *dn; |
91 | struct pci_dn *pdn; | 96 | struct pci_dn *pdn; |
92 | bool found = false; | 97 | bool found = false; |
93 | #ifdef CONFIG_EEH | ||
94 | struct eeh_dev *edev; | ||
95 | #endif | ||
96 | int ret; | 98 | int ret; |
97 | 99 | ||
98 | /* Search only direct children of the bus */ | 100 | /* Search only direct children of the bus */ |
@@ -109,11 +111,6 @@ static int rtas_pci_read_config(struct pci_bus *bus, | |||
109 | 111 | ||
110 | if (!found) | 112 | if (!found) |
111 | return PCIBIOS_DEVICE_NOT_FOUND; | 113 | return PCIBIOS_DEVICE_NOT_FOUND; |
112 | #ifdef CONFIG_EEH | ||
113 | edev = of_node_to_eeh_dev(dn); | ||
114 | if (edev && edev->pe && edev->pe->state & EEH_PE_RESET) | ||
115 | return PCIBIOS_DEVICE_NOT_FOUND; | ||
116 | #endif | ||
117 | 114 | ||
118 | ret = rtas_read_config(pdn, where, size, val); | 115 | ret = rtas_read_config(pdn, where, size, val); |
119 | if (*val == EEH_IO_ERROR_VALUE(size) && | 116 | if (*val == EEH_IO_ERROR_VALUE(size) && |
@@ -132,6 +129,11 @@ int rtas_write_config(struct pci_dn *pdn, int where, int size, u32 val) | |||
132 | return PCIBIOS_DEVICE_NOT_FOUND; | 129 | return PCIBIOS_DEVICE_NOT_FOUND; |
133 | if (!config_access_valid(pdn, where)) | 130 | if (!config_access_valid(pdn, where)) |
134 | return PCIBIOS_BAD_REGISTER_NUMBER; | 131 | return PCIBIOS_BAD_REGISTER_NUMBER; |
132 | #ifdef CONFIG_EEH | ||
133 | if (pdn->edev && pdn->edev->pe && | ||
134 | (pdn->edev->pe->state & EEH_PE_CFG_BLOCKED)) | ||
135 | return PCIBIOS_SET_FAILED; | ||
136 | #endif | ||
135 | 137 | ||
136 | addr = rtas_config_addr(pdn->busno, pdn->devfn, where); | 138 | addr = rtas_config_addr(pdn->busno, pdn->devfn, where); |
137 | buid = pdn->phb->buid; | 139 | buid = pdn->phb->buid; |
@@ -155,10 +157,6 @@ static int rtas_pci_write_config(struct pci_bus *bus, | |||
155 | struct device_node *busdn, *dn; | 157 | struct device_node *busdn, *dn; |
156 | struct pci_dn *pdn; | 158 | struct pci_dn *pdn; |
157 | bool found = false; | 159 | bool found = false; |
158 | #ifdef CONFIG_EEH | ||
159 | struct eeh_dev *edev; | ||
160 | #endif | ||
161 | int ret; | ||
162 | 160 | ||
163 | /* Search only direct children of the bus */ | 161 | /* Search only direct children of the bus */ |
164 | busdn = pci_bus_to_OF_node(bus); | 162 | busdn = pci_bus_to_OF_node(bus); |
@@ -173,14 +171,8 @@ static int rtas_pci_write_config(struct pci_bus *bus, | |||
173 | 171 | ||
174 | if (!found) | 172 | if (!found) |
175 | return PCIBIOS_DEVICE_NOT_FOUND; | 173 | return PCIBIOS_DEVICE_NOT_FOUND; |
176 | #ifdef CONFIG_EEH | ||
177 | edev = of_node_to_eeh_dev(dn); | ||
178 | if (edev && edev->pe && (edev->pe->state & EEH_PE_RESET)) | ||
179 | return PCIBIOS_DEVICE_NOT_FOUND; | ||
180 | #endif | ||
181 | ret = rtas_write_config(pdn, where, size, val); | ||
182 | 174 | ||
183 | return ret; | 175 | return rtas_write_config(pdn, where, size, val); |
184 | } | 176 | } |
185 | 177 | ||
186 | static struct pci_ops rtas_pci_ops = { | 178 | static struct pci_ops rtas_pci_ops = { |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index cd07d79ad21c..4f3cfe1b6a33 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -522,36 +522,36 @@ void __init setup_system(void) | |||
522 | smp_release_cpus(); | 522 | smp_release_cpus(); |
523 | #endif | 523 | #endif |
524 | 524 | ||
525 | printk("Starting Linux PPC64 %s\n", init_utsname()->version); | 525 | pr_info("Starting Linux PPC64 %s\n", init_utsname()->version); |
526 | 526 | ||
527 | printk("-----------------------------------------------------\n"); | 527 | pr_info("-----------------------------------------------------\n"); |
528 | printk("ppc64_pft_size = 0x%llx\n", ppc64_pft_size); | 528 | pr_info("ppc64_pft_size = 0x%llx\n", ppc64_pft_size); |
529 | printk("phys_mem_size = 0x%llx\n", memblock_phys_mem_size()); | 529 | pr_info("phys_mem_size = 0x%llx\n", memblock_phys_mem_size()); |
530 | 530 | ||
531 | if (ppc64_caches.dline_size != 0x80) | 531 | if (ppc64_caches.dline_size != 0x80) |
532 | printk("dcache_line_size = 0x%x\n", ppc64_caches.dline_size); | 532 | pr_info("dcache_line_size = 0x%x\n", ppc64_caches.dline_size); |
533 | if (ppc64_caches.iline_size != 0x80) | 533 | if (ppc64_caches.iline_size != 0x80) |
534 | printk("icache_line_size = 0x%x\n", ppc64_caches.iline_size); | 534 | pr_info("icache_line_size = 0x%x\n", ppc64_caches.iline_size); |
535 | 535 | ||
536 | printk("cpu_features = 0x%016lx\n", cur_cpu_spec->cpu_features); | 536 | pr_info("cpu_features = 0x%016lx\n", cur_cpu_spec->cpu_features); |
537 | printk(" possible = 0x%016lx\n", CPU_FTRS_POSSIBLE); | 537 | pr_info(" possible = 0x%016lx\n", CPU_FTRS_POSSIBLE); |
538 | printk(" always = 0x%016lx\n", CPU_FTRS_ALWAYS); | 538 | pr_info(" always = 0x%016lx\n", CPU_FTRS_ALWAYS); |
539 | printk("cpu_user_features = 0x%08x 0x%08x\n", cur_cpu_spec->cpu_user_features, | 539 | pr_info("cpu_user_features = 0x%08x 0x%08x\n", cur_cpu_spec->cpu_user_features, |
540 | cur_cpu_spec->cpu_user_features2); | 540 | cur_cpu_spec->cpu_user_features2); |
541 | printk("mmu_features = 0x%08x\n", cur_cpu_spec->mmu_features); | 541 | pr_info("mmu_features = 0x%08x\n", cur_cpu_spec->mmu_features); |
542 | printk("firmware_features = 0x%016lx\n", powerpc_firmware_features); | 542 | pr_info("firmware_features = 0x%016lx\n", powerpc_firmware_features); |
543 | 543 | ||
544 | #ifdef CONFIG_PPC_STD_MMU_64 | 544 | #ifdef CONFIG_PPC_STD_MMU_64 |
545 | if (htab_address) | 545 | if (htab_address) |
546 | printk("htab_address = 0x%p\n", htab_address); | 546 | pr_info("htab_address = 0x%p\n", htab_address); |
547 | 547 | ||
548 | printk("htab_hash_mask = 0x%lx\n", htab_hash_mask); | 548 | pr_info("htab_hash_mask = 0x%lx\n", htab_hash_mask); |
549 | #endif | 549 | #endif |
550 | 550 | ||
551 | if (PHYSICAL_START > 0) | 551 | if (PHYSICAL_START > 0) |
552 | printk("physical_start = 0x%llx\n", | 552 | pr_info("physical_start = 0x%llx\n", |
553 | (unsigned long long)PHYSICAL_START); | 553 | (unsigned long long)PHYSICAL_START); |
554 | printk("-----------------------------------------------------\n"); | 554 | pr_info("-----------------------------------------------------\n"); |
555 | 555 | ||
556 | DBG(" <- setup_system()\n"); | 556 | DBG(" <- setup_system()\n"); |
557 | } | 557 | } |
diff --git a/arch/powerpc/kernel/stacktrace.c b/arch/powerpc/kernel/stacktrace.c index 3d30ef1038e5..ea43a347a104 100644 --- a/arch/powerpc/kernel/stacktrace.c +++ b/arch/powerpc/kernel/stacktrace.c | |||
@@ -50,7 +50,7 @@ void save_stack_trace(struct stack_trace *trace) | |||
50 | { | 50 | { |
51 | unsigned long sp; | 51 | unsigned long sp; |
52 | 52 | ||
53 | asm("mr %0,1" : "=r" (sp)); | 53 | sp = current_stack_pointer(); |
54 | 54 | ||
55 | save_context_stack(trace, sp, current, 1); | 55 | save_context_stack(trace, sp, current, 1); |
56 | } | 56 | } |
diff --git a/arch/powerpc/mm/copro_fault.c b/arch/powerpc/mm/copro_fault.c index 0f9939e693df..5a236f082c78 100644 --- a/arch/powerpc/mm/copro_fault.c +++ b/arch/powerpc/mm/copro_fault.c | |||
@@ -99,8 +99,6 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb) | |||
99 | u64 vsid; | 99 | u64 vsid; |
100 | int psize, ssize; | 100 | int psize, ssize; |
101 | 101 | ||
102 | slb->esid = (ea & ESID_MASK) | SLB_ESID_V; | ||
103 | |||
104 | switch (REGION_ID(ea)) { | 102 | switch (REGION_ID(ea)) { |
105 | case USER_REGION_ID: | 103 | case USER_REGION_ID: |
106 | pr_devel("%s: 0x%llx -- USER_REGION_ID\n", __func__, ea); | 104 | pr_devel("%s: 0x%llx -- USER_REGION_ID\n", __func__, ea); |
@@ -133,6 +131,7 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb) | |||
133 | vsid |= mmu_psize_defs[psize].sllp | | 131 | vsid |= mmu_psize_defs[psize].sllp | |
134 | ((ssize == MMU_SEGSIZE_1T) ? SLB_VSID_B_1T : 0); | 132 | ((ssize == MMU_SEGSIZE_1T) ? SLB_VSID_B_1T : 0); |
135 | 133 | ||
134 | slb->esid = (ea & (ssize == MMU_SEGSIZE_1T ? ESID_MASK_1T : ESID_MASK)) | SLB_ESID_V; | ||
136 | slb->vsid = vsid; | 135 | slb->vsid = vsid; |
137 | 136 | ||
138 | return 0; | 137 | return 0; |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 649666d5d1c2..b9d1dfdbe5bb 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -8,6 +8,8 @@ | |||
8 | * as published by the Free Software Foundation; either version | 8 | * as published by the Free Software Foundation; either version |
9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
10 | */ | 10 | */ |
11 | #define pr_fmt(fmt) "numa: " fmt | ||
12 | |||
11 | #include <linux/threads.h> | 13 | #include <linux/threads.h> |
12 | #include <linux/bootmem.h> | 14 | #include <linux/bootmem.h> |
13 | #include <linux/init.h> | 15 | #include <linux/init.h> |
@@ -1153,6 +1155,22 @@ static int __init early_numa(char *p) | |||
1153 | } | 1155 | } |
1154 | early_param("numa", early_numa); | 1156 | early_param("numa", early_numa); |
1155 | 1157 | ||
1158 | static bool topology_updates_enabled = true; | ||
1159 | |||
1160 | static int __init early_topology_updates(char *p) | ||
1161 | { | ||
1162 | if (!p) | ||
1163 | return 0; | ||
1164 | |||
1165 | if (!strcmp(p, "off")) { | ||
1166 | pr_info("Disabling topology updates\n"); | ||
1167 | topology_updates_enabled = false; | ||
1168 | } | ||
1169 | |||
1170 | return 0; | ||
1171 | } | ||
1172 | early_param("topology_updates", early_topology_updates); | ||
1173 | |||
1156 | #ifdef CONFIG_MEMORY_HOTPLUG | 1174 | #ifdef CONFIG_MEMORY_HOTPLUG |
1157 | /* | 1175 | /* |
1158 | * Find the node associated with a hot added memory section for | 1176 | * Find the node associated with a hot added memory section for |
@@ -1442,8 +1460,11 @@ static long hcall_vphn(unsigned long cpu, __be32 *associativity) | |||
1442 | long retbuf[PLPAR_HCALL9_BUFSIZE] = {0}; | 1460 | long retbuf[PLPAR_HCALL9_BUFSIZE] = {0}; |
1443 | u64 flags = 1; | 1461 | u64 flags = 1; |
1444 | int hwcpu = get_hard_smp_processor_id(cpu); | 1462 | int hwcpu = get_hard_smp_processor_id(cpu); |
1463 | int i; | ||
1445 | 1464 | ||
1446 | rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, hwcpu); | 1465 | rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, hwcpu); |
1466 | for (i = 0; i < 6; i++) | ||
1467 | retbuf[i] = cpu_to_be64(retbuf[i]); | ||
1447 | vphn_unpack_associativity(retbuf, associativity); | 1468 | vphn_unpack_associativity(retbuf, associativity); |
1448 | 1469 | ||
1449 | return rc; | 1470 | return rc; |
@@ -1488,11 +1509,14 @@ static int update_cpu_topology(void *data) | |||
1488 | cpu = smp_processor_id(); | 1509 | cpu = smp_processor_id(); |
1489 | 1510 | ||
1490 | for (update = data; update; update = update->next) { | 1511 | for (update = data; update; update = update->next) { |
1512 | int new_nid = update->new_nid; | ||
1491 | if (cpu != update->cpu) | 1513 | if (cpu != update->cpu) |
1492 | continue; | 1514 | continue; |
1493 | 1515 | ||
1494 | unmap_cpu_from_node(update->cpu); | 1516 | unmap_cpu_from_node(cpu); |
1495 | map_cpu_to_node(update->cpu, update->new_nid); | 1517 | map_cpu_to_node(cpu, new_nid); |
1518 | set_cpu_numa_node(cpu, new_nid); | ||
1519 | set_cpu_numa_mem(cpu, local_memory_node(new_nid)); | ||
1496 | vdso_getcpu_init(); | 1520 | vdso_getcpu_init(); |
1497 | } | 1521 | } |
1498 | 1522 | ||
@@ -1539,6 +1563,9 @@ int arch_update_cpu_topology(void) | |||
1539 | struct device *dev; | 1563 | struct device *dev; |
1540 | int weight, new_nid, i = 0; | 1564 | int weight, new_nid, i = 0; |
1541 | 1565 | ||
1566 | if (!prrn_enabled && !vphn_enabled) | ||
1567 | return 0; | ||
1568 | |||
1542 | weight = cpumask_weight(&cpu_associativity_changes_mask); | 1569 | weight = cpumask_weight(&cpu_associativity_changes_mask); |
1543 | if (!weight) | 1570 | if (!weight) |
1544 | return 0; | 1571 | return 0; |
@@ -1592,6 +1619,15 @@ int arch_update_cpu_topology(void) | |||
1592 | cpu = cpu_last_thread_sibling(cpu); | 1619 | cpu = cpu_last_thread_sibling(cpu); |
1593 | } | 1620 | } |
1594 | 1621 | ||
1622 | pr_debug("Topology update for the following CPUs:\n"); | ||
1623 | if (cpumask_weight(&updated_cpus)) { | ||
1624 | for (ud = &updates[0]; ud; ud = ud->next) { | ||
1625 | pr_debug("cpu %d moving from node %d " | ||
1626 | "to %d\n", ud->cpu, | ||
1627 | ud->old_nid, ud->new_nid); | ||
1628 | } | ||
1629 | } | ||
1630 | |||
1595 | /* | 1631 | /* |
1596 | * In cases where we have nothing to update (because the updates list | 1632 | * In cases where we have nothing to update (because the updates list |
1597 | * is too short or because the new topology is same as the old one), | 1633 | * is too short or because the new topology is same as the old one), |
@@ -1800,8 +1836,12 @@ static const struct file_operations topology_ops = { | |||
1800 | 1836 | ||
1801 | static int topology_update_init(void) | 1837 | static int topology_update_init(void) |
1802 | { | 1838 | { |
1803 | start_topology_update(); | 1839 | /* Do not poll for changes if disabled at boot */ |
1804 | proc_create("powerpc/topology_updates", 0644, NULL, &topology_ops); | 1840 | if (topology_updates_enabled) |
1841 | start_topology_update(); | ||
1842 | |||
1843 | if (!proc_create("powerpc/topology_updates", 0644, NULL, &topology_ops)) | ||
1844 | return -ENOMEM; | ||
1805 | 1845 | ||
1806 | return 0; | 1846 | return 0; |
1807 | } | 1847 | } |
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c index 8d7bda94d196..ded0ea1afde4 100644 --- a/arch/powerpc/mm/slice.c +++ b/arch/powerpc/mm/slice.c | |||
@@ -682,6 +682,7 @@ void slice_set_range_psize(struct mm_struct *mm, unsigned long start, | |||
682 | slice_convert(mm, mask, psize); | 682 | slice_convert(mm, mask, psize); |
683 | } | 683 | } |
684 | 684 | ||
685 | #ifdef CONFIG_HUGETLB_PAGE | ||
685 | /* | 686 | /* |
686 | * is_hugepage_only_range() is used by generic code to verify whether | 687 | * is_hugepage_only_range() is used by generic code to verify whether |
687 | * a normal mmap mapping (non hugetlbfs) is valid on a given area. | 688 | * a normal mmap mapping (non hugetlbfs) is valid on a given area. |
@@ -726,4 +727,4 @@ int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr, | |||
726 | #endif | 727 | #endif |
727 | return !slice_check_fit(mask, available); | 728 | return !slice_check_fit(mask, available); |
728 | } | 729 | } |
729 | 730 | #endif | |
diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c index 6c8710dd90c9..dba34088da28 100644 --- a/arch/powerpc/perf/hv-24x7.c +++ b/arch/powerpc/perf/hv-24x7.c | |||
@@ -417,11 +417,6 @@ static int h_24x7_event_add(struct perf_event *event, int flags) | |||
417 | return 0; | 417 | return 0; |
418 | } | 418 | } |
419 | 419 | ||
420 | static int h_24x7_event_idx(struct perf_event *event) | ||
421 | { | ||
422 | return 0; | ||
423 | } | ||
424 | |||
425 | static struct pmu h_24x7_pmu = { | 420 | static struct pmu h_24x7_pmu = { |
426 | .task_ctx_nr = perf_invalid_context, | 421 | .task_ctx_nr = perf_invalid_context, |
427 | 422 | ||
@@ -433,7 +428,6 @@ static struct pmu h_24x7_pmu = { | |||
433 | .start = h_24x7_event_start, | 428 | .start = h_24x7_event_start, |
434 | .stop = h_24x7_event_stop, | 429 | .stop = h_24x7_event_stop, |
435 | .read = h_24x7_event_update, | 430 | .read = h_24x7_event_update, |
436 | .event_idx = h_24x7_event_idx, | ||
437 | }; | 431 | }; |
438 | 432 | ||
439 | static int hv_24x7_init(void) | 433 | static int hv_24x7_init(void) |
diff --git a/arch/powerpc/perf/hv-gpci.c b/arch/powerpc/perf/hv-gpci.c index 15fc76c93022..a051fe946c63 100644 --- a/arch/powerpc/perf/hv-gpci.c +++ b/arch/powerpc/perf/hv-gpci.c | |||
@@ -246,11 +246,6 @@ static int h_gpci_event_init(struct perf_event *event) | |||
246 | return 0; | 246 | return 0; |
247 | } | 247 | } |
248 | 248 | ||
249 | static int h_gpci_event_idx(struct perf_event *event) | ||
250 | { | ||
251 | return 0; | ||
252 | } | ||
253 | |||
254 | static struct pmu h_gpci_pmu = { | 249 | static struct pmu h_gpci_pmu = { |
255 | .task_ctx_nr = perf_invalid_context, | 250 | .task_ctx_nr = perf_invalid_context, |
256 | 251 | ||
@@ -262,7 +257,6 @@ static struct pmu h_gpci_pmu = { | |||
262 | .start = h_gpci_event_start, | 257 | .start = h_gpci_event_start, |
263 | .stop = h_gpci_event_stop, | 258 | .stop = h_gpci_event_stop, |
264 | .read = h_gpci_event_update, | 259 | .read = h_gpci_event_update, |
265 | .event_idx = h_gpci_event_idx, | ||
266 | }; | 260 | }; |
267 | 261 | ||
268 | static int hv_gpci_init(void) | 262 | static int hv_gpci_init(void) |
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c index 426814a2ede3..eba9cb10619c 100644 --- a/arch/powerpc/platforms/powernv/eeh-ioda.c +++ b/arch/powerpc/platforms/powernv/eeh-ioda.c | |||
@@ -373,7 +373,7 @@ static int ioda_eeh_get_pe_state(struct eeh_pe *pe) | |||
373 | * moving forward, we have to return operational | 373 | * moving forward, we have to return operational |
374 | * state during PE reset. | 374 | * state during PE reset. |
375 | */ | 375 | */ |
376 | if (pe->state & EEH_PE_RESET) { | 376 | if (pe->state & EEH_PE_CFG_BLOCKED) { |
377 | result = (EEH_STATE_MMIO_ACTIVE | | 377 | result = (EEH_STATE_MMIO_ACTIVE | |
378 | EEH_STATE_DMA_ACTIVE | | 378 | EEH_STATE_DMA_ACTIVE | |
379 | EEH_STATE_MMIO_ENABLED | | 379 | EEH_STATE_MMIO_ENABLED | |
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index 3e89cbf55885..1d19e7917d7f 100644 --- a/arch/powerpc/platforms/powernv/eeh-powernv.c +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c | |||
@@ -169,6 +169,26 @@ static int powernv_eeh_dev_probe(struct pci_dev *dev, void *flag) | |||
169 | } | 169 | } |
170 | 170 | ||
171 | /* | 171 | /* |
172 | * If the PE contains any one of following adapters, the | ||
173 | * PCI config space can't be accessed when dumping EEH log. | ||
174 | * Otherwise, we will run into fenced PHB caused by shortage | ||
175 | * of outbound credits in the adapter. The PCI config access | ||
176 | * should be blocked until PE reset. MMIO access is dropped | ||
177 | * by hardware certainly. In order to drop PCI config requests, | ||
178 | * one more flag (EEH_PE_CFG_RESTRICTED) is introduced, which | ||
179 | * will be checked in the backend for PE state retrival. If | ||
180 | * the PE becomes frozen for the first time and the flag has | ||
181 | * been set for the PE, we will set EEH_PE_CFG_BLOCKED for | ||
182 | * that PE to block its config space. | ||
183 | * | ||
184 | * Broadcom Austin 4-ports NICs (14e4:1657) | ||
185 | * Broadcom Shiner 2-ports 10G NICs (14e4:168e) | ||
186 | */ | ||
187 | if ((dev->vendor == PCI_VENDOR_ID_BROADCOM && dev->device == 0x1657) || | ||
188 | (dev->vendor == PCI_VENDOR_ID_BROADCOM && dev->device == 0x168e)) | ||
189 | edev->pe->state |= EEH_PE_CFG_RESTRICTED; | ||
190 | |||
191 | /* | ||
172 | * Cache the PE primary bus, which can't be fetched when | 192 | * Cache the PE primary bus, which can't be fetched when |
173 | * full hotplug is in progress. In that case, all child | 193 | * full hotplug is in progress. In that case, all child |
174 | * PCI devices of the PE are expected to be removed prior | 194 | * PCI devices of the PE are expected to be removed prior |
@@ -383,6 +403,39 @@ static int powernv_eeh_err_inject(struct eeh_pe *pe, int type, int func, | |||
383 | return ret; | 403 | return ret; |
384 | } | 404 | } |
385 | 405 | ||
406 | static inline bool powernv_eeh_cfg_blocked(struct device_node *dn) | ||
407 | { | ||
408 | struct eeh_dev *edev = of_node_to_eeh_dev(dn); | ||
409 | |||
410 | if (!edev || !edev->pe) | ||
411 | return false; | ||
412 | |||
413 | if (edev->pe->state & EEH_PE_CFG_BLOCKED) | ||
414 | return true; | ||
415 | |||
416 | return false; | ||
417 | } | ||
418 | |||
419 | static int powernv_eeh_read_config(struct device_node *dn, | ||
420 | int where, int size, u32 *val) | ||
421 | { | ||
422 | if (powernv_eeh_cfg_blocked(dn)) { | ||
423 | *val = 0xFFFFFFFF; | ||
424 | return PCIBIOS_SET_FAILED; | ||
425 | } | ||
426 | |||
427 | return pnv_pci_cfg_read(dn, where, size, val); | ||
428 | } | ||
429 | |||
430 | static int powernv_eeh_write_config(struct device_node *dn, | ||
431 | int where, int size, u32 val) | ||
432 | { | ||
433 | if (powernv_eeh_cfg_blocked(dn)) | ||
434 | return PCIBIOS_SET_FAILED; | ||
435 | |||
436 | return pnv_pci_cfg_write(dn, where, size, val); | ||
437 | } | ||
438 | |||
386 | /** | 439 | /** |
387 | * powernv_eeh_next_error - Retrieve next EEH error to handle | 440 | * powernv_eeh_next_error - Retrieve next EEH error to handle |
388 | * @pe: Affected PE | 441 | * @pe: Affected PE |
@@ -440,8 +493,8 @@ static struct eeh_ops powernv_eeh_ops = { | |||
440 | .get_log = powernv_eeh_get_log, | 493 | .get_log = powernv_eeh_get_log, |
441 | .configure_bridge = powernv_eeh_configure_bridge, | 494 | .configure_bridge = powernv_eeh_configure_bridge, |
442 | .err_inject = powernv_eeh_err_inject, | 495 | .err_inject = powernv_eeh_err_inject, |
443 | .read_config = pnv_pci_cfg_read, | 496 | .read_config = powernv_eeh_read_config, |
444 | .write_config = pnv_pci_cfg_write, | 497 | .write_config = powernv_eeh_write_config, |
445 | .next_error = powernv_eeh_next_error, | 498 | .next_error = powernv_eeh_next_error, |
446 | .restore_config = powernv_eeh_restore_config | 499 | .restore_config = powernv_eeh_restore_config |
447 | }; | 500 | }; |
diff --git a/arch/powerpc/platforms/powernv/opal-lpc.c b/arch/powerpc/platforms/powernv/opal-lpc.c index dd2c285ad170..ad4b31df779a 100644 --- a/arch/powerpc/platforms/powernv/opal-lpc.c +++ b/arch/powerpc/platforms/powernv/opal-lpc.c | |||
@@ -191,7 +191,6 @@ static ssize_t lpc_debug_read(struct file *filp, char __user *ubuf, | |||
191 | { | 191 | { |
192 | struct lpc_debugfs_entry *lpc = filp->private_data; | 192 | struct lpc_debugfs_entry *lpc = filp->private_data; |
193 | u32 data, pos, len, todo; | 193 | u32 data, pos, len, todo; |
194 | __be32 bedata; | ||
195 | int rc; | 194 | int rc; |
196 | 195 | ||
197 | if (!access_ok(VERIFY_WRITE, ubuf, count)) | 196 | if (!access_ok(VERIFY_WRITE, ubuf, count)) |
@@ -214,10 +213,9 @@ static ssize_t lpc_debug_read(struct file *filp, char __user *ubuf, | |||
214 | len = 2; | 213 | len = 2; |
215 | } | 214 | } |
216 | rc = opal_lpc_read(opal_lpc_chip_id, lpc->lpc_type, pos, | 215 | rc = opal_lpc_read(opal_lpc_chip_id, lpc->lpc_type, pos, |
217 | &bedata, len); | 216 | &data, len); |
218 | if (rc) | 217 | if (rc) |
219 | return -ENXIO; | 218 | return -ENXIO; |
220 | data = be32_to_cpu(bedata); | ||
221 | switch(len) { | 219 | switch(len) { |
222 | case 4: | 220 | case 4: |
223 | rc = __put_user((u32)data, (u32 __user *)ubuf); | 221 | rc = __put_user((u32)data, (u32 __user *)ubuf); |
diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S index e9e2450c1fdd..feb549aa3eea 100644 --- a/arch/powerpc/platforms/powernv/opal-wrappers.S +++ b/arch/powerpc/platforms/powernv/opal-wrappers.S | |||
@@ -58,7 +58,7 @@ END_FTR_SECTION(0, 1); \ | |||
58 | */ | 58 | */ |
59 | 59 | ||
60 | #define OPAL_CALL(name, token) \ | 60 | #define OPAL_CALL(name, token) \ |
61 | _GLOBAL(name); \ | 61 | _GLOBAL_TOC(name); \ |
62 | mflr r0; \ | 62 | mflr r0; \ |
63 | std r0,16(r1); \ | 63 | std r0,16(r1); \ |
64 | li r0,token; \ | 64 | li r0,token; \ |
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index b642b0562f5a..d019b081df9d 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c | |||
@@ -194,6 +194,27 @@ static int __init opal_register_exception_handlers(void) | |||
194 | * fwnmi area at 0x7000 to provide the glue space to OPAL | 194 | * fwnmi area at 0x7000 to provide the glue space to OPAL |
195 | */ | 195 | */ |
196 | glue = 0x7000; | 196 | glue = 0x7000; |
197 | |||
198 | /* | ||
199 | * Check if we are running on newer firmware that exports | ||
200 | * OPAL_HANDLE_HMI token. If yes, then don't ask OPAL to patch | ||
201 | * the HMI interrupt and we catch it directly in Linux. | ||
202 | * | ||
203 | * For older firmware (i.e currently released POWER8 System Firmware | ||
204 | * as of today <= SV810_087), we fallback to old behavior and let OPAL | ||
205 | * patch the HMI vector and handle it inside OPAL firmware. | ||
206 | * | ||
207 | * For newer firmware (in development/yet to be released) we will | ||
208 | * start catching/handling HMI directly in Linux. | ||
209 | */ | ||
210 | if (!opal_check_token(OPAL_HANDLE_HMI)) { | ||
211 | pr_info("opal: Old firmware detected, OPAL handles HMIs.\n"); | ||
212 | opal_register_exception_handler( | ||
213 | OPAL_HYPERVISOR_MAINTENANCE_HANDLER, | ||
214 | 0, glue); | ||
215 | glue += 128; | ||
216 | } | ||
217 | |||
197 | opal_register_exception_handler(OPAL_SOFTPATCH_HANDLER, 0, glue); | 218 | opal_register_exception_handler(OPAL_SOFTPATCH_HANDLER, 0, glue); |
198 | #endif | 219 | #endif |
199 | 220 | ||
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index b3ca77ddf36d..b2187d0068b8 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c | |||
@@ -505,7 +505,7 @@ static bool pnv_pci_cfg_check(struct pci_controller *hose, | |||
505 | edev = of_node_to_eeh_dev(dn); | 505 | edev = of_node_to_eeh_dev(dn); |
506 | if (edev) { | 506 | if (edev) { |
507 | if (edev->pe && | 507 | if (edev->pe && |
508 | (edev->pe->state & EEH_PE_RESET)) | 508 | (edev->pe->state & EEH_PE_CFG_BLOCKED)) |
509 | return false; | 509 | return false; |
510 | 510 | ||
511 | if (edev->mode & EEH_DEV_REMOVED) | 511 | if (edev->mode & EEH_DEV_REMOVED) |
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index fdf01b660d59..6ad83bd11fe2 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c | |||
@@ -25,11 +25,11 @@ | |||
25 | #include <asm/rtas.h> | 25 | #include <asm/rtas.h> |
26 | 26 | ||
27 | struct cc_workarea { | 27 | struct cc_workarea { |
28 | u32 drc_index; | 28 | __be32 drc_index; |
29 | u32 zero; | 29 | __be32 zero; |
30 | u32 name_offset; | 30 | __be32 name_offset; |
31 | u32 prop_length; | 31 | __be32 prop_length; |
32 | u32 prop_offset; | 32 | __be32 prop_offset; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | void dlpar_free_cc_property(struct property *prop) | 35 | void dlpar_free_cc_property(struct property *prop) |
@@ -49,11 +49,11 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa) | |||
49 | if (!prop) | 49 | if (!prop) |
50 | return NULL; | 50 | return NULL; |
51 | 51 | ||
52 | name = (char *)ccwa + ccwa->name_offset; | 52 | name = (char *)ccwa + be32_to_cpu(ccwa->name_offset); |
53 | prop->name = kstrdup(name, GFP_KERNEL); | 53 | prop->name = kstrdup(name, GFP_KERNEL); |
54 | 54 | ||
55 | prop->length = ccwa->prop_length; | 55 | prop->length = be32_to_cpu(ccwa->prop_length); |
56 | value = (char *)ccwa + ccwa->prop_offset; | 56 | value = (char *)ccwa + be32_to_cpu(ccwa->prop_offset); |
57 | prop->value = kmemdup(value, prop->length, GFP_KERNEL); | 57 | prop->value = kmemdup(value, prop->length, GFP_KERNEL); |
58 | if (!prop->value) { | 58 | if (!prop->value) { |
59 | dlpar_free_cc_property(prop); | 59 | dlpar_free_cc_property(prop); |
@@ -79,7 +79,7 @@ static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa, | |||
79 | if (!dn) | 79 | if (!dn) |
80 | return NULL; | 80 | return NULL; |
81 | 81 | ||
82 | name = (char *)ccwa + ccwa->name_offset; | 82 | name = (char *)ccwa + be32_to_cpu(ccwa->name_offset); |
83 | dn->full_name = kasprintf(GFP_KERNEL, "%s/%s", path, name); | 83 | dn->full_name = kasprintf(GFP_KERNEL, "%s/%s", path, name); |
84 | if (!dn->full_name) { | 84 | if (!dn->full_name) { |
85 | kfree(dn); | 85 | kfree(dn); |
@@ -126,7 +126,7 @@ void dlpar_free_cc_nodes(struct device_node *dn) | |||
126 | #define CALL_AGAIN -2 | 126 | #define CALL_AGAIN -2 |
127 | #define ERR_CFG_USE -9003 | 127 | #define ERR_CFG_USE -9003 |
128 | 128 | ||
129 | struct device_node *dlpar_configure_connector(u32 drc_index, | 129 | struct device_node *dlpar_configure_connector(__be32 drc_index, |
130 | struct device_node *parent) | 130 | struct device_node *parent) |
131 | { | 131 | { |
132 | struct device_node *dn; | 132 | struct device_node *dn; |
@@ -414,7 +414,7 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count) | |||
414 | if (!parent) | 414 | if (!parent) |
415 | return -ENODEV; | 415 | return -ENODEV; |
416 | 416 | ||
417 | dn = dlpar_configure_connector(drc_index, parent); | 417 | dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent); |
418 | if (!dn) | 418 | if (!dn) |
419 | return -EINVAL; | 419 | return -EINVAL; |
420 | 420 | ||
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index b174fa751d26..5c375f93c669 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c | |||
@@ -247,7 +247,7 @@ static int pseries_add_processor(struct device_node *np) | |||
247 | unsigned int cpu; | 247 | unsigned int cpu; |
248 | cpumask_var_t candidate_mask, tmp; | 248 | cpumask_var_t candidate_mask, tmp; |
249 | int err = -ENOSPC, len, nthreads, i; | 249 | int err = -ENOSPC, len, nthreads, i; |
250 | const u32 *intserv; | 250 | const __be32 *intserv; |
251 | 251 | ||
252 | intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &len); | 252 | intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &len); |
253 | if (!intserv) | 253 | if (!intserv) |
@@ -293,7 +293,7 @@ static int pseries_add_processor(struct device_node *np) | |||
293 | for_each_cpu(cpu, tmp) { | 293 | for_each_cpu(cpu, tmp) { |
294 | BUG_ON(cpu_present(cpu)); | 294 | BUG_ON(cpu_present(cpu)); |
295 | set_cpu_present(cpu, true); | 295 | set_cpu_present(cpu, true); |
296 | set_hard_smp_processor_id(cpu, *intserv++); | 296 | set_hard_smp_processor_id(cpu, be32_to_cpu(*intserv++)); |
297 | } | 297 | } |
298 | err = 0; | 298 | err = 0; |
299 | out_unlock: | 299 | out_unlock: |
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index de1ec54a2a57..e32e00976a94 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/mm.h> | 30 | #include <linux/mm.h> |
31 | #include <linux/memblock.h> | 31 | #include <linux/memblock.h> |
32 | #include <linux/spinlock.h> | 32 | #include <linux/spinlock.h> |
33 | #include <linux/sched.h> /* for show_stack */ | ||
34 | #include <linux/string.h> | 33 | #include <linux/string.h> |
35 | #include <linux/pci.h> | 34 | #include <linux/pci.h> |
36 | #include <linux/dma-mapping.h> | 35 | #include <linux/dma-mapping.h> |
@@ -168,7 +167,7 @@ static int tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum, | |||
168 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); | 167 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); |
169 | printk("\ttcenum = 0x%llx\n", (u64)tcenum); | 168 | printk("\ttcenum = 0x%llx\n", (u64)tcenum); |
170 | printk("\ttce val = 0x%llx\n", tce ); | 169 | printk("\ttce val = 0x%llx\n", tce ); |
171 | show_stack(current, (unsigned long *)__get_SP()); | 170 | dump_stack(); |
172 | } | 171 | } |
173 | 172 | ||
174 | tcenum++; | 173 | tcenum++; |
@@ -257,7 +256,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, | |||
257 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); | 256 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); |
258 | printk("\tnpages = 0x%llx\n", (u64)npages); | 257 | printk("\tnpages = 0x%llx\n", (u64)npages); |
259 | printk("\ttce[0] val = 0x%llx\n", tcep[0]); | 258 | printk("\ttce[0] val = 0x%llx\n", tcep[0]); |
260 | show_stack(current, (unsigned long *)__get_SP()); | 259 | dump_stack(); |
261 | } | 260 | } |
262 | return ret; | 261 | return ret; |
263 | } | 262 | } |
@@ -273,7 +272,7 @@ static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages | |||
273 | printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc); | 272 | printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc); |
274 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); | 273 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); |
275 | printk("\ttcenum = 0x%llx\n", (u64)tcenum); | 274 | printk("\ttcenum = 0x%llx\n", (u64)tcenum); |
276 | show_stack(current, (unsigned long *)__get_SP()); | 275 | dump_stack(); |
277 | } | 276 | } |
278 | 277 | ||
279 | tcenum++; | 278 | tcenum++; |
@@ -292,7 +291,7 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n | |||
292 | printk("\trc = %lld\n", rc); | 291 | printk("\trc = %lld\n", rc); |
293 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); | 292 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); |
294 | printk("\tnpages = 0x%llx\n", (u64)npages); | 293 | printk("\tnpages = 0x%llx\n", (u64)npages); |
295 | show_stack(current, (unsigned long *)__get_SP()); | 294 | dump_stack(); |
296 | } | 295 | } |
297 | } | 296 | } |
298 | 297 | ||
@@ -307,7 +306,7 @@ static unsigned long tce_get_pSeriesLP(struct iommu_table *tbl, long tcenum) | |||
307 | printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%lld\n", rc); | 306 | printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%lld\n", rc); |
308 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); | 307 | printk("\tindex = 0x%llx\n", (u64)tbl->it_index); |
309 | printk("\ttcenum = 0x%llx\n", (u64)tcenum); | 308 | printk("\ttcenum = 0x%llx\n", (u64)tcenum); |
310 | show_stack(current, (unsigned long *)__get_SP()); | 309 | dump_stack(); |
311 | } | 310 | } |
312 | 311 | ||
313 | return tce_ret; | 312 | return tce_ret; |
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h index 361add62abf1..1796c5438cc6 100644 --- a/arch/powerpc/platforms/pseries/pseries.h +++ b/arch/powerpc/platforms/pseries/pseries.h | |||
@@ -56,7 +56,8 @@ extern void hvc_vio_init_early(void); | |||
56 | /* Dynamic logical Partitioning/Mobility */ | 56 | /* Dynamic logical Partitioning/Mobility */ |
57 | extern void dlpar_free_cc_nodes(struct device_node *); | 57 | extern void dlpar_free_cc_nodes(struct device_node *); |
58 | extern void dlpar_free_cc_property(struct property *); | 58 | extern void dlpar_free_cc_property(struct property *); |
59 | extern struct device_node *dlpar_configure_connector(u32, struct device_node *); | 59 | extern struct device_node *dlpar_configure_connector(__be32, |
60 | struct device_node *); | ||
60 | extern int dlpar_attach_node(struct device_node *); | 61 | extern int dlpar_attach_node(struct device_node *); |
61 | extern int dlpar_detach_node(struct device_node *); | 62 | extern int dlpar_detach_node(struct device_node *); |
62 | 63 | ||
diff --git a/arch/powerpc/sysdev/msi_bitmap.c b/arch/powerpc/sysdev/msi_bitmap.c index 0c75214b6f92..73b64c73505b 100644 --- a/arch/powerpc/sysdev/msi_bitmap.c +++ b/arch/powerpc/sysdev/msi_bitmap.c | |||
@@ -145,59 +145,64 @@ void msi_bitmap_free(struct msi_bitmap *bmp) | |||
145 | 145 | ||
146 | #ifdef CONFIG_MSI_BITMAP_SELFTEST | 146 | #ifdef CONFIG_MSI_BITMAP_SELFTEST |
147 | 147 | ||
148 | #define check(x) \ | ||
149 | if (!(x)) printk("msi_bitmap: test failed at line %d\n", __LINE__); | ||
150 | |||
151 | static void __init test_basics(void) | 148 | static void __init test_basics(void) |
152 | { | 149 | { |
153 | struct msi_bitmap bmp; | 150 | struct msi_bitmap bmp; |
154 | int i, size = 512; | 151 | int rc, i, size = 512; |
155 | 152 | ||
156 | /* Can't allocate a bitmap of 0 irqs */ | 153 | /* Can't allocate a bitmap of 0 irqs */ |
157 | check(msi_bitmap_alloc(&bmp, 0, NULL) != 0); | 154 | WARN_ON(msi_bitmap_alloc(&bmp, 0, NULL) == 0); |
158 | 155 | ||
159 | /* of_node may be NULL */ | 156 | /* of_node may be NULL */ |
160 | check(0 == msi_bitmap_alloc(&bmp, size, NULL)); | 157 | WARN_ON(msi_bitmap_alloc(&bmp, size, NULL)); |
161 | 158 | ||
162 | /* Should all be free by default */ | 159 | /* Should all be free by default */ |
163 | check(0 == bitmap_find_free_region(bmp.bitmap, size, | 160 | WARN_ON(bitmap_find_free_region(bmp.bitmap, size, get_count_order(size))); |
164 | get_count_order(size))); | ||
165 | bitmap_release_region(bmp.bitmap, 0, get_count_order(size)); | 161 | bitmap_release_region(bmp.bitmap, 0, get_count_order(size)); |
166 | 162 | ||
167 | /* With no node, there's no msi-available-ranges, so expect > 0 */ | 163 | /* With no node, there's no msi-available-ranges, so expect > 0 */ |
168 | check(msi_bitmap_reserve_dt_hwirqs(&bmp) > 0); | 164 | WARN_ON(msi_bitmap_reserve_dt_hwirqs(&bmp) <= 0); |
169 | 165 | ||
170 | /* Should all still be free */ | 166 | /* Should all still be free */ |
171 | check(0 == bitmap_find_free_region(bmp.bitmap, size, | 167 | WARN_ON(bitmap_find_free_region(bmp.bitmap, size, get_count_order(size))); |
172 | get_count_order(size))); | ||
173 | bitmap_release_region(bmp.bitmap, 0, get_count_order(size)); | 168 | bitmap_release_region(bmp.bitmap, 0, get_count_order(size)); |
174 | 169 | ||
175 | /* Check we can fill it up and then no more */ | 170 | /* Check we can fill it up and then no more */ |
176 | for (i = 0; i < size; i++) | 171 | for (i = 0; i < size; i++) |
177 | check(msi_bitmap_alloc_hwirqs(&bmp, 1) >= 0); | 172 | WARN_ON(msi_bitmap_alloc_hwirqs(&bmp, 1) < 0); |
178 | 173 | ||
179 | check(msi_bitmap_alloc_hwirqs(&bmp, 1) < 0); | 174 | WARN_ON(msi_bitmap_alloc_hwirqs(&bmp, 1) >= 0); |
180 | 175 | ||
181 | /* Should all be allocated */ | 176 | /* Should all be allocated */ |
182 | check(bitmap_find_free_region(bmp.bitmap, size, 0) < 0); | 177 | WARN_ON(bitmap_find_free_region(bmp.bitmap, size, 0) >= 0); |
183 | 178 | ||
184 | /* And if we free one we can then allocate another */ | 179 | /* And if we free one we can then allocate another */ |
185 | msi_bitmap_free_hwirqs(&bmp, size / 2, 1); | 180 | msi_bitmap_free_hwirqs(&bmp, size / 2, 1); |
186 | check(msi_bitmap_alloc_hwirqs(&bmp, 1) == size / 2); | 181 | WARN_ON(msi_bitmap_alloc_hwirqs(&bmp, 1) != size / 2); |
182 | |||
183 | /* Free most of them for the alignment tests */ | ||
184 | msi_bitmap_free_hwirqs(&bmp, 3, size - 3); | ||
187 | 185 | ||
188 | /* Check we get a naturally aligned offset */ | 186 | /* Check we get a naturally aligned offset */ |
189 | check(msi_bitmap_alloc_hwirqs(&bmp, 2) % 2 == 0); | 187 | rc = msi_bitmap_alloc_hwirqs(&bmp, 2); |
190 | check(msi_bitmap_alloc_hwirqs(&bmp, 4) % 4 == 0); | 188 | WARN_ON(rc < 0 && rc % 2 != 0); |
191 | check(msi_bitmap_alloc_hwirqs(&bmp, 8) % 8 == 0); | 189 | rc = msi_bitmap_alloc_hwirqs(&bmp, 4); |
192 | check(msi_bitmap_alloc_hwirqs(&bmp, 9) % 16 == 0); | 190 | WARN_ON(rc < 0 && rc % 4 != 0); |
193 | check(msi_bitmap_alloc_hwirqs(&bmp, 3) % 4 == 0); | 191 | rc = msi_bitmap_alloc_hwirqs(&bmp, 8); |
194 | check(msi_bitmap_alloc_hwirqs(&bmp, 7) % 8 == 0); | 192 | WARN_ON(rc < 0 && rc % 8 != 0); |
195 | check(msi_bitmap_alloc_hwirqs(&bmp, 121) % 128 == 0); | 193 | rc = msi_bitmap_alloc_hwirqs(&bmp, 9); |
194 | WARN_ON(rc < 0 && rc % 16 != 0); | ||
195 | rc = msi_bitmap_alloc_hwirqs(&bmp, 3); | ||
196 | WARN_ON(rc < 0 && rc % 4 != 0); | ||
197 | rc = msi_bitmap_alloc_hwirqs(&bmp, 7); | ||
198 | WARN_ON(rc < 0 && rc % 8 != 0); | ||
199 | rc = msi_bitmap_alloc_hwirqs(&bmp, 121); | ||
200 | WARN_ON(rc < 0 && rc % 128 != 0); | ||
196 | 201 | ||
197 | msi_bitmap_free(&bmp); | 202 | msi_bitmap_free(&bmp); |
198 | 203 | ||
199 | /* Clients may check bitmap == NULL for "not-allocated" */ | 204 | /* Clients may WARN_ON bitmap == NULL for "not-allocated" */ |
200 | check(bmp.bitmap == NULL); | 205 | WARN_ON(bmp.bitmap != NULL); |
201 | 206 | ||
202 | kfree(bmp.bitmap); | 207 | kfree(bmp.bitmap); |
203 | } | 208 | } |
@@ -219,14 +224,13 @@ static void __init test_of_node(void) | |||
219 | of_node_init(&of_node); | 224 | of_node_init(&of_node); |
220 | of_node.full_name = node_name; | 225 | of_node.full_name = node_name; |
221 | 226 | ||
222 | check(0 == msi_bitmap_alloc(&bmp, size, &of_node)); | 227 | WARN_ON(msi_bitmap_alloc(&bmp, size, &of_node)); |
223 | 228 | ||
224 | /* No msi-available-ranges, so expect > 0 */ | 229 | /* No msi-available-ranges, so expect > 0 */ |
225 | check(msi_bitmap_reserve_dt_hwirqs(&bmp) > 0); | 230 | WARN_ON(msi_bitmap_reserve_dt_hwirqs(&bmp) <= 0); |
226 | 231 | ||
227 | /* Should all still be free */ | 232 | /* Should all still be free */ |
228 | check(0 == bitmap_find_free_region(bmp.bitmap, size, | 233 | WARN_ON(bitmap_find_free_region(bmp.bitmap, size, get_count_order(size))); |
229 | get_count_order(size))); | ||
230 | bitmap_release_region(bmp.bitmap, 0, get_count_order(size)); | 234 | bitmap_release_region(bmp.bitmap, 0, get_count_order(size)); |
231 | 235 | ||
232 | /* Now create a fake msi-available-ranges property */ | 236 | /* Now create a fake msi-available-ranges property */ |
@@ -240,11 +244,11 @@ static void __init test_of_node(void) | |||
240 | of_node.properties = ∝ | 244 | of_node.properties = ∝ |
241 | 245 | ||
242 | /* msi-available-ranges, so expect == 0 */ | 246 | /* msi-available-ranges, so expect == 0 */ |
243 | check(msi_bitmap_reserve_dt_hwirqs(&bmp) == 0); | 247 | WARN_ON(msi_bitmap_reserve_dt_hwirqs(&bmp)); |
244 | 248 | ||
245 | /* Check we got the expected result */ | 249 | /* Check we got the expected result */ |
246 | check(0 == bitmap_parselist(expected_str, expected, size)); | 250 | WARN_ON(bitmap_parselist(expected_str, expected, size)); |
247 | check(bitmap_equal(expected, bmp.bitmap, size)); | 251 | WARN_ON(!bitmap_equal(expected, bmp.bitmap, size)); |
248 | 252 | ||
249 | msi_bitmap_free(&bmp); | 253 | msi_bitmap_free(&bmp); |
250 | kfree(bmp.bitmap); | 254 | kfree(bmp.bitmap); |
diff --git a/arch/s390/include/uapi/asm/unistd.h b/arch/s390/include/uapi/asm/unistd.h index 940ac49198db..4197c89c52d4 100644 --- a/arch/s390/include/uapi/asm/unistd.h +++ b/arch/s390/include/uapi/asm/unistd.h | |||
@@ -286,7 +286,8 @@ | |||
286 | #define __NR_seccomp 348 | 286 | #define __NR_seccomp 348 |
287 | #define __NR_getrandom 349 | 287 | #define __NR_getrandom 349 |
288 | #define __NR_memfd_create 350 | 288 | #define __NR_memfd_create 350 |
289 | #define NR_syscalls 351 | 289 | #define __NR_bpf 351 |
290 | #define NR_syscalls 352 | ||
290 | 291 | ||
291 | /* | 292 | /* |
292 | * There are some system calls that are not present on 64 bit, some | 293 | * There are some system calls that are not present on 64 bit, some |
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c index faf6caa510dc..c4f7a3d655b8 100644 --- a/arch/s390/kernel/compat_wrapper.c +++ b/arch/s390/kernel/compat_wrapper.c | |||
@@ -217,3 +217,4 @@ COMPAT_SYSCALL_WRAP5(renameat2, int, olddfd, const char __user *, oldname, int, | |||
217 | COMPAT_SYSCALL_WRAP3(seccomp, unsigned int, op, unsigned int, flags, const char __user *, uargs) | 217 | COMPAT_SYSCALL_WRAP3(seccomp, unsigned int, op, unsigned int, flags, const char __user *, uargs) |
218 | COMPAT_SYSCALL_WRAP3(getrandom, char __user *, buf, size_t, count, unsigned int, flags) | 218 | COMPAT_SYSCALL_WRAP3(getrandom, char __user *, buf, size_t, count, unsigned int, flags) |
219 | COMPAT_SYSCALL_WRAP2(memfd_create, const char __user *, uname, unsigned int, flags) | 219 | COMPAT_SYSCALL_WRAP2(memfd_create, const char __user *, uname, unsigned int, flags) |
220 | COMPAT_SYSCALL_WRAP3(bpf, int, cmd, union bpf_attr *, attr, unsigned int, size); | ||
diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c index 08e761318c17..b878f12a9597 100644 --- a/arch/s390/kernel/perf_cpum_sf.c +++ b/arch/s390/kernel/perf_cpum_sf.c | |||
@@ -1411,11 +1411,6 @@ static void cpumsf_pmu_del(struct perf_event *event, int flags) | |||
1411 | perf_pmu_enable(event->pmu); | 1411 | perf_pmu_enable(event->pmu); |
1412 | } | 1412 | } |
1413 | 1413 | ||
1414 | static int cpumsf_pmu_event_idx(struct perf_event *event) | ||
1415 | { | ||
1416 | return event->hw.idx; | ||
1417 | } | ||
1418 | |||
1419 | CPUMF_EVENT_ATTR(SF, SF_CYCLES_BASIC, PERF_EVENT_CPUM_SF); | 1414 | CPUMF_EVENT_ATTR(SF, SF_CYCLES_BASIC, PERF_EVENT_CPUM_SF); |
1420 | CPUMF_EVENT_ATTR(SF, SF_CYCLES_BASIC_DIAG, PERF_EVENT_CPUM_SF_DIAG); | 1415 | CPUMF_EVENT_ATTR(SF, SF_CYCLES_BASIC_DIAG, PERF_EVENT_CPUM_SF_DIAG); |
1421 | 1416 | ||
@@ -1458,7 +1453,6 @@ static struct pmu cpumf_sampling = { | |||
1458 | .stop = cpumsf_pmu_stop, | 1453 | .stop = cpumsf_pmu_stop, |
1459 | .read = cpumsf_pmu_read, | 1454 | .read = cpumsf_pmu_read, |
1460 | 1455 | ||
1461 | .event_idx = cpumsf_pmu_event_idx, | ||
1462 | .attr_groups = cpumsf_pmu_attr_groups, | 1456 | .attr_groups = cpumsf_pmu_attr_groups, |
1463 | }; | 1457 | }; |
1464 | 1458 | ||
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index f537e937a988..99a567b70d16 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c | |||
@@ -834,9 +834,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) | |||
834 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 834 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
835 | trace_sys_enter(regs, regs->gprs[2]); | 835 | trace_sys_enter(regs, regs->gprs[2]); |
836 | 836 | ||
837 | audit_syscall_entry(is_compat_task() ? | 837 | audit_syscall_entry(regs->gprs[2], regs->orig_gpr2, |
838 | AUDIT_ARCH_S390 : AUDIT_ARCH_S390X, | ||
839 | regs->gprs[2], regs->orig_gpr2, | ||
840 | regs->gprs[3], regs->gprs[4], | 838 | regs->gprs[3], regs->gprs[4], |
841 | regs->gprs[5]); | 839 | regs->gprs[5]); |
842 | out: | 840 | out: |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 6fe886ac2db5..9f7087fd58de 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -359,3 +359,4 @@ SYSCALL(sys_renameat2,sys_renameat2,compat_sys_renameat2) | |||
359 | SYSCALL(sys_seccomp,sys_seccomp,compat_sys_seccomp) | 359 | SYSCALL(sys_seccomp,sys_seccomp,compat_sys_seccomp) |
360 | SYSCALL(sys_getrandom,sys_getrandom,compat_sys_getrandom) | 360 | SYSCALL(sys_getrandom,sys_getrandom,compat_sys_getrandom) |
361 | SYSCALL(sys_memfd_create,sys_memfd_create,compat_sys_memfd_create) /* 350 */ | 361 | SYSCALL(sys_memfd_create,sys_memfd_create,compat_sys_memfd_create) /* 350 */ |
362 | SYSCALL(sys_bpf,sys_bpf,compat_sys_bpf) | ||
diff --git a/arch/s390/kernel/uprobes.c b/arch/s390/kernel/uprobes.c index 956f4f7a591c..f6b3cd056ec2 100644 --- a/arch/s390/kernel/uprobes.c +++ b/arch/s390/kernel/uprobes.c | |||
@@ -5,13 +5,13 @@ | |||
5 | * Author(s): Jan Willeke, | 5 | * Author(s): Jan Willeke, |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/kprobes.h> | ||
9 | #include <linux/uaccess.h> | 8 | #include <linux/uaccess.h> |
10 | #include <linux/uprobes.h> | 9 | #include <linux/uprobes.h> |
11 | #include <linux/compat.h> | 10 | #include <linux/compat.h> |
12 | #include <linux/kdebug.h> | 11 | #include <linux/kdebug.h> |
13 | #include <asm/switch_to.h> | 12 | #include <asm/switch_to.h> |
14 | #include <asm/facility.h> | 13 | #include <asm/facility.h> |
14 | #include <asm/kprobes.h> | ||
15 | #include <asm/dis.h> | 15 | #include <asm/dis.h> |
16 | #include "entry.h" | 16 | #include "entry.h" |
17 | 17 | ||
diff --git a/arch/s390/lib/probes.c b/arch/s390/lib/probes.c index c5d64a099719..ae90e1ae3607 100644 --- a/arch/s390/lib/probes.c +++ b/arch/s390/lib/probes.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright IBM Corp. 2014 | 4 | * Copyright IBM Corp. 2014 |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <linux/kprobes.h> | 7 | #include <asm/kprobes.h> |
8 | #include <asm/dis.h> | 8 | #include <asm/dis.h> |
9 | 9 | ||
10 | int probe_is_prohibited_opcode(u16 *insn) | 10 | int probe_is_prohibited_opcode(u16 *insn) |
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index 296b61a4af59..1b79ca67392f 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c | |||
@@ -656,7 +656,7 @@ void __gmap_zap(struct gmap *gmap, unsigned long gaddr) | |||
656 | } | 656 | } |
657 | pgste_set_unlock(ptep, pgste); | 657 | pgste_set_unlock(ptep, pgste); |
658 | out_pte: | 658 | out_pte: |
659 | pte_unmap_unlock(*ptep, ptl); | 659 | pte_unmap_unlock(ptep, ptl); |
660 | } | 660 | } |
661 | EXPORT_SYMBOL_GPL(__gmap_zap); | 661 | EXPORT_SYMBOL_GPL(__gmap_zap); |
662 | 662 | ||
@@ -943,7 +943,7 @@ retry: | |||
943 | } | 943 | } |
944 | if (!(pte_val(*ptep) & _PAGE_INVALID) && | 944 | if (!(pte_val(*ptep) & _PAGE_INVALID) && |
945 | (pte_val(*ptep) & _PAGE_PROTECT)) { | 945 | (pte_val(*ptep) & _PAGE_PROTECT)) { |
946 | pte_unmap_unlock(*ptep, ptl); | 946 | pte_unmap_unlock(ptep, ptl); |
947 | if (fixup_user_fault(current, mm, addr, FAULT_FLAG_WRITE)) { | 947 | if (fixup_user_fault(current, mm, addr, FAULT_FLAG_WRITE)) { |
948 | up_read(&mm->mmap_sem); | 948 | up_read(&mm->mmap_sem); |
949 | return -EFAULT; | 949 | return -EFAULT; |
@@ -974,7 +974,7 @@ retry: | |||
974 | pgste_val(new) |= PGSTE_UC_BIT; | 974 | pgste_val(new) |= PGSTE_UC_BIT; |
975 | 975 | ||
976 | pgste_set_unlock(ptep, new); | 976 | pgste_set_unlock(ptep, new); |
977 | pte_unmap_unlock(*ptep, ptl); | 977 | pte_unmap_unlock(ptep, ptl); |
978 | up_read(&mm->mmap_sem); | 978 | up_read(&mm->mmap_sem); |
979 | return 0; | 979 | return 0; |
980 | } | 980 | } |
diff --git a/arch/sh/include/asm/syscall_32.h b/arch/sh/include/asm/syscall_32.h index 7d80df4f09cb..95be3b0ce0ac 100644 --- a/arch/sh/include/asm/syscall_32.h +++ b/arch/sh/include/asm/syscall_32.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __ASM_SH_SYSCALL_32_H | 1 | #ifndef __ASM_SH_SYSCALL_32_H |
2 | #define __ASM_SH_SYSCALL_32_H | 2 | #define __ASM_SH_SYSCALL_32_H |
3 | 3 | ||
4 | #include <uapi/linux/audit.h> | ||
4 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
5 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
6 | #include <linux/err.h> | 7 | #include <linux/err.h> |
@@ -93,4 +94,13 @@ static inline void syscall_set_arguments(struct task_struct *task, | |||
93 | } | 94 | } |
94 | } | 95 | } |
95 | 96 | ||
97 | static inline int syscall_get_arch(void) | ||
98 | { | ||
99 | int arch = AUDIT_ARCH_SH; | ||
100 | |||
101 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
102 | arch |= __AUDIT_ARCH_LE; | ||
103 | #endif | ||
104 | return arch; | ||
105 | } | ||
96 | #endif /* __ASM_SH_SYSCALL_32_H */ | 106 | #endif /* __ASM_SH_SYSCALL_32_H */ |
diff --git a/arch/sh/include/asm/syscall_64.h b/arch/sh/include/asm/syscall_64.h index c3561ca72bee..c6a797b90b80 100644 --- a/arch/sh/include/asm/syscall_64.h +++ b/arch/sh/include/asm/syscall_64.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __ASM_SH_SYSCALL_64_H | 1 | #ifndef __ASM_SH_SYSCALL_64_H |
2 | #define __ASM_SH_SYSCALL_64_H | 2 | #define __ASM_SH_SYSCALL_64_H |
3 | 3 | ||
4 | #include <uapi/linux/audit.h> | ||
4 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
5 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
6 | #include <asm/ptrace.h> | 7 | #include <asm/ptrace.h> |
@@ -61,4 +62,17 @@ static inline void syscall_set_arguments(struct task_struct *task, | |||
61 | memcpy(®s->regs[2 + i], args, n * sizeof(args[0])); | 62 | memcpy(®s->regs[2 + i], args, n * sizeof(args[0])); |
62 | } | 63 | } |
63 | 64 | ||
65 | static inline int syscall_get_arch(void) | ||
66 | { | ||
67 | int arch = AUDIT_ARCH_SH; | ||
68 | |||
69 | #ifdef CONFIG_64BIT | ||
70 | arch |= __AUDIT_ARCH_64BIT; | ||
71 | #endif | ||
72 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
73 | arch |= __AUDIT_ARCH_LE; | ||
74 | #endif | ||
75 | |||
76 | return arch; | ||
77 | } | ||
64 | #endif /* __ASM_SH_SYSCALL_64_H */ | 78 | #endif /* __ASM_SH_SYSCALL_64_H */ |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c index 9139d14b9c53..538c10db3537 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c | |||
@@ -118,7 +118,7 @@ static struct plat_sci_port scif0_platform_data = { | |||
118 | }; | 118 | }; |
119 | 119 | ||
120 | static struct resource scif0_resources[] = { | 120 | static struct resource scif0_resources[] = { |
121 | DEFINE_RES_MEM(0xfffffe80, 0x100), | 121 | DEFINE_RES_MEM(0xfffffe80, 0x10), |
122 | DEFINE_RES_IRQ(evt2irq(0x4e0)), | 122 | DEFINE_RES_IRQ(evt2irq(0x4e0)), |
123 | }; | 123 | }; |
124 | 124 | ||
@@ -143,7 +143,7 @@ static struct plat_sci_port scif1_platform_data = { | |||
143 | }; | 143 | }; |
144 | 144 | ||
145 | static struct resource scif1_resources[] = { | 145 | static struct resource scif1_resources[] = { |
146 | DEFINE_RES_MEM(0xa4000150, 0x100), | 146 | DEFINE_RES_MEM(0xa4000150, 0x10), |
147 | DEFINE_RES_IRQ(evt2irq(0x900)), | 147 | DEFINE_RES_IRQ(evt2irq(0x900)), |
148 | }; | 148 | }; |
149 | 149 | ||
@@ -169,7 +169,7 @@ static struct plat_sci_port scif2_platform_data = { | |||
169 | }; | 169 | }; |
170 | 170 | ||
171 | static struct resource scif2_resources[] = { | 171 | static struct resource scif2_resources[] = { |
172 | DEFINE_RES_MEM(0xa4000140, 0x100), | 172 | DEFINE_RES_MEM(0xa4000140, 0x10), |
173 | DEFINE_RES_IRQ(evt2irq(0x880)), | 173 | DEFINE_RES_IRQ(evt2irq(0x880)), |
174 | }; | 174 | }; |
175 | 175 | ||
diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c index 668c81631c08..c1a6b89bfe70 100644 --- a/arch/sh/kernel/ptrace_32.c +++ b/arch/sh/kernel/ptrace_32.c | |||
@@ -484,17 +484,6 @@ long arch_ptrace(struct task_struct *child, long request, | |||
484 | return ret; | 484 | return ret; |
485 | } | 485 | } |
486 | 486 | ||
487 | static inline int audit_arch(void) | ||
488 | { | ||
489 | int arch = EM_SH; | ||
490 | |||
491 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
492 | arch |= __AUDIT_ARCH_LE; | ||
493 | #endif | ||
494 | |||
495 | return arch; | ||
496 | } | ||
497 | |||
498 | asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) | 487 | asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) |
499 | { | 488 | { |
500 | long ret = 0; | 489 | long ret = 0; |
@@ -513,8 +502,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) | |||
513 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 502 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
514 | trace_sys_enter(regs, regs->regs[0]); | 503 | trace_sys_enter(regs, regs->regs[0]); |
515 | 504 | ||
516 | audit_syscall_entry(audit_arch(), regs->regs[3], | 505 | audit_syscall_entry(regs->regs[3], regs->regs[4], regs->regs[5], |
517 | regs->regs[4], regs->regs[5], | ||
518 | regs->regs[6], regs->regs[7]); | 506 | regs->regs[6], regs->regs[7]); |
519 | 507 | ||
520 | return ret ?: regs->regs[0]; | 508 | return ret ?: regs->regs[0]; |
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c index af90339dadcd..5cea973a65b2 100644 --- a/arch/sh/kernel/ptrace_64.c +++ b/arch/sh/kernel/ptrace_64.c | |||
@@ -504,20 +504,6 @@ asmlinkage int sh64_ptrace(long request, long pid, | |||
504 | return sys_ptrace(request, pid, addr, data); | 504 | return sys_ptrace(request, pid, addr, data); |
505 | } | 505 | } |
506 | 506 | ||
507 | static inline int audit_arch(void) | ||
508 | { | ||
509 | int arch = EM_SH; | ||
510 | |||
511 | #ifdef CONFIG_64BIT | ||
512 | arch |= __AUDIT_ARCH_64BIT; | ||
513 | #endif | ||
514 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
515 | arch |= __AUDIT_ARCH_LE; | ||
516 | #endif | ||
517 | |||
518 | return arch; | ||
519 | } | ||
520 | |||
521 | asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs) | 507 | asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs) |
522 | { | 508 | { |
523 | long long ret = 0; | 509 | long long ret = 0; |
@@ -536,8 +522,7 @@ asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs) | |||
536 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 522 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
537 | trace_sys_enter(regs, regs->regs[9]); | 523 | trace_sys_enter(regs, regs->regs[9]); |
538 | 524 | ||
539 | audit_syscall_entry(audit_arch(), regs->regs[1], | 525 | audit_syscall_entry(regs->regs[1], regs->regs[2], regs->regs[3], |
540 | regs->regs[2], regs->regs[3], | ||
541 | regs->regs[4], regs->regs[5]); | 526 | regs->regs[4], regs->regs[5]); |
542 | 527 | ||
543 | return ret ?: regs->regs[9]; | 528 | return ret ?: regs->regs[9]; |
diff --git a/arch/sparc/include/asm/oplib_64.h b/arch/sparc/include/asm/oplib_64.h index f34682430fcf..2e3a4add8591 100644 --- a/arch/sparc/include/asm/oplib_64.h +++ b/arch/sparc/include/asm/oplib_64.h | |||
@@ -62,7 +62,8 @@ struct linux_mem_p1275 { | |||
62 | /* You must call prom_init() before using any of the library services, | 62 | /* You must call prom_init() before using any of the library services, |
63 | * preferably as early as possible. Pass it the romvec pointer. | 63 | * preferably as early as possible. Pass it the romvec pointer. |
64 | */ | 64 | */ |
65 | void prom_init(void *cif_handler, void *cif_stack); | 65 | void prom_init(void *cif_handler); |
66 | void prom_init_report(void); | ||
66 | 67 | ||
67 | /* Boot argument acquisition, returns the boot command line string. */ | 68 | /* Boot argument acquisition, returns the boot command line string. */ |
68 | char *prom_getbootargs(void); | 69 | char *prom_getbootargs(void); |
diff --git a/arch/sparc/include/asm/setup.h b/arch/sparc/include/asm/setup.h index f5fffd84d0dd..29d64b1758ed 100644 --- a/arch/sparc/include/asm/setup.h +++ b/arch/sparc/include/asm/setup.h | |||
@@ -48,6 +48,8 @@ unsigned long safe_compute_effective_address(struct pt_regs *, unsigned int); | |||
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | #ifdef CONFIG_SPARC64 | 50 | #ifdef CONFIG_SPARC64 |
51 | void __init start_early_boot(void); | ||
52 | |||
51 | /* unaligned_64.c */ | 53 | /* unaligned_64.c */ |
52 | int handle_ldf_stq(u32 insn, struct pt_regs *regs); | 54 | int handle_ldf_stq(u32 insn, struct pt_regs *regs); |
53 | void handle_ld_nf(u32 insn, struct pt_regs *regs); | 55 | void handle_ld_nf(u32 insn, struct pt_regs *regs); |
diff --git a/arch/sparc/include/asm/syscall.h b/arch/sparc/include/asm/syscall.h index 025a02ad2e31..49f71fd5b56e 100644 --- a/arch/sparc/include/asm/syscall.h +++ b/arch/sparc/include/asm/syscall.h | |||
@@ -1,9 +1,11 @@ | |||
1 | #ifndef __ASM_SPARC_SYSCALL_H | 1 | #ifndef __ASM_SPARC_SYSCALL_H |
2 | #define __ASM_SPARC_SYSCALL_H | 2 | #define __ASM_SPARC_SYSCALL_H |
3 | 3 | ||
4 | #include <uapi/linux/audit.h> | ||
4 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
5 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
6 | #include <asm/ptrace.h> | 7 | #include <asm/ptrace.h> |
8 | #include <asm/thread_info.h> | ||
7 | 9 | ||
8 | /* | 10 | /* |
9 | * The syscall table always contains 32 bit pointers since we know that the | 11 | * The syscall table always contains 32 bit pointers since we know that the |
@@ -124,4 +126,9 @@ static inline void syscall_set_arguments(struct task_struct *task, | |||
124 | regs->u_regs[UREG_I0 + i + j] = args[j]; | 126 | regs->u_regs[UREG_I0 + i + j] = args[j]; |
125 | } | 127 | } |
126 | 128 | ||
129 | static inline int syscall_get_arch(void) | ||
130 | { | ||
131 | return is_32bit_task() ? AUDIT_ARCH_SPARC : AUDIT_ARCH_SPARC64; | ||
132 | } | ||
133 | |||
127 | #endif /* __ASM_SPARC_SYSCALL_H */ | 134 | #endif /* __ASM_SPARC_SYSCALL_H */ |
diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h index 96efa7adc223..025c98446b1e 100644 --- a/arch/sparc/include/asm/thread_info_32.h +++ b/arch/sparc/include/asm/thread_info_32.h | |||
@@ -130,6 +130,8 @@ register struct thread_info *current_thread_info_reg asm("g6"); | |||
130 | #define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \ | 130 | #define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \ |
131 | _TIF_SIGPENDING) | 131 | _TIF_SIGPENDING) |
132 | 132 | ||
133 | #define is_32bit_task() (1) | ||
134 | |||
133 | #endif /* __KERNEL__ */ | 135 | #endif /* __KERNEL__ */ |
134 | 136 | ||
135 | #endif /* _ASM_THREAD_INFO_H */ | 137 | #endif /* _ASM_THREAD_INFO_H */ |
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h index cc6275c931a5..798f0279a4b5 100644 --- a/arch/sparc/include/asm/thread_info_64.h +++ b/arch/sparc/include/asm/thread_info_64.h | |||
@@ -221,6 +221,8 @@ register struct thread_info *current_thread_info_reg asm("g6"); | |||
221 | _TIF_NEED_RESCHED) | 221 | _TIF_NEED_RESCHED) |
222 | #define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING) | 222 | #define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING) |
223 | 223 | ||
224 | #define is_32bit_task() (test_thread_flag(TIF_32BIT)) | ||
225 | |||
224 | /* | 226 | /* |
225 | * Thread-synchronous status. | 227 | * Thread-synchronous status. |
226 | * | 228 | * |
diff --git a/arch/sparc/include/uapi/asm/unistd.h b/arch/sparc/include/uapi/asm/unistd.h index c842a89b1190..46d83842eddc 100644 --- a/arch/sparc/include/uapi/asm/unistd.h +++ b/arch/sparc/include/uapi/asm/unistd.h | |||
@@ -414,8 +414,9 @@ | |||
414 | #define __NR_seccomp 346 | 414 | #define __NR_seccomp 346 |
415 | #define __NR_getrandom 347 | 415 | #define __NR_getrandom 347 |
416 | #define __NR_memfd_create 348 | 416 | #define __NR_memfd_create 348 |
417 | #define __NR_bpf 349 | ||
417 | 418 | ||
418 | #define NR_syscalls 349 | 419 | #define NR_syscalls 350 |
419 | 420 | ||
420 | /* Bitmask values returned from kern_features system call. */ | 421 | /* Bitmask values returned from kern_features system call. */ |
421 | #define KERN_FEATURE_MIXED_MODE_STACK 0x00000001 | 422 | #define KERN_FEATURE_MIXED_MODE_STACK 0x00000001 |
diff --git a/arch/sparc/kernel/entry.h b/arch/sparc/kernel/entry.h index ebaba6167dd4..88d322b67fac 100644 --- a/arch/sparc/kernel/entry.h +++ b/arch/sparc/kernel/entry.h | |||
@@ -65,13 +65,10 @@ struct pause_patch_entry { | |||
65 | extern struct pause_patch_entry __pause_3insn_patch, | 65 | extern struct pause_patch_entry __pause_3insn_patch, |
66 | __pause_3insn_patch_end; | 66 | __pause_3insn_patch_end; |
67 | 67 | ||
68 | void __init per_cpu_patch(void); | ||
69 | void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *, | 68 | void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *, |
70 | struct sun4v_1insn_patch_entry *); | 69 | struct sun4v_1insn_patch_entry *); |
71 | void sun4v_patch_2insn_range(struct sun4v_2insn_patch_entry *, | 70 | void sun4v_patch_2insn_range(struct sun4v_2insn_patch_entry *, |
72 | struct sun4v_2insn_patch_entry *); | 71 | struct sun4v_2insn_patch_entry *); |
73 | void __init sun4v_patch(void); | ||
74 | void __init boot_cpu_id_too_large(int cpu); | ||
75 | extern unsigned int dcache_parity_tl1_occurred; | 72 | extern unsigned int dcache_parity_tl1_occurred; |
76 | extern unsigned int icache_parity_tl1_occurred; | 73 | extern unsigned int icache_parity_tl1_occurred; |
77 | 74 | ||
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S index 4fdeb8040d4d..3d61fcae7ee3 100644 --- a/arch/sparc/kernel/head_64.S +++ b/arch/sparc/kernel/head_64.S | |||
@@ -672,14 +672,12 @@ tlb_fixup_done: | |||
672 | sethi %hi(init_thread_union), %g6 | 672 | sethi %hi(init_thread_union), %g6 |
673 | or %g6, %lo(init_thread_union), %g6 | 673 | or %g6, %lo(init_thread_union), %g6 |
674 | ldx [%g6 + TI_TASK], %g4 | 674 | ldx [%g6 + TI_TASK], %g4 |
675 | mov %sp, %l6 | ||
676 | 675 | ||
677 | wr %g0, ASI_P, %asi | 676 | wr %g0, ASI_P, %asi |
678 | mov 1, %g1 | 677 | mov 1, %g1 |
679 | sllx %g1, THREAD_SHIFT, %g1 | 678 | sllx %g1, THREAD_SHIFT, %g1 |
680 | sub %g1, (STACKFRAME_SZ + STACK_BIAS), %g1 | 679 | sub %g1, (STACKFRAME_SZ + STACK_BIAS), %g1 |
681 | add %g6, %g1, %sp | 680 | add %g6, %g1, %sp |
682 | mov 0, %fp | ||
683 | 681 | ||
684 | /* Set per-cpu pointer initially to zero, this makes | 682 | /* Set per-cpu pointer initially to zero, this makes |
685 | * the boot-cpu use the in-kernel-image per-cpu areas | 683 | * the boot-cpu use the in-kernel-image per-cpu areas |
@@ -706,44 +704,14 @@ tlb_fixup_done: | |||
706 | nop | 704 | nop |
707 | #endif | 705 | #endif |
708 | 706 | ||
709 | mov %l6, %o1 ! OpenPROM stack | ||
710 | call prom_init | 707 | call prom_init |
711 | mov %l7, %o0 ! OpenPROM cif handler | 708 | mov %l7, %o0 ! OpenPROM cif handler |
712 | 709 | ||
713 | /* Initialize current_thread_info()->cpu as early as possible. | 710 | /* To create a one-register-window buffer between the kernel's |
714 | * In order to do that accurately we have to patch up the get_cpuid() | 711 | * initial stack and the last stack frame we use from the firmware, |
715 | * assembler sequences. And that, in turn, requires that we know | 712 | * do the rest of the boot from a C helper function. |
716 | * if we are on a Starfire box or not. While we're here, patch up | ||
717 | * the sun4v sequences as well. | ||
718 | */ | 713 | */ |
719 | call check_if_starfire | 714 | call start_early_boot |
720 | nop | ||
721 | call per_cpu_patch | ||
722 | nop | ||
723 | call sun4v_patch | ||
724 | nop | ||
725 | |||
726 | #ifdef CONFIG_SMP | ||
727 | call hard_smp_processor_id | ||
728 | nop | ||
729 | cmp %o0, NR_CPUS | ||
730 | blu,pt %xcc, 1f | ||
731 | nop | ||
732 | call boot_cpu_id_too_large | ||
733 | nop | ||
734 | /* Not reached... */ | ||
735 | |||
736 | 1: | ||
737 | #else | ||
738 | mov 0, %o0 | ||
739 | #endif | ||
740 | sth %o0, [%g6 + TI_CPU] | ||
741 | |||
742 | call prom_init_report | ||
743 | nop | ||
744 | |||
745 | /* Off we go.... */ | ||
746 | call start_kernel | ||
747 | nop | 715 | nop |
748 | /* Not reached... */ | 716 | /* Not reached... */ |
749 | 717 | ||
diff --git a/arch/sparc/kernel/hvtramp.S b/arch/sparc/kernel/hvtramp.S index b7ddcdd1dea9..cdbfec299f2f 100644 --- a/arch/sparc/kernel/hvtramp.S +++ b/arch/sparc/kernel/hvtramp.S | |||
@@ -109,7 +109,6 @@ hv_cpu_startup: | |||
109 | sllx %g5, THREAD_SHIFT, %g5 | 109 | sllx %g5, THREAD_SHIFT, %g5 |
110 | sub %g5, (STACKFRAME_SZ + STACK_BIAS), %g5 | 110 | sub %g5, (STACKFRAME_SZ + STACK_BIAS), %g5 |
111 | add %g6, %g5, %sp | 111 | add %g6, %g5, %sp |
112 | mov 0, %fp | ||
113 | 112 | ||
114 | call init_irqwork_curcpu | 113 | call init_irqwork_curcpu |
115 | nop | 114 | nop |
diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c index c13c9f25d83a..9ddc4928a089 100644 --- a/arch/sparc/kernel/ptrace_64.c +++ b/arch/sparc/kernel/ptrace_64.c | |||
@@ -1076,13 +1076,8 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs) | |||
1076 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 1076 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
1077 | trace_sys_enter(regs, regs->u_regs[UREG_G1]); | 1077 | trace_sys_enter(regs, regs->u_regs[UREG_G1]); |
1078 | 1078 | ||
1079 | audit_syscall_entry((test_thread_flag(TIF_32BIT) ? | 1079 | audit_syscall_entry(regs->u_regs[UREG_G1], regs->u_regs[UREG_I0], |
1080 | AUDIT_ARCH_SPARC : | 1080 | regs->u_regs[UREG_I1], regs->u_regs[UREG_I2], |
1081 | AUDIT_ARCH_SPARC64), | ||
1082 | regs->u_regs[UREG_G1], | ||
1083 | regs->u_regs[UREG_I0], | ||
1084 | regs->u_regs[UREG_I1], | ||
1085 | regs->u_regs[UREG_I2], | ||
1086 | regs->u_regs[UREG_I3]); | 1081 | regs->u_regs[UREG_I3]); |
1087 | 1082 | ||
1088 | return ret; | 1083 | return ret; |
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index e629b8377587..c38d19fc27ba 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/cpu.h> | 30 | #include <linux/cpu.h> |
31 | #include <linux/initrd.h> | 31 | #include <linux/initrd.h> |
32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
33 | #include <linux/start_kernel.h> | ||
33 | 34 | ||
34 | #include <asm/io.h> | 35 | #include <asm/io.h> |
35 | #include <asm/processor.h> | 36 | #include <asm/processor.h> |
@@ -162,7 +163,7 @@ char reboot_command[COMMAND_LINE_SIZE]; | |||
162 | 163 | ||
163 | static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 }; | 164 | static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 }; |
164 | 165 | ||
165 | void __init per_cpu_patch(void) | 166 | static void __init per_cpu_patch(void) |
166 | { | 167 | { |
167 | struct cpuid_patch_entry *p; | 168 | struct cpuid_patch_entry *p; |
168 | unsigned long ver; | 169 | unsigned long ver; |
@@ -254,7 +255,7 @@ void sun4v_patch_2insn_range(struct sun4v_2insn_patch_entry *start, | |||
254 | } | 255 | } |
255 | } | 256 | } |
256 | 257 | ||
257 | void __init sun4v_patch(void) | 258 | static void __init sun4v_patch(void) |
258 | { | 259 | { |
259 | extern void sun4v_hvapi_init(void); | 260 | extern void sun4v_hvapi_init(void); |
260 | 261 | ||
@@ -323,14 +324,25 @@ static void __init pause_patch(void) | |||
323 | } | 324 | } |
324 | } | 325 | } |
325 | 326 | ||
326 | #ifdef CONFIG_SMP | 327 | void __init start_early_boot(void) |
327 | void __init boot_cpu_id_too_large(int cpu) | ||
328 | { | 328 | { |
329 | prom_printf("Serious problem, boot cpu id (%d) >= NR_CPUS (%d)\n", | 329 | int cpu; |
330 | cpu, NR_CPUS); | 330 | |
331 | prom_halt(); | 331 | check_if_starfire(); |
332 | per_cpu_patch(); | ||
333 | sun4v_patch(); | ||
334 | |||
335 | cpu = hard_smp_processor_id(); | ||
336 | if (cpu >= NR_CPUS) { | ||
337 | prom_printf("Serious problem, boot cpu id (%d) >= NR_CPUS (%d)\n", | ||
338 | cpu, NR_CPUS); | ||
339 | prom_halt(); | ||
340 | } | ||
341 | current_thread_info()->cpu = cpu; | ||
342 | |||
343 | prom_init_report(); | ||
344 | start_kernel(); | ||
332 | } | 345 | } |
333 | #endif | ||
334 | 346 | ||
335 | /* On Ultra, we support all of the v8 capabilities. */ | 347 | /* On Ultra, we support all of the v8 capabilities. */ |
336 | unsigned long sparc64_elf_hwcap = (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | | 348 | unsigned long sparc64_elf_hwcap = (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | |
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S index 6a873c344bc0..ad0cdf497b78 100644 --- a/arch/sparc/kernel/systbls_32.S +++ b/arch/sparc/kernel/systbls_32.S | |||
@@ -86,4 +86,4 @@ sys_call_table: | |||
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, sys_finit_module, sys_sched_setattr, sys_sched_getattr | 88 | /*340*/ .long sys_ni_syscall, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr |
89 | /*345*/ .long sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create | 89 | /*345*/ .long sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf |
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index d9151b6490d8..580cde9370c9 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S | |||
@@ -87,7 +87,7 @@ sys_call_table32: | |||
87 | /*330*/ .word compat_sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime | 87 | /*330*/ .word compat_sys_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, sys_finit_module, sys_sched_setattr, sys_sched_getattr | 89 | /*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr |
90 | .word sys32_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create | 90 | .word sys32_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf |
91 | 91 | ||
92 | #endif /* CONFIG_COMPAT */ | 92 | #endif /* CONFIG_COMPAT */ |
93 | 93 | ||
@@ -166,4 +166,4 @@ sys_call_table: | |||
166 | /*330*/ .word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime | 166 | /*330*/ .word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime |
167 | .word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev | 167 | .word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev |
168 | /*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr | 168 | /*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr |
169 | .word sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create | 169 | .word sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf |
diff --git a/arch/sparc/kernel/trampoline_64.S b/arch/sparc/kernel/trampoline_64.S index 737f8cbc7d56..88ede1d53b4c 100644 --- a/arch/sparc/kernel/trampoline_64.S +++ b/arch/sparc/kernel/trampoline_64.S | |||
@@ -109,10 +109,13 @@ startup_continue: | |||
109 | brnz,pn %g1, 1b | 109 | brnz,pn %g1, 1b |
110 | nop | 110 | nop |
111 | 111 | ||
112 | sethi %hi(p1275buf), %g2 | 112 | /* Get onto temporary stack which will be in the locked |
113 | or %g2, %lo(p1275buf), %g2 | 113 | * kernel image. |
114 | ldx [%g2 + 0x10], %l2 | 114 | */ |
115 | add %l2, -(192 + 128), %sp | 115 | sethi %hi(tramp_stack), %g1 |
116 | or %g1, %lo(tramp_stack), %g1 | ||
117 | add %g1, TRAMP_STACK_SIZE, %g1 | ||
118 | sub %g1, STACKFRAME_SZ + STACK_BIAS + 256, %sp | ||
116 | flushw | 119 | flushw |
117 | 120 | ||
118 | /* Setup the loop variables: | 121 | /* Setup the loop variables: |
@@ -394,7 +397,6 @@ after_lock_tlb: | |||
394 | sllx %g5, THREAD_SHIFT, %g5 | 397 | sllx %g5, THREAD_SHIFT, %g5 |
395 | sub %g5, (STACKFRAME_SZ + STACK_BIAS), %g5 | 398 | sub %g5, (STACKFRAME_SZ + STACK_BIAS), %g5 |
396 | add %g6, %g5, %sp | 399 | add %g6, %g5, %sp |
397 | mov 0, %fp | ||
398 | 400 | ||
399 | rdpr %pstate, %o1 | 401 | rdpr %pstate, %o1 |
400 | or %o1, PSTATE_IE, %o1 | 402 | or %o1, PSTATE_IE, %o1 |
diff --git a/arch/sparc/mm/gup.c b/arch/sparc/mm/gup.c index 1aed0432c64b..ae6ce383d4df 100644 --- a/arch/sparc/mm/gup.c +++ b/arch/sparc/mm/gup.c | |||
@@ -160,6 +160,36 @@ static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end, | |||
160 | return 1; | 160 | return 1; |
161 | } | 161 | } |
162 | 162 | ||
163 | int __get_user_pages_fast(unsigned long start, int nr_pages, int write, | ||
164 | struct page **pages) | ||
165 | { | ||
166 | struct mm_struct *mm = current->mm; | ||
167 | unsigned long addr, len, end; | ||
168 | unsigned long next, flags; | ||
169 | pgd_t *pgdp; | ||
170 | int nr = 0; | ||
171 | |||
172 | start &= PAGE_MASK; | ||
173 | addr = start; | ||
174 | len = (unsigned long) nr_pages << PAGE_SHIFT; | ||
175 | end = start + len; | ||
176 | |||
177 | local_irq_save(flags); | ||
178 | pgdp = pgd_offset(mm, addr); | ||
179 | do { | ||
180 | pgd_t pgd = *pgdp; | ||
181 | |||
182 | next = pgd_addr_end(addr, end); | ||
183 | if (pgd_none(pgd)) | ||
184 | break; | ||
185 | if (!gup_pud_range(pgd, addr, next, write, pages, &nr)) | ||
186 | break; | ||
187 | } while (pgdp++, addr = next, addr != end); | ||
188 | local_irq_restore(flags); | ||
189 | |||
190 | return nr; | ||
191 | } | ||
192 | |||
163 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 193 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
164 | struct page **pages) | 194 | struct page **pages) |
165 | { | 195 | { |
diff --git a/arch/sparc/prom/cif.S b/arch/sparc/prom/cif.S index 9c86b4b7d429..8050f381f518 100644 --- a/arch/sparc/prom/cif.S +++ b/arch/sparc/prom/cif.S | |||
@@ -11,11 +11,10 @@ | |||
11 | .text | 11 | .text |
12 | .globl prom_cif_direct | 12 | .globl prom_cif_direct |
13 | prom_cif_direct: | 13 | prom_cif_direct: |
14 | save %sp, -192, %sp | ||
14 | sethi %hi(p1275buf), %o1 | 15 | sethi %hi(p1275buf), %o1 |
15 | or %o1, %lo(p1275buf), %o1 | 16 | or %o1, %lo(p1275buf), %o1 |
16 | ldx [%o1 + 0x0010], %o2 ! prom_cif_stack | 17 | ldx [%o1 + 0x0008], %l2 ! prom_cif_handler |
17 | save %o2, -192, %sp | ||
18 | ldx [%i1 + 0x0008], %l2 ! prom_cif_handler | ||
19 | mov %g4, %l0 | 18 | mov %g4, %l0 |
20 | mov %g5, %l1 | 19 | mov %g5, %l1 |
21 | mov %g6, %l3 | 20 | mov %g6, %l3 |
diff --git a/arch/sparc/prom/init_64.c b/arch/sparc/prom/init_64.c index d95db755828f..110b0d78b864 100644 --- a/arch/sparc/prom/init_64.c +++ b/arch/sparc/prom/init_64.c | |||
@@ -26,13 +26,13 @@ phandle prom_chosen_node; | |||
26 | * It gets passed the pointer to the PROM vector. | 26 | * It gets passed the pointer to the PROM vector. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | extern void prom_cif_init(void *, void *); | 29 | extern void prom_cif_init(void *); |
30 | 30 | ||
31 | void __init prom_init(void *cif_handler, void *cif_stack) | 31 | void __init prom_init(void *cif_handler) |
32 | { | 32 | { |
33 | phandle node; | 33 | phandle node; |
34 | 34 | ||
35 | prom_cif_init(cif_handler, cif_stack); | 35 | prom_cif_init(cif_handler); |
36 | 36 | ||
37 | prom_chosen_node = prom_finddevice(prom_chosen_path); | 37 | prom_chosen_node = prom_finddevice(prom_chosen_path); |
38 | if (!prom_chosen_node || (s32)prom_chosen_node == -1) | 38 | if (!prom_chosen_node || (s32)prom_chosen_node == -1) |
diff --git a/arch/sparc/prom/p1275.c b/arch/sparc/prom/p1275.c index b2340f008ae0..545d8bb79b65 100644 --- a/arch/sparc/prom/p1275.c +++ b/arch/sparc/prom/p1275.c | |||
@@ -20,7 +20,6 @@ | |||
20 | struct { | 20 | struct { |
21 | long prom_callback; /* 0x00 */ | 21 | long prom_callback; /* 0x00 */ |
22 | void (*prom_cif_handler)(long *); /* 0x08 */ | 22 | void (*prom_cif_handler)(long *); /* 0x08 */ |
23 | unsigned long prom_cif_stack; /* 0x10 */ | ||
24 | } p1275buf; | 23 | } p1275buf; |
25 | 24 | ||
26 | extern void prom_world(int); | 25 | extern void prom_world(int); |
@@ -52,5 +51,4 @@ void p1275_cmd_direct(unsigned long *args) | |||
52 | void prom_cif_init(void *cif_handler, void *cif_stack) | 51 | void prom_cif_init(void *cif_handler, void *cif_stack) |
53 | { | 52 | { |
54 | p1275buf.prom_cif_handler = (void (*)(long *))cif_handler; | 53 | p1275buf.prom_cif_handler = (void (*)(long *))cif_handler; |
55 | p1275buf.prom_cif_stack = (unsigned long)cif_stack; | ||
56 | } | 54 | } |
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c index 694d551c8899..62435ef003d9 100644 --- a/arch/um/kernel/ptrace.c +++ b/arch/um/kernel/ptrace.c | |||
@@ -165,8 +165,7 @@ static void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs, | |||
165 | */ | 165 | */ |
166 | void syscall_trace_enter(struct pt_regs *regs) | 166 | void syscall_trace_enter(struct pt_regs *regs) |
167 | { | 167 | { |
168 | audit_syscall_entry(HOST_AUDIT_ARCH, | 168 | audit_syscall_entry(UPT_SYSCALL_NR(®s->regs), |
169 | UPT_SYSCALL_NR(®s->regs), | ||
170 | UPT_SYSCALL_ARG1(®s->regs), | 169 | UPT_SYSCALL_ARG1(®s->regs), |
171 | UPT_SYSCALL_ARG2(®s->regs), | 170 | UPT_SYSCALL_ARG2(®s->regs), |
172 | UPT_SYSCALL_ARG3(®s->regs), | 171 | UPT_SYSCALL_ARG3(®s->regs), |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index f2327e88e07c..ded8a6774ac9 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -142,6 +142,10 @@ config INSTRUCTION_DECODER | |||
142 | def_bool y | 142 | def_bool y |
143 | depends on KPROBES || PERF_EVENTS || UPROBES | 143 | depends on KPROBES || PERF_EVENTS || UPROBES |
144 | 144 | ||
145 | config PERF_EVENTS_INTEL_UNCORE | ||
146 | def_bool y | ||
147 | depends on PERF_EVENTS && SUP_SUP_INTEL && PCI | ||
148 | |||
145 | config OUTPUT_FORMAT | 149 | config OUTPUT_FORMAT |
146 | string | 150 | string |
147 | default "elf32-i386" if X86_32 | 151 | default "elf32-i386" if X86_32 |
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index de8eebd6f67c..1acf605a646d 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c | |||
@@ -330,8 +330,10 @@ __setup_efi_pci32(efi_pci_io_protocol_32 *pci, struct pci_setup_rom **__rom) | |||
330 | size = pci->romsize + sizeof(*rom); | 330 | size = pci->romsize + sizeof(*rom); |
331 | 331 | ||
332 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom); | 332 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom); |
333 | if (status != EFI_SUCCESS) | 333 | if (status != EFI_SUCCESS) { |
334 | efi_printk(sys_table, "Failed to alloc mem for rom\n"); | ||
334 | return status; | 335 | return status; |
336 | } | ||
335 | 337 | ||
336 | memset(rom, 0, sizeof(*rom)); | 338 | memset(rom, 0, sizeof(*rom)); |
337 | 339 | ||
@@ -344,14 +346,18 @@ __setup_efi_pci32(efi_pci_io_protocol_32 *pci, struct pci_setup_rom **__rom) | |||
344 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, | 346 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, |
345 | PCI_VENDOR_ID, 1, &(rom->vendor)); | 347 | PCI_VENDOR_ID, 1, &(rom->vendor)); |
346 | 348 | ||
347 | if (status != EFI_SUCCESS) | 349 | if (status != EFI_SUCCESS) { |
350 | efi_printk(sys_table, "Failed to read rom->vendor\n"); | ||
348 | goto free_struct; | 351 | goto free_struct; |
352 | } | ||
349 | 353 | ||
350 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, | 354 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, |
351 | PCI_DEVICE_ID, 1, &(rom->devid)); | 355 | PCI_DEVICE_ID, 1, &(rom->devid)); |
352 | 356 | ||
353 | if (status != EFI_SUCCESS) | 357 | if (status != EFI_SUCCESS) { |
358 | efi_printk(sys_table, "Failed to read rom->devid\n"); | ||
354 | goto free_struct; | 359 | goto free_struct; |
360 | } | ||
355 | 361 | ||
356 | status = efi_early->call(pci->get_location, pci, &(rom->segment), | 362 | status = efi_early->call(pci->get_location, pci, &(rom->segment), |
357 | &(rom->bus), &(rom->device), &(rom->function)); | 363 | &(rom->bus), &(rom->device), &(rom->function)); |
@@ -432,8 +438,10 @@ __setup_efi_pci64(efi_pci_io_protocol_64 *pci, struct pci_setup_rom **__rom) | |||
432 | size = pci->romsize + sizeof(*rom); | 438 | size = pci->romsize + sizeof(*rom); |
433 | 439 | ||
434 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom); | 440 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom); |
435 | if (status != EFI_SUCCESS) | 441 | if (status != EFI_SUCCESS) { |
442 | efi_printk(sys_table, "Failed to alloc mem for rom\n"); | ||
436 | return status; | 443 | return status; |
444 | } | ||
437 | 445 | ||
438 | rom->data.type = SETUP_PCI; | 446 | rom->data.type = SETUP_PCI; |
439 | rom->data.len = size - sizeof(struct setup_data); | 447 | rom->data.len = size - sizeof(struct setup_data); |
@@ -444,14 +452,18 @@ __setup_efi_pci64(efi_pci_io_protocol_64 *pci, struct pci_setup_rom **__rom) | |||
444 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, | 452 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, |
445 | PCI_VENDOR_ID, 1, &(rom->vendor)); | 453 | PCI_VENDOR_ID, 1, &(rom->vendor)); |
446 | 454 | ||
447 | if (status != EFI_SUCCESS) | 455 | if (status != EFI_SUCCESS) { |
456 | efi_printk(sys_table, "Failed to read rom->vendor\n"); | ||
448 | goto free_struct; | 457 | goto free_struct; |
458 | } | ||
449 | 459 | ||
450 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, | 460 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, |
451 | PCI_DEVICE_ID, 1, &(rom->devid)); | 461 | PCI_DEVICE_ID, 1, &(rom->devid)); |
452 | 462 | ||
453 | if (status != EFI_SUCCESS) | 463 | if (status != EFI_SUCCESS) { |
464 | efi_printk(sys_table, "Failed to read rom->devid\n"); | ||
454 | goto free_struct; | 465 | goto free_struct; |
466 | } | ||
455 | 467 | ||
456 | status = efi_early->call(pci->get_location, pci, &(rom->segment), | 468 | status = efi_early->call(pci->get_location, pci, &(rom->segment), |
457 | &(rom->bus), &(rom->device), &(rom->function)); | 469 | &(rom->bus), &(rom->device), &(rom->function)); |
@@ -538,8 +550,10 @@ static void setup_efi_pci(struct boot_params *params) | |||
538 | EFI_LOADER_DATA, | 550 | EFI_LOADER_DATA, |
539 | size, (void **)&pci_handle); | 551 | size, (void **)&pci_handle); |
540 | 552 | ||
541 | if (status != EFI_SUCCESS) | 553 | if (status != EFI_SUCCESS) { |
554 | efi_printk(sys_table, "Failed to alloc mem for pci_handle\n"); | ||
542 | return; | 555 | return; |
556 | } | ||
543 | 557 | ||
544 | status = efi_call_early(locate_handle, | 558 | status = efi_call_early(locate_handle, |
545 | EFI_LOCATE_BY_PROTOCOL, &pci_proto, | 559 | EFI_LOCATE_BY_PROTOCOL, &pci_proto, |
@@ -1105,6 +1119,10 @@ struct boot_params *make_boot_params(struct efi_config *c) | |||
1105 | 1119 | ||
1106 | memset(sdt, 0, sizeof(*sdt)); | 1120 | memset(sdt, 0, sizeof(*sdt)); |
1107 | 1121 | ||
1122 | status = efi_parse_options(cmdline_ptr); | ||
1123 | if (status != EFI_SUCCESS) | ||
1124 | goto fail2; | ||
1125 | |||
1108 | status = handle_cmdline_files(sys_table, image, | 1126 | status = handle_cmdline_files(sys_table, image, |
1109 | (char *)(unsigned long)hdr->cmd_line_ptr, | 1127 | (char *)(unsigned long)hdr->cmd_line_ptr, |
1110 | "initrd=", hdr->initrd_addr_max, | 1128 | "initrd=", hdr->initrd_addr_max, |
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 711de084ab57..8ffba18395c8 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
@@ -198,12 +198,12 @@ sysexit_from_sys_call: | |||
198 | 198 | ||
199 | #ifdef CONFIG_AUDITSYSCALL | 199 | #ifdef CONFIG_AUDITSYSCALL |
200 | .macro auditsys_entry_common | 200 | .macro auditsys_entry_common |
201 | movl %esi,%r9d /* 6th arg: 4th syscall arg */ | 201 | movl %esi,%r8d /* 5th arg: 4th syscall arg */ |
202 | movl %edx,%r8d /* 5th arg: 3rd syscall arg */ | 202 | movl %ecx,%r9d /*swap with edx*/ |
203 | /* (already in %ecx) 4th arg: 2nd syscall arg */ | 203 | movl %edx,%ecx /* 4th arg: 3rd syscall arg */ |
204 | movl %ebx,%edx /* 3rd arg: 1st syscall arg */ | 204 | movl %r9d,%edx /* 3rd arg: 2nd syscall arg */ |
205 | movl %eax,%esi /* 2nd arg: syscall number */ | 205 | movl %ebx,%esi /* 2nd arg: 1st syscall arg */ |
206 | movl $AUDIT_ARCH_I386,%edi /* 1st arg: audit arch */ | 206 | movl %eax,%edi /* 1st arg: syscall number */ |
207 | call __audit_syscall_entry | 207 | call __audit_syscall_entry |
208 | movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */ | 208 | movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */ |
209 | cmpq $(IA32_NR_syscalls-1),%rax | 209 | cmpq $(IA32_NR_syscalls-1),%rax |
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 0ec241ede5a2..9b11757975d0 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
@@ -81,24 +81,23 @@ extern u64 asmlinkage efi_call(void *fp, ...); | |||
81 | */ | 81 | */ |
82 | #define __efi_call_virt(f, args...) efi_call_virt(f, args) | 82 | #define __efi_call_virt(f, args...) efi_call_virt(f, args) |
83 | 83 | ||
84 | extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size, | 84 | extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size, |
85 | u32 type, u64 attribute); | 85 | u32 type, u64 attribute); |
86 | 86 | ||
87 | #endif /* CONFIG_X86_32 */ | 87 | #endif /* CONFIG_X86_32 */ |
88 | 88 | ||
89 | extern int add_efi_memmap; | ||
90 | extern struct efi_scratch efi_scratch; | 89 | extern struct efi_scratch efi_scratch; |
91 | extern void efi_set_executable(efi_memory_desc_t *md, bool executable); | 90 | extern void __init efi_set_executable(efi_memory_desc_t *md, bool executable); |
92 | extern int efi_memblock_x86_reserve_range(void); | 91 | extern int __init efi_memblock_x86_reserve_range(void); |
93 | extern void efi_call_phys_prelog(void); | 92 | extern void __init efi_call_phys_prolog(void); |
94 | extern void efi_call_phys_epilog(void); | 93 | extern void __init efi_call_phys_epilog(void); |
95 | extern void efi_unmap_memmap(void); | 94 | extern void __init efi_unmap_memmap(void); |
96 | extern void efi_memory_uc(u64 addr, unsigned long size); | 95 | extern void __init efi_memory_uc(u64 addr, unsigned long size); |
97 | extern void __init efi_map_region(efi_memory_desc_t *md); | 96 | extern void __init efi_map_region(efi_memory_desc_t *md); |
98 | extern void __init efi_map_region_fixed(efi_memory_desc_t *md); | 97 | extern void __init efi_map_region_fixed(efi_memory_desc_t *md); |
99 | extern void efi_sync_low_kernel_mappings(void); | 98 | extern void efi_sync_low_kernel_mappings(void); |
100 | extern int efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages); | 99 | extern int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages); |
101 | extern void efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages); | 100 | extern void __init efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages); |
102 | extern void __init old_map_region(efi_memory_desc_t *md); | 101 | extern void __init old_map_region(efi_memory_desc_t *md); |
103 | extern void __init runtime_code_page_mkexec(void); | 102 | extern void __init runtime_code_page_mkexec(void); |
104 | extern void __init efi_runtime_mkexec(void); | 103 | extern void __init efi_runtime_mkexec(void); |
@@ -162,16 +161,6 @@ static inline efi_status_t efi_thunk_set_virtual_address_map( | |||
162 | extern bool efi_reboot_required(void); | 161 | extern bool efi_reboot_required(void); |
163 | 162 | ||
164 | #else | 163 | #else |
165 | /* | ||
166 | * IF EFI is not configured, have the EFI calls return -ENOSYS. | ||
167 | */ | ||
168 | #define efi_call0(_f) (-ENOSYS) | ||
169 | #define efi_call1(_f, _a1) (-ENOSYS) | ||
170 | #define efi_call2(_f, _a1, _a2) (-ENOSYS) | ||
171 | #define efi_call3(_f, _a1, _a2, _a3) (-ENOSYS) | ||
172 | #define efi_call4(_f, _a1, _a2, _a3, _a4) (-ENOSYS) | ||
173 | #define efi_call5(_f, _a1, _a2, _a3, _a4, _a5) (-ENOSYS) | ||
174 | #define efi_call6(_f, _a1, _a2, _a3, _a4, _a5, _a6) (-ENOSYS) | ||
175 | static inline void parse_efi_setup(u64 phys_addr, u32 data_len) {} | 164 | static inline void parse_efi_setup(u64 phys_addr, u32 data_len) {} |
176 | static inline bool efi_reboot_required(void) | 165 | static inline bool efi_reboot_required(void) |
177 | { | 166 | { |
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 7d603a71ab3a..6ed0c30d6a0c 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -989,6 +989,20 @@ static inline void kvm_inject_gp(struct kvm_vcpu *vcpu, u32 error_code) | |||
989 | kvm_queue_exception_e(vcpu, GP_VECTOR, error_code); | 989 | kvm_queue_exception_e(vcpu, GP_VECTOR, error_code); |
990 | } | 990 | } |
991 | 991 | ||
992 | static inline u64 get_canonical(u64 la) | ||
993 | { | ||
994 | return ((int64_t)la << 16) >> 16; | ||
995 | } | ||
996 | |||
997 | static inline bool is_noncanonical_address(u64 la) | ||
998 | { | ||
999 | #ifdef CONFIG_X86_64 | ||
1000 | return get_canonical(la) != la; | ||
1001 | #else | ||
1002 | return false; | ||
1003 | #endif | ||
1004 | } | ||
1005 | |||
992 | #define TSS_IOPB_BASE_OFFSET 0x66 | 1006 | #define TSS_IOPB_BASE_OFFSET 0x66 |
993 | #define TSS_BASE_SIZE 0x68 | 1007 | #define TSS_BASE_SIZE 0x68 |
994 | #define TSS_IOPB_SIZE (65536 / 8) | 1008 | #define TSS_IOPB_SIZE (65536 / 8) |
@@ -1050,7 +1064,7 @@ void kvm_arch_mmu_notifier_invalidate_page(struct kvm *kvm, | |||
1050 | unsigned long address); | 1064 | unsigned long address); |
1051 | 1065 | ||
1052 | void kvm_define_shared_msr(unsigned index, u32 msr); | 1066 | void kvm_define_shared_msr(unsigned index, u32 msr); |
1053 | void kvm_set_shared_msr(unsigned index, u64 val, u64 mask); | 1067 | int kvm_set_shared_msr(unsigned index, u64 val, u64 mask); |
1054 | 1068 | ||
1055 | bool kvm_is_linear_rip(struct kvm_vcpu *vcpu, unsigned long linear_rip); | 1069 | bool kvm_is_linear_rip(struct kvm_vcpu *vcpu, unsigned long linear_rip); |
1056 | 1070 | ||
diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h index 7024c12f7bfe..400873450e33 100644 --- a/arch/x86/include/asm/preempt.h +++ b/arch/x86/include/asm/preempt.h | |||
@@ -105,6 +105,7 @@ static __always_inline bool should_resched(void) | |||
105 | # ifdef CONFIG_CONTEXT_TRACKING | 105 | # ifdef CONFIG_CONTEXT_TRACKING |
106 | extern asmlinkage void ___preempt_schedule_context(void); | 106 | extern asmlinkage void ___preempt_schedule_context(void); |
107 | # define __preempt_schedule_context() asm ("call ___preempt_schedule_context") | 107 | # define __preempt_schedule_context() asm ("call ___preempt_schedule_context") |
108 | extern asmlinkage void preempt_schedule_context(void); | ||
108 | # endif | 109 | # endif |
109 | #endif | 110 | #endif |
110 | 111 | ||
diff --git a/arch/x86/include/uapi/asm/vmx.h b/arch/x86/include/uapi/asm/vmx.h index 0e79420376eb..990a2fe1588d 100644 --- a/arch/x86/include/uapi/asm/vmx.h +++ b/arch/x86/include/uapi/asm/vmx.h | |||
@@ -67,6 +67,7 @@ | |||
67 | #define EXIT_REASON_EPT_MISCONFIG 49 | 67 | #define EXIT_REASON_EPT_MISCONFIG 49 |
68 | #define EXIT_REASON_INVEPT 50 | 68 | #define EXIT_REASON_INVEPT 50 |
69 | #define EXIT_REASON_PREEMPTION_TIMER 52 | 69 | #define EXIT_REASON_PREEMPTION_TIMER 52 |
70 | #define EXIT_REASON_INVVPID 53 | ||
70 | #define EXIT_REASON_WBINVD 54 | 71 | #define EXIT_REASON_WBINVD 54 |
71 | #define EXIT_REASON_XSETBV 55 | 72 | #define EXIT_REASON_XSETBV 55 |
72 | #define EXIT_REASON_APIC_WRITE 56 | 73 | #define EXIT_REASON_APIC_WRITE 56 |
@@ -114,6 +115,7 @@ | |||
114 | { EXIT_REASON_EOI_INDUCED, "EOI_INDUCED" }, \ | 115 | { EXIT_REASON_EOI_INDUCED, "EOI_INDUCED" }, \ |
115 | { EXIT_REASON_INVALID_STATE, "INVALID_STATE" }, \ | 116 | { EXIT_REASON_INVALID_STATE, "INVALID_STATE" }, \ |
116 | { EXIT_REASON_INVD, "INVD" }, \ | 117 | { EXIT_REASON_INVD, "INVD" }, \ |
118 | { EXIT_REASON_INVVPID, "INVVPID" }, \ | ||
117 | { EXIT_REASON_INVPCID, "INVPCID" } | 119 | { EXIT_REASON_INVPCID, "INVPCID" } |
118 | 120 | ||
119 | #endif /* _UAPIVMX_H */ | 121 | #endif /* _UAPIVMX_H */ |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index b436fc735aa4..a142e77693e1 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -397,7 +397,7 @@ static int mp_register_gsi(struct device *dev, u32 gsi, int trigger, | |||
397 | 397 | ||
398 | /* Don't set up the ACPI SCI because it's already set up */ | 398 | /* Don't set up the ACPI SCI because it's already set up */ |
399 | if (acpi_gbl_FADT.sci_interrupt == gsi) | 399 | if (acpi_gbl_FADT.sci_interrupt == gsi) |
400 | return gsi; | 400 | return mp_map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC); |
401 | 401 | ||
402 | trigger = trigger == ACPI_EDGE_SENSITIVE ? 0 : 1; | 402 | trigger = trigger == ACPI_EDGE_SENSITIVE ? 0 : 1; |
403 | polarity = polarity == ACPI_ACTIVE_HIGH ? 0 : 1; | 403 | polarity = polarity == ACPI_ACTIVE_HIGH ? 0 : 1; |
@@ -604,14 +604,18 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger) | |||
604 | 604 | ||
605 | int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp) | 605 | int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp) |
606 | { | 606 | { |
607 | int irq = mp_map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK); | 607 | int irq; |
608 | 608 | ||
609 | if (irq >= 0) { | 609 | if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) { |
610 | *irqp = gsi; | ||
611 | } else { | ||
612 | irq = mp_map_gsi_to_irq(gsi, | ||
613 | IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK); | ||
614 | if (irq < 0) | ||
615 | return -1; | ||
610 | *irqp = irq; | 616 | *irqp = irq; |
611 | return 0; | ||
612 | } | 617 | } |
613 | 618 | return 0; | |
614 | return -1; | ||
615 | } | 619 | } |
616 | EXPORT_SYMBOL_GPL(acpi_gsi_to_irq); | 620 | EXPORT_SYMBOL_GPL(acpi_gsi_to_irq); |
617 | 621 | ||
diff --git a/arch/x86/kernel/apb_timer.c b/arch/x86/kernel/apb_timer.c index 5972b108f15a..b708738d016e 100644 --- a/arch/x86/kernel/apb_timer.c +++ b/arch/x86/kernel/apb_timer.c | |||
@@ -185,8 +185,6 @@ static void apbt_setup_irq(struct apbt_dev *adev) | |||
185 | 185 | ||
186 | irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT); | 186 | irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT); |
187 | irq_set_affinity(adev->irq, cpumask_of(adev->cpu)); | 187 | irq_set_affinity(adev->irq, cpumask_of(adev->cpu)); |
188 | /* APB timer irqs are set up as mp_irqs, timer is edge type */ | ||
189 | __irq_set_handler(adev->irq, handle_edge_irq, 0, "edge"); | ||
190 | } | 188 | } |
191 | 189 | ||
192 | /* Should be called with per cpu */ | 190 | /* Should be called with per cpu */ |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 00853b254ab0..ba6cc041edb1 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -1297,7 +1297,7 @@ void setup_local_APIC(void) | |||
1297 | unsigned int value, queued; | 1297 | unsigned int value, queued; |
1298 | int i, j, acked = 0; | 1298 | int i, j, acked = 0; |
1299 | unsigned long long tsc = 0, ntsc; | 1299 | unsigned long long tsc = 0, ntsc; |
1300 | long long max_loops = cpu_khz; | 1300 | long long max_loops = cpu_khz ? cpu_khz : 1000000; |
1301 | 1301 | ||
1302 | if (cpu_has_tsc) | 1302 | if (cpu_has_tsc) |
1303 | rdtscll(tsc); | 1303 | rdtscll(tsc); |
@@ -1383,7 +1383,7 @@ void setup_local_APIC(void) | |||
1383 | break; | 1383 | break; |
1384 | } | 1384 | } |
1385 | if (queued) { | 1385 | if (queued) { |
1386 | if (cpu_has_tsc) { | 1386 | if (cpu_has_tsc && cpu_khz) { |
1387 | rdtscll(ntsc); | 1387 | rdtscll(ntsc); |
1388 | max_loops = (cpu_khz << 10) - (ntsc - tsc); | 1388 | max_loops = (cpu_khz << 10) - (ntsc - tsc); |
1389 | } else | 1389 | } else |
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile index 01d5453b5502..e27b49d7c922 100644 --- a/arch/x86/kernel/cpu/Makefile +++ b/arch/x86/kernel/cpu/Makefile | |||
@@ -39,9 +39,12 @@ obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd_iommu.o | |||
39 | endif | 39 | endif |
40 | obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_p6.o perf_event_knc.o perf_event_p4.o | 40 | obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_p6.o perf_event_knc.o perf_event_p4.o |
41 | obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_lbr.o perf_event_intel_ds.o perf_event_intel.o | 41 | obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_lbr.o perf_event_intel_ds.o perf_event_intel.o |
42 | obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_uncore.o perf_event_intel_uncore_snb.o | ||
43 | obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_uncore_snbep.o perf_event_intel_uncore_nhmex.o | ||
44 | obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_rapl.o | 42 | obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_rapl.o |
43 | |||
44 | obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE) += perf_event_intel_uncore.o \ | ||
45 | perf_event_intel_uncore_snb.o \ | ||
46 | perf_event_intel_uncore_snbep.o \ | ||
47 | perf_event_intel_uncore_nhmex.o | ||
45 | endif | 48 | endif |
46 | 49 | ||
47 | 50 | ||
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 1ef456273172..9cc6b6f25f42 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
@@ -213,12 +213,13 @@ static void intel_workarounds(struct cpuinfo_x86 *c) | |||
213 | { | 213 | { |
214 | #ifdef CONFIG_X86_F00F_BUG | 214 | #ifdef CONFIG_X86_F00F_BUG |
215 | /* | 215 | /* |
216 | * All current models of Pentium and Pentium with MMX technology CPUs | 216 | * All models of Pentium and Pentium with MMX technology CPUs |
217 | * have the F0 0F bug, which lets nonprivileged users lock up the | 217 | * have the F0 0F bug, which lets nonprivileged users lock up the |
218 | * system. Announce that the fault handler will be checking for it. | 218 | * system. Announce that the fault handler will be checking for it. |
219 | * The Quark is also family 5, but does not have the same bug. | ||
219 | */ | 220 | */ |
220 | clear_cpu_bug(c, X86_BUG_F00F); | 221 | clear_cpu_bug(c, X86_BUG_F00F); |
221 | if (!paravirt_enabled() && c->x86 == 5) { | 222 | if (!paravirt_enabled() && c->x86 == 5 && c->x86_model < 9) { |
222 | static int f00f_workaround_enabled; | 223 | static int f00f_workaround_enabled; |
223 | 224 | ||
224 | set_cpu_bug(c, X86_BUG_F00F); | 225 | set_cpu_bug(c, X86_BUG_F00F); |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 1b8299dd3d91..143e5f5dc855 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -243,8 +243,9 @@ static bool check_hw_exists(void) | |||
243 | 243 | ||
244 | msr_fail: | 244 | msr_fail: |
245 | printk(KERN_CONT "Broken PMU hardware detected, using software events only.\n"); | 245 | printk(KERN_CONT "Broken PMU hardware detected, using software events only.\n"); |
246 | printk(boot_cpu_has(X86_FEATURE_HYPERVISOR) ? KERN_INFO : KERN_ERR | 246 | printk("%sFailed to access perfctr msr (MSR %x is %Lx)\n", |
247 | "Failed to access perfctr msr (MSR %x is %Lx)\n", reg, val_new); | 247 | boot_cpu_has(X86_FEATURE_HYPERVISOR) ? KERN_INFO : KERN_ERR, |
248 | reg, val_new); | ||
248 | 249 | ||
249 | return false; | 250 | return false; |
250 | } | 251 | } |
@@ -444,12 +445,6 @@ int x86_pmu_hw_config(struct perf_event *event) | |||
444 | if (event->attr.type == PERF_TYPE_RAW) | 445 | if (event->attr.type == PERF_TYPE_RAW) |
445 | event->hw.config |= event->attr.config & X86_RAW_EVENT_MASK; | 446 | event->hw.config |= event->attr.config & X86_RAW_EVENT_MASK; |
446 | 447 | ||
447 | if (event->attr.sample_period && x86_pmu.limit_period) { | ||
448 | if (x86_pmu.limit_period(event, event->attr.sample_period) > | ||
449 | event->attr.sample_period) | ||
450 | return -EINVAL; | ||
451 | } | ||
452 | |||
453 | return x86_setup_perfctr(event); | 448 | return x86_setup_perfctr(event); |
454 | } | 449 | } |
455 | 450 | ||
@@ -987,9 +982,6 @@ int x86_perf_event_set_period(struct perf_event *event) | |||
987 | if (left > x86_pmu.max_period) | 982 | if (left > x86_pmu.max_period) |
988 | left = x86_pmu.max_period; | 983 | left = x86_pmu.max_period; |
989 | 984 | ||
990 | if (x86_pmu.limit_period) | ||
991 | left = x86_pmu.limit_period(event, left); | ||
992 | |||
993 | per_cpu(pmc_prev_left[idx], smp_processor_id()) = left; | 985 | per_cpu(pmc_prev_left[idx], smp_processor_id()) = left; |
994 | 986 | ||
995 | /* | 987 | /* |
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h index d98a34d435d7..fc5eb390b368 100644 --- a/arch/x86/kernel/cpu/perf_event.h +++ b/arch/x86/kernel/cpu/perf_event.h | |||
@@ -445,7 +445,6 @@ struct x86_pmu { | |||
445 | struct x86_pmu_quirk *quirks; | 445 | struct x86_pmu_quirk *quirks; |
446 | int perfctr_second_write; | 446 | int perfctr_second_write; |
447 | bool late_ack; | 447 | bool late_ack; |
448 | unsigned (*limit_period)(struct perf_event *event, unsigned l); | ||
449 | 448 | ||
450 | /* | 449 | /* |
451 | * sysfs attrs | 450 | * sysfs attrs |
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index a73947c53b65..944bf019b74f 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
@@ -220,15 +220,6 @@ static struct event_constraint intel_hsw_event_constraints[] = { | |||
220 | EVENT_CONSTRAINT_END | 220 | EVENT_CONSTRAINT_END |
221 | }; | 221 | }; |
222 | 222 | ||
223 | static struct event_constraint intel_bdw_event_constraints[] = { | ||
224 | FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */ | ||
225 | FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */ | ||
226 | FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */ | ||
227 | INTEL_UEVENT_CONSTRAINT(0x148, 0x4), /* L1D_PEND_MISS.PENDING */ | ||
228 | INTEL_EVENT_CONSTRAINT(0xa3, 0x4), /* CYCLE_ACTIVITY.* */ | ||
229 | EVENT_CONSTRAINT_END | ||
230 | }; | ||
231 | |||
232 | static u64 intel_pmu_event_map(int hw_event) | 223 | static u64 intel_pmu_event_map(int hw_event) |
233 | { | 224 | { |
234 | return intel_perfmon_event_map[hw_event]; | 225 | return intel_perfmon_event_map[hw_event]; |
@@ -424,126 +415,6 @@ static __initconst const u64 snb_hw_cache_event_ids | |||
424 | 415 | ||
425 | }; | 416 | }; |
426 | 417 | ||
427 | static __initconst const u64 hsw_hw_cache_event_ids | ||
428 | [PERF_COUNT_HW_CACHE_MAX] | ||
429 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
430 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = | ||
431 | { | ||
432 | [ C(L1D ) ] = { | ||
433 | [ C(OP_READ) ] = { | ||
434 | [ C(RESULT_ACCESS) ] = 0x81d0, /* MEM_UOPS_RETIRED.ALL_LOADS */ | ||
435 | [ C(RESULT_MISS) ] = 0x151, /* L1D.REPLACEMENT */ | ||
436 | }, | ||
437 | [ C(OP_WRITE) ] = { | ||
438 | [ C(RESULT_ACCESS) ] = 0x82d0, /* MEM_UOPS_RETIRED.ALL_STORES */ | ||
439 | [ C(RESULT_MISS) ] = 0x0, | ||
440 | }, | ||
441 | [ C(OP_PREFETCH) ] = { | ||
442 | [ C(RESULT_ACCESS) ] = 0x0, | ||
443 | [ C(RESULT_MISS) ] = 0x0, | ||
444 | }, | ||
445 | }, | ||
446 | [ C(L1I ) ] = { | ||
447 | [ C(OP_READ) ] = { | ||
448 | [ C(RESULT_ACCESS) ] = 0x0, | ||
449 | [ C(RESULT_MISS) ] = 0x280, /* ICACHE.MISSES */ | ||
450 | }, | ||
451 | [ C(OP_WRITE) ] = { | ||
452 | [ C(RESULT_ACCESS) ] = -1, | ||
453 | [ C(RESULT_MISS) ] = -1, | ||
454 | }, | ||
455 | [ C(OP_PREFETCH) ] = { | ||
456 | [ C(RESULT_ACCESS) ] = 0x0, | ||
457 | [ C(RESULT_MISS) ] = 0x0, | ||
458 | }, | ||
459 | }, | ||
460 | [ C(LL ) ] = { | ||
461 | [ C(OP_READ) ] = { | ||
462 | /* OFFCORE_RESPONSE:ALL_DATA_RD|ALL_CODE_RD */ | ||
463 | [ C(RESULT_ACCESS) ] = 0x1b7, | ||
464 | /* OFFCORE_RESPONSE:ALL_DATA_RD|ALL_CODE_RD|SUPPLIER_NONE| | ||
465 | L3_MISS|ANY_SNOOP */ | ||
466 | [ C(RESULT_MISS) ] = 0x1b7, | ||
467 | }, | ||
468 | [ C(OP_WRITE) ] = { | ||
469 | [ C(RESULT_ACCESS) ] = 0x1b7, /* OFFCORE_RESPONSE:ALL_RFO */ | ||
470 | /* OFFCORE_RESPONSE:ALL_RFO|SUPPLIER_NONE|L3_MISS|ANY_SNOOP */ | ||
471 | [ C(RESULT_MISS) ] = 0x1b7, | ||
472 | }, | ||
473 | [ C(OP_PREFETCH) ] = { | ||
474 | [ C(RESULT_ACCESS) ] = 0x0, | ||
475 | [ C(RESULT_MISS) ] = 0x0, | ||
476 | }, | ||
477 | }, | ||
478 | [ C(DTLB) ] = { | ||
479 | [ C(OP_READ) ] = { | ||
480 | [ C(RESULT_ACCESS) ] = 0x81d0, /* MEM_UOPS_RETIRED.ALL_LOADS */ | ||
481 | [ C(RESULT_MISS) ] = 0x108, /* DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK */ | ||
482 | }, | ||
483 | [ C(OP_WRITE) ] = { | ||
484 | [ C(RESULT_ACCESS) ] = 0x82d0, /* MEM_UOPS_RETIRED.ALL_STORES */ | ||
485 | [ C(RESULT_MISS) ] = 0x149, /* DTLB_STORE_MISSES.MISS_CAUSES_A_WALK */ | ||
486 | }, | ||
487 | [ C(OP_PREFETCH) ] = { | ||
488 | [ C(RESULT_ACCESS) ] = 0x0, | ||
489 | [ C(RESULT_MISS) ] = 0x0, | ||
490 | }, | ||
491 | }, | ||
492 | [ C(ITLB) ] = { | ||
493 | [ C(OP_READ) ] = { | ||
494 | [ C(RESULT_ACCESS) ] = 0x6085, /* ITLB_MISSES.STLB_HIT */ | ||
495 | [ C(RESULT_MISS) ] = 0x185, /* ITLB_MISSES.MISS_CAUSES_A_WALK */ | ||
496 | }, | ||
497 | [ C(OP_WRITE) ] = { | ||
498 | [ C(RESULT_ACCESS) ] = -1, | ||
499 | [ C(RESULT_MISS) ] = -1, | ||
500 | }, | ||
501 | [ C(OP_PREFETCH) ] = { | ||
502 | [ C(RESULT_ACCESS) ] = -1, | ||
503 | [ C(RESULT_MISS) ] = -1, | ||
504 | }, | ||
505 | }, | ||
506 | [ C(BPU ) ] = { | ||
507 | [ C(OP_READ) ] = { | ||
508 | [ C(RESULT_ACCESS) ] = 0xc4, /* BR_INST_RETIRED.ALL_BRANCHES */ | ||
509 | [ C(RESULT_MISS) ] = 0xc5, /* BR_MISP_RETIRED.ALL_BRANCHES */ | ||
510 | }, | ||
511 | [ C(OP_WRITE) ] = { | ||
512 | [ C(RESULT_ACCESS) ] = -1, | ||
513 | [ C(RESULT_MISS) ] = -1, | ||
514 | }, | ||
515 | [ C(OP_PREFETCH) ] = { | ||
516 | [ C(RESULT_ACCESS) ] = -1, | ||
517 | [ C(RESULT_MISS) ] = -1, | ||
518 | }, | ||
519 | }, | ||
520 | }; | ||
521 | |||
522 | static __initconst const u64 hsw_hw_cache_extra_regs | ||
523 | [PERF_COUNT_HW_CACHE_MAX] | ||
524 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
525 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = | ||
526 | { | ||
527 | [ C(LL ) ] = { | ||
528 | [ C(OP_READ) ] = { | ||
529 | /* OFFCORE_RESPONSE:ALL_DATA_RD|ALL_CODE_RD */ | ||
530 | [ C(RESULT_ACCESS) ] = 0x2d5, | ||
531 | /* OFFCORE_RESPONSE:ALL_DATA_RD|ALL_CODE_RD|SUPPLIER_NONE| | ||
532 | L3_MISS|ANY_SNOOP */ | ||
533 | [ C(RESULT_MISS) ] = 0x3fbc0202d5ull, | ||
534 | }, | ||
535 | [ C(OP_WRITE) ] = { | ||
536 | [ C(RESULT_ACCESS) ] = 0x122, /* OFFCORE_RESPONSE:ALL_RFO */ | ||
537 | /* OFFCORE_RESPONSE:ALL_RFO|SUPPLIER_NONE|L3_MISS|ANY_SNOOP */ | ||
538 | [ C(RESULT_MISS) ] = 0x3fbc020122ull, | ||
539 | }, | ||
540 | [ C(OP_PREFETCH) ] = { | ||
541 | [ C(RESULT_ACCESS) ] = 0x0, | ||
542 | [ C(RESULT_MISS) ] = 0x0, | ||
543 | }, | ||
544 | }, | ||
545 | }; | ||
546 | |||
547 | static __initconst const u64 westmere_hw_cache_event_ids | 418 | static __initconst const u64 westmere_hw_cache_event_ids |
548 | [PERF_COUNT_HW_CACHE_MAX] | 419 | [PERF_COUNT_HW_CACHE_MAX] |
549 | [PERF_COUNT_HW_CACHE_OP_MAX] | 420 | [PERF_COUNT_HW_CACHE_OP_MAX] |
@@ -2034,24 +1905,6 @@ hsw_get_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event) | |||
2034 | return c; | 1905 | return c; |
2035 | } | 1906 | } |
2036 | 1907 | ||
2037 | /* | ||
2038 | * Broadwell: | ||
2039 | * The INST_RETIRED.ALL period always needs to have lowest | ||
2040 | * 6bits cleared (BDM57). It shall not use a period smaller | ||
2041 | * than 100 (BDM11). We combine the two to enforce | ||
2042 | * a min-period of 128. | ||
2043 | */ | ||
2044 | static unsigned bdw_limit_period(struct perf_event *event, unsigned left) | ||
2045 | { | ||
2046 | if ((event->hw.config & INTEL_ARCH_EVENT_MASK) == | ||
2047 | X86_CONFIG(.event=0xc0, .umask=0x01)) { | ||
2048 | if (left < 128) | ||
2049 | left = 128; | ||
2050 | left &= ~0x3fu; | ||
2051 | } | ||
2052 | return left; | ||
2053 | } | ||
2054 | |||
2055 | PMU_FORMAT_ATTR(event, "config:0-7" ); | 1908 | PMU_FORMAT_ATTR(event, "config:0-7" ); |
2056 | PMU_FORMAT_ATTR(umask, "config:8-15" ); | 1909 | PMU_FORMAT_ATTR(umask, "config:8-15" ); |
2057 | PMU_FORMAT_ATTR(edge, "config:18" ); | 1910 | PMU_FORMAT_ATTR(edge, "config:18" ); |
@@ -2692,8 +2545,8 @@ __init int intel_pmu_init(void) | |||
2692 | case 69: /* 22nm Haswell ULT */ | 2545 | case 69: /* 22nm Haswell ULT */ |
2693 | case 70: /* 22nm Haswell + GT3e (Intel Iris Pro graphics) */ | 2546 | case 70: /* 22nm Haswell + GT3e (Intel Iris Pro graphics) */ |
2694 | x86_pmu.late_ack = true; | 2547 | x86_pmu.late_ack = true; |
2695 | memcpy(hw_cache_event_ids, hsw_hw_cache_event_ids, sizeof(hw_cache_event_ids)); | 2548 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, sizeof(hw_cache_event_ids)); |
2696 | memcpy(hw_cache_extra_regs, hsw_hw_cache_extra_regs, sizeof(hw_cache_extra_regs)); | 2549 | memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs, sizeof(hw_cache_extra_regs)); |
2697 | 2550 | ||
2698 | intel_pmu_lbr_init_snb(); | 2551 | intel_pmu_lbr_init_snb(); |
2699 | 2552 | ||
@@ -2712,28 +2565,6 @@ __init int intel_pmu_init(void) | |||
2712 | pr_cont("Haswell events, "); | 2565 | pr_cont("Haswell events, "); |
2713 | break; | 2566 | break; |
2714 | 2567 | ||
2715 | case 61: /* 14nm Broadwell Core-M */ | ||
2716 | x86_pmu.late_ack = true; | ||
2717 | memcpy(hw_cache_event_ids, hsw_hw_cache_event_ids, sizeof(hw_cache_event_ids)); | ||
2718 | memcpy(hw_cache_extra_regs, hsw_hw_cache_extra_regs, sizeof(hw_cache_extra_regs)); | ||
2719 | |||
2720 | intel_pmu_lbr_init_snb(); | ||
2721 | |||
2722 | x86_pmu.event_constraints = intel_bdw_event_constraints; | ||
2723 | x86_pmu.pebs_constraints = intel_hsw_pebs_event_constraints; | ||
2724 | x86_pmu.extra_regs = intel_snbep_extra_regs; | ||
2725 | x86_pmu.pebs_aliases = intel_pebs_aliases_snb; | ||
2726 | /* all extra regs are per-cpu when HT is on */ | ||
2727 | x86_pmu.er_flags |= ERF_HAS_RSP_1; | ||
2728 | x86_pmu.er_flags |= ERF_NO_HT_SHARING; | ||
2729 | |||
2730 | x86_pmu.hw_config = hsw_hw_config; | ||
2731 | x86_pmu.get_event_constraints = hsw_get_event_constraints; | ||
2732 | x86_pmu.cpu_events = hsw_events_attrs; | ||
2733 | x86_pmu.limit_period = bdw_limit_period; | ||
2734 | pr_cont("Broadwell events, "); | ||
2735 | break; | ||
2736 | |||
2737 | default: | 2568 | default: |
2738 | switch (x86_pmu.version) { | 2569 | switch (x86_pmu.version) { |
2739 | case 1: | 2570 | case 1: |
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 4b0e1dfa2226..344b63f18d14 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -447,16 +447,14 @@ sysenter_exit: | |||
447 | sysenter_audit: | 447 | sysenter_audit: |
448 | testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%ebp) | 448 | testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%ebp) |
449 | jnz syscall_trace_entry | 449 | jnz syscall_trace_entry |
450 | addl $4,%esp | 450 | /* movl PT_EAX(%esp), %eax already set, syscall number: 1st arg to audit */ |
451 | CFI_ADJUST_CFA_OFFSET -4 | 451 | movl PT_EBX(%esp), %edx /* ebx/a0: 2nd arg to audit */ |
452 | /* %esi already in 8(%esp) 6th arg: 4th syscall arg */ | 452 | /* movl PT_ECX(%esp), %ecx already set, a1: 3nd arg to audit */ |
453 | /* %edx already in 4(%esp) 5th arg: 3rd syscall arg */ | 453 | pushl_cfi PT_ESI(%esp) /* a3: 5th arg */ |
454 | /* %ecx already in 0(%esp) 4th arg: 2nd syscall arg */ | 454 | pushl_cfi PT_EDX+4(%esp) /* a2: 4th arg */ |
455 | movl %ebx,%ecx /* 3rd arg: 1st syscall arg */ | ||
456 | movl %eax,%edx /* 2nd arg: syscall number */ | ||
457 | movl $AUDIT_ARCH_I386,%eax /* 1st arg: audit arch */ | ||
458 | call __audit_syscall_entry | 455 | call __audit_syscall_entry |
459 | pushl_cfi %ebx | 456 | popl_cfi %ecx /* get that remapped edx off the stack */ |
457 | popl_cfi %ecx /* get that remapped esi off the stack */ | ||
460 | movl PT_EAX(%esp),%eax /* reload syscall number */ | 458 | movl PT_EAX(%esp),%eax /* reload syscall number */ |
461 | jmp sysenter_do_call | 459 | jmp sysenter_do_call |
462 | 460 | ||
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c index 8af817105e29..e7cc5370cd2f 100644 --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c | |||
@@ -111,8 +111,7 @@ static void make_8259A_irq(unsigned int irq) | |||
111 | { | 111 | { |
112 | disable_irq_nosync(irq); | 112 | disable_irq_nosync(irq); |
113 | io_apic_irqs &= ~(1<<irq); | 113 | io_apic_irqs &= ~(1<<irq); |
114 | irq_set_chip_and_handler_name(irq, &i8259A_chip, handle_level_irq, | 114 | irq_set_chip_and_handler(irq, &i8259A_chip, handle_level_irq); |
115 | i8259A_chip.name); | ||
116 | enable_irq(irq); | 115 | enable_irq(irq); |
117 | } | 116 | } |
118 | 117 | ||
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c index 44f1ed42fdf2..4de73ee78361 100644 --- a/arch/x86/kernel/irqinit.c +++ b/arch/x86/kernel/irqinit.c | |||
@@ -70,7 +70,6 @@ int vector_used_by_percpu_irq(unsigned int vector) | |||
70 | void __init init_ISA_irqs(void) | 70 | void __init init_ISA_irqs(void) |
71 | { | 71 | { |
72 | struct irq_chip *chip = legacy_pic->chip; | 72 | struct irq_chip *chip = legacy_pic->chip; |
73 | const char *name = chip->name; | ||
74 | int i; | 73 | int i; |
75 | 74 | ||
76 | #if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC) | 75 | #if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC) |
@@ -79,7 +78,7 @@ void __init init_ISA_irqs(void) | |||
79 | legacy_pic->init(0); | 78 | legacy_pic->init(0); |
80 | 79 | ||
81 | for (i = 0; i < nr_legacy_irqs(); i++) | 80 | for (i = 0; i < nr_legacy_irqs(); i++) |
82 | irq_set_chip_and_handler_name(i, chip, handle_level_irq, name); | 81 | irq_set_chip_and_handler(i, chip, handle_level_irq); |
83 | } | 82 | } |
84 | 83 | ||
85 | void __init init_IRQ(void) | 84 | void __init init_IRQ(void) |
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 29576c244699..749b0e423419 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -1445,12 +1445,12 @@ static void do_audit_syscall_entry(struct pt_regs *regs, u32 arch) | |||
1445 | { | 1445 | { |
1446 | #ifdef CONFIG_X86_64 | 1446 | #ifdef CONFIG_X86_64 |
1447 | if (arch == AUDIT_ARCH_X86_64) { | 1447 | if (arch == AUDIT_ARCH_X86_64) { |
1448 | audit_syscall_entry(arch, regs->orig_ax, regs->di, | 1448 | audit_syscall_entry(regs->orig_ax, regs->di, |
1449 | regs->si, regs->dx, regs->r10); | 1449 | regs->si, regs->dx, regs->r10); |
1450 | } else | 1450 | } else |
1451 | #endif | 1451 | #endif |
1452 | { | 1452 | { |
1453 | audit_syscall_entry(arch, regs->orig_ax, regs->bx, | 1453 | audit_syscall_entry(regs->orig_ax, regs->bx, |
1454 | regs->cx, regs->dx, regs->si); | 1454 | regs->cx, regs->dx, regs->si); |
1455 | } | 1455 | } |
1456 | } | 1456 | } |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 235cfd39e0d7..ab08aa2276fb 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -1128,7 +1128,6 @@ void __init setup_arch(char **cmdline_p) | |||
1128 | setup_real_mode(); | 1128 | setup_real_mode(); |
1129 | 1129 | ||
1130 | memblock_set_current_limit(get_max_mapped()); | 1130 | memblock_set_current_limit(get_max_mapped()); |
1131 | dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT); | ||
1132 | 1131 | ||
1133 | /* | 1132 | /* |
1134 | * NOTE: On x86-32, only from this point on, fixmaps are ready for use. | 1133 | * NOTE: On x86-32, only from this point on, fixmaps are ready for use. |
@@ -1159,6 +1158,7 @@ void __init setup_arch(char **cmdline_p) | |||
1159 | early_acpi_boot_init(); | 1158 | early_acpi_boot_init(); |
1160 | 1159 | ||
1161 | initmem_init(); | 1160 | initmem_init(); |
1161 | dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT); | ||
1162 | 1162 | ||
1163 | /* | 1163 | /* |
1164 | * Reserve memory for crash kernel after SRAT is parsed so that it | 1164 | * Reserve memory for crash kernel after SRAT is parsed so that it |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 2d5200e56357..4d2128ac70bd 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -102,8 +102,6 @@ DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_llc_shared_map); | |||
102 | DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); | 102 | DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); |
103 | EXPORT_PER_CPU_SYMBOL(cpu_info); | 103 | EXPORT_PER_CPU_SYMBOL(cpu_info); |
104 | 104 | ||
105 | static DEFINE_PER_CPU(struct completion, die_complete); | ||
106 | |||
107 | atomic_t init_deasserted; | 105 | atomic_t init_deasserted; |
108 | 106 | ||
109 | /* | 107 | /* |
@@ -1318,6 +1316,8 @@ void cpu_disable_common(void) | |||
1318 | fixup_irqs(); | 1316 | fixup_irqs(); |
1319 | } | 1317 | } |
1320 | 1318 | ||
1319 | static DEFINE_PER_CPU(struct completion, die_complete); | ||
1320 | |||
1321 | int native_cpu_disable(void) | 1321 | int native_cpu_disable(void) |
1322 | { | 1322 | { |
1323 | int ret; | 1323 | int ret; |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index b6025f9e36c6..b7e50bba3bbb 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
@@ -1166,14 +1166,17 @@ void __init tsc_init(void) | |||
1166 | 1166 | ||
1167 | x86_init.timers.tsc_pre_init(); | 1167 | x86_init.timers.tsc_pre_init(); |
1168 | 1168 | ||
1169 | if (!cpu_has_tsc) | 1169 | if (!cpu_has_tsc) { |
1170 | setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER); | ||
1170 | return; | 1171 | return; |
1172 | } | ||
1171 | 1173 | ||
1172 | tsc_khz = x86_platform.calibrate_tsc(); | 1174 | tsc_khz = x86_platform.calibrate_tsc(); |
1173 | cpu_khz = tsc_khz; | 1175 | cpu_khz = tsc_khz; |
1174 | 1176 | ||
1175 | if (!tsc_khz) { | 1177 | if (!tsc_khz) { |
1176 | mark_tsc_unstable("could not calculate TSC khz"); | 1178 | mark_tsc_unstable("could not calculate TSC khz"); |
1179 | setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER); | ||
1177 | return; | 1180 | return; |
1178 | } | 1181 | } |
1179 | 1182 | ||
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index a46207a05835..749f9fa38254 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -504,11 +504,6 @@ static void rsp_increment(struct x86_emulate_ctxt *ctxt, int inc) | |||
504 | masked_increment(reg_rmw(ctxt, VCPU_REGS_RSP), stack_mask(ctxt), inc); | 504 | masked_increment(reg_rmw(ctxt, VCPU_REGS_RSP), stack_mask(ctxt), inc); |
505 | } | 505 | } |
506 | 506 | ||
507 | static inline void jmp_rel(struct x86_emulate_ctxt *ctxt, int rel) | ||
508 | { | ||
509 | register_address_increment(ctxt, &ctxt->_eip, rel); | ||
510 | } | ||
511 | |||
512 | static u32 desc_limit_scaled(struct desc_struct *desc) | 507 | static u32 desc_limit_scaled(struct desc_struct *desc) |
513 | { | 508 | { |
514 | u32 limit = get_desc_limit(desc); | 509 | u32 limit = get_desc_limit(desc); |
@@ -569,6 +564,38 @@ static int emulate_nm(struct x86_emulate_ctxt *ctxt) | |||
569 | return emulate_exception(ctxt, NM_VECTOR, 0, false); | 564 | return emulate_exception(ctxt, NM_VECTOR, 0, false); |
570 | } | 565 | } |
571 | 566 | ||
567 | static inline int assign_eip_far(struct x86_emulate_ctxt *ctxt, ulong dst, | ||
568 | int cs_l) | ||
569 | { | ||
570 | switch (ctxt->op_bytes) { | ||
571 | case 2: | ||
572 | ctxt->_eip = (u16)dst; | ||
573 | break; | ||
574 | case 4: | ||
575 | ctxt->_eip = (u32)dst; | ||
576 | break; | ||
577 | case 8: | ||
578 | if ((cs_l && is_noncanonical_address(dst)) || | ||
579 | (!cs_l && (dst & ~(u32)-1))) | ||
580 | return emulate_gp(ctxt, 0); | ||
581 | ctxt->_eip = dst; | ||
582 | break; | ||
583 | default: | ||
584 | WARN(1, "unsupported eip assignment size\n"); | ||
585 | } | ||
586 | return X86EMUL_CONTINUE; | ||
587 | } | ||
588 | |||
589 | static inline int assign_eip_near(struct x86_emulate_ctxt *ctxt, ulong dst) | ||
590 | { | ||
591 | return assign_eip_far(ctxt, dst, ctxt->mode == X86EMUL_MODE_PROT64); | ||
592 | } | ||
593 | |||
594 | static inline int jmp_rel(struct x86_emulate_ctxt *ctxt, int rel) | ||
595 | { | ||
596 | return assign_eip_near(ctxt, ctxt->_eip + rel); | ||
597 | } | ||
598 | |||
572 | static u16 get_segment_selector(struct x86_emulate_ctxt *ctxt, unsigned seg) | 599 | static u16 get_segment_selector(struct x86_emulate_ctxt *ctxt, unsigned seg) |
573 | { | 600 | { |
574 | u16 selector; | 601 | u16 selector; |
@@ -751,8 +778,10 @@ static int __do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, int op_size) | |||
751 | static __always_inline int do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, | 778 | static __always_inline int do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, |
752 | unsigned size) | 779 | unsigned size) |
753 | { | 780 | { |
754 | if (unlikely(ctxt->fetch.end - ctxt->fetch.ptr < size)) | 781 | unsigned done_size = ctxt->fetch.end - ctxt->fetch.ptr; |
755 | return __do_insn_fetch_bytes(ctxt, size); | 782 | |
783 | if (unlikely(done_size < size)) | ||
784 | return __do_insn_fetch_bytes(ctxt, size - done_size); | ||
756 | else | 785 | else |
757 | return X86EMUL_CONTINUE; | 786 | return X86EMUL_CONTINUE; |
758 | } | 787 | } |
@@ -1416,7 +1445,9 @@ static int write_segment_descriptor(struct x86_emulate_ctxt *ctxt, | |||
1416 | 1445 | ||
1417 | /* Does not support long mode */ | 1446 | /* Does not support long mode */ |
1418 | static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt, | 1447 | static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt, |
1419 | u16 selector, int seg, u8 cpl, bool in_task_switch) | 1448 | u16 selector, int seg, u8 cpl, |
1449 | bool in_task_switch, | ||
1450 | struct desc_struct *desc) | ||
1420 | { | 1451 | { |
1421 | struct desc_struct seg_desc, old_desc; | 1452 | struct desc_struct seg_desc, old_desc; |
1422 | u8 dpl, rpl; | 1453 | u8 dpl, rpl; |
@@ -1557,6 +1588,8 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt, | |||
1557 | } | 1588 | } |
1558 | load: | 1589 | load: |
1559 | ctxt->ops->set_segment(ctxt, selector, &seg_desc, base3, seg); | 1590 | ctxt->ops->set_segment(ctxt, selector, &seg_desc, base3, seg); |
1591 | if (desc) | ||
1592 | *desc = seg_desc; | ||
1560 | return X86EMUL_CONTINUE; | 1593 | return X86EMUL_CONTINUE; |
1561 | exception: | 1594 | exception: |
1562 | return emulate_exception(ctxt, err_vec, err_code, true); | 1595 | return emulate_exception(ctxt, err_vec, err_code, true); |
@@ -1566,7 +1599,7 @@ static int load_segment_descriptor(struct x86_emulate_ctxt *ctxt, | |||
1566 | u16 selector, int seg) | 1599 | u16 selector, int seg) |
1567 | { | 1600 | { |
1568 | u8 cpl = ctxt->ops->cpl(ctxt); | 1601 | u8 cpl = ctxt->ops->cpl(ctxt); |
1569 | return __load_segment_descriptor(ctxt, selector, seg, cpl, false); | 1602 | return __load_segment_descriptor(ctxt, selector, seg, cpl, false, NULL); |
1570 | } | 1603 | } |
1571 | 1604 | ||
1572 | static void write_register_operand(struct operand *op) | 1605 | static void write_register_operand(struct operand *op) |
@@ -1960,17 +1993,31 @@ static int em_iret(struct x86_emulate_ctxt *ctxt) | |||
1960 | static int em_jmp_far(struct x86_emulate_ctxt *ctxt) | 1993 | static int em_jmp_far(struct x86_emulate_ctxt *ctxt) |
1961 | { | 1994 | { |
1962 | int rc; | 1995 | int rc; |
1963 | unsigned short sel; | 1996 | unsigned short sel, old_sel; |
1997 | struct desc_struct old_desc, new_desc; | ||
1998 | const struct x86_emulate_ops *ops = ctxt->ops; | ||
1999 | u8 cpl = ctxt->ops->cpl(ctxt); | ||
2000 | |||
2001 | /* Assignment of RIP may only fail in 64-bit mode */ | ||
2002 | if (ctxt->mode == X86EMUL_MODE_PROT64) | ||
2003 | ops->get_segment(ctxt, &old_sel, &old_desc, NULL, | ||
2004 | VCPU_SREG_CS); | ||
1964 | 2005 | ||
1965 | memcpy(&sel, ctxt->src.valptr + ctxt->op_bytes, 2); | 2006 | memcpy(&sel, ctxt->src.valptr + ctxt->op_bytes, 2); |
1966 | 2007 | ||
1967 | rc = load_segment_descriptor(ctxt, sel, VCPU_SREG_CS); | 2008 | rc = __load_segment_descriptor(ctxt, sel, VCPU_SREG_CS, cpl, false, |
2009 | &new_desc); | ||
1968 | if (rc != X86EMUL_CONTINUE) | 2010 | if (rc != X86EMUL_CONTINUE) |
1969 | return rc; | 2011 | return rc; |
1970 | 2012 | ||
1971 | ctxt->_eip = 0; | 2013 | rc = assign_eip_far(ctxt, ctxt->src.val, new_desc.l); |
1972 | memcpy(&ctxt->_eip, ctxt->src.valptr, ctxt->op_bytes); | 2014 | if (rc != X86EMUL_CONTINUE) { |
1973 | return X86EMUL_CONTINUE; | 2015 | WARN_ON(!ctxt->mode != X86EMUL_MODE_PROT64); |
2016 | /* assigning eip failed; restore the old cs */ | ||
2017 | ops->set_segment(ctxt, old_sel, &old_desc, 0, VCPU_SREG_CS); | ||
2018 | return rc; | ||
2019 | } | ||
2020 | return rc; | ||
1974 | } | 2021 | } |
1975 | 2022 | ||
1976 | static int em_grp45(struct x86_emulate_ctxt *ctxt) | 2023 | static int em_grp45(struct x86_emulate_ctxt *ctxt) |
@@ -1981,13 +2028,15 @@ static int em_grp45(struct x86_emulate_ctxt *ctxt) | |||
1981 | case 2: /* call near abs */ { | 2028 | case 2: /* call near abs */ { |
1982 | long int old_eip; | 2029 | long int old_eip; |
1983 | old_eip = ctxt->_eip; | 2030 | old_eip = ctxt->_eip; |
1984 | ctxt->_eip = ctxt->src.val; | 2031 | rc = assign_eip_near(ctxt, ctxt->src.val); |
2032 | if (rc != X86EMUL_CONTINUE) | ||
2033 | break; | ||
1985 | ctxt->src.val = old_eip; | 2034 | ctxt->src.val = old_eip; |
1986 | rc = em_push(ctxt); | 2035 | rc = em_push(ctxt); |
1987 | break; | 2036 | break; |
1988 | } | 2037 | } |
1989 | case 4: /* jmp abs */ | 2038 | case 4: /* jmp abs */ |
1990 | ctxt->_eip = ctxt->src.val; | 2039 | rc = assign_eip_near(ctxt, ctxt->src.val); |
1991 | break; | 2040 | break; |
1992 | case 5: /* jmp far */ | 2041 | case 5: /* jmp far */ |
1993 | rc = em_jmp_far(ctxt); | 2042 | rc = em_jmp_far(ctxt); |
@@ -2022,30 +2071,47 @@ static int em_cmpxchg8b(struct x86_emulate_ctxt *ctxt) | |||
2022 | 2071 | ||
2023 | static int em_ret(struct x86_emulate_ctxt *ctxt) | 2072 | static int em_ret(struct x86_emulate_ctxt *ctxt) |
2024 | { | 2073 | { |
2025 | ctxt->dst.type = OP_REG; | 2074 | int rc; |
2026 | ctxt->dst.addr.reg = &ctxt->_eip; | 2075 | unsigned long eip; |
2027 | ctxt->dst.bytes = ctxt->op_bytes; | 2076 | |
2028 | return em_pop(ctxt); | 2077 | rc = emulate_pop(ctxt, &eip, ctxt->op_bytes); |
2078 | if (rc != X86EMUL_CONTINUE) | ||
2079 | return rc; | ||
2080 | |||
2081 | return assign_eip_near(ctxt, eip); | ||
2029 | } | 2082 | } |
2030 | 2083 | ||
2031 | static int em_ret_far(struct x86_emulate_ctxt *ctxt) | 2084 | static int em_ret_far(struct x86_emulate_ctxt *ctxt) |
2032 | { | 2085 | { |
2033 | int rc; | 2086 | int rc; |
2034 | unsigned long cs; | 2087 | unsigned long eip, cs; |
2088 | u16 old_cs; | ||
2035 | int cpl = ctxt->ops->cpl(ctxt); | 2089 | int cpl = ctxt->ops->cpl(ctxt); |
2090 | struct desc_struct old_desc, new_desc; | ||
2091 | const struct x86_emulate_ops *ops = ctxt->ops; | ||
2036 | 2092 | ||
2037 | rc = emulate_pop(ctxt, &ctxt->_eip, ctxt->op_bytes); | 2093 | if (ctxt->mode == X86EMUL_MODE_PROT64) |
2094 | ops->get_segment(ctxt, &old_cs, &old_desc, NULL, | ||
2095 | VCPU_SREG_CS); | ||
2096 | |||
2097 | rc = emulate_pop(ctxt, &eip, ctxt->op_bytes); | ||
2038 | if (rc != X86EMUL_CONTINUE) | 2098 | if (rc != X86EMUL_CONTINUE) |
2039 | return rc; | 2099 | return rc; |
2040 | if (ctxt->op_bytes == 4) | ||
2041 | ctxt->_eip = (u32)ctxt->_eip; | ||
2042 | rc = emulate_pop(ctxt, &cs, ctxt->op_bytes); | 2100 | rc = emulate_pop(ctxt, &cs, ctxt->op_bytes); |
2043 | if (rc != X86EMUL_CONTINUE) | 2101 | if (rc != X86EMUL_CONTINUE) |
2044 | return rc; | 2102 | return rc; |
2045 | /* Outer-privilege level return is not implemented */ | 2103 | /* Outer-privilege level return is not implemented */ |
2046 | if (ctxt->mode >= X86EMUL_MODE_PROT16 && (cs & 3) > cpl) | 2104 | if (ctxt->mode >= X86EMUL_MODE_PROT16 && (cs & 3) > cpl) |
2047 | return X86EMUL_UNHANDLEABLE; | 2105 | return X86EMUL_UNHANDLEABLE; |
2048 | rc = load_segment_descriptor(ctxt, (u16)cs, VCPU_SREG_CS); | 2106 | rc = __load_segment_descriptor(ctxt, (u16)cs, VCPU_SREG_CS, 0, false, |
2107 | &new_desc); | ||
2108 | if (rc != X86EMUL_CONTINUE) | ||
2109 | return rc; | ||
2110 | rc = assign_eip_far(ctxt, eip, new_desc.l); | ||
2111 | if (rc != X86EMUL_CONTINUE) { | ||
2112 | WARN_ON(!ctxt->mode != X86EMUL_MODE_PROT64); | ||
2113 | ops->set_segment(ctxt, old_cs, &old_desc, 0, VCPU_SREG_CS); | ||
2114 | } | ||
2049 | return rc; | 2115 | return rc; |
2050 | } | 2116 | } |
2051 | 2117 | ||
@@ -2306,7 +2372,7 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt) | |||
2306 | { | 2372 | { |
2307 | const struct x86_emulate_ops *ops = ctxt->ops; | 2373 | const struct x86_emulate_ops *ops = ctxt->ops; |
2308 | struct desc_struct cs, ss; | 2374 | struct desc_struct cs, ss; |
2309 | u64 msr_data; | 2375 | u64 msr_data, rcx, rdx; |
2310 | int usermode; | 2376 | int usermode; |
2311 | u16 cs_sel = 0, ss_sel = 0; | 2377 | u16 cs_sel = 0, ss_sel = 0; |
2312 | 2378 | ||
@@ -2322,6 +2388,9 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt) | |||
2322 | else | 2388 | else |
2323 | usermode = X86EMUL_MODE_PROT32; | 2389 | usermode = X86EMUL_MODE_PROT32; |
2324 | 2390 | ||
2391 | rcx = reg_read(ctxt, VCPU_REGS_RCX); | ||
2392 | rdx = reg_read(ctxt, VCPU_REGS_RDX); | ||
2393 | |||
2325 | cs.dpl = 3; | 2394 | cs.dpl = 3; |
2326 | ss.dpl = 3; | 2395 | ss.dpl = 3; |
2327 | ops->get_msr(ctxt, MSR_IA32_SYSENTER_CS, &msr_data); | 2396 | ops->get_msr(ctxt, MSR_IA32_SYSENTER_CS, &msr_data); |
@@ -2339,6 +2408,9 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt) | |||
2339 | ss_sel = cs_sel + 8; | 2408 | ss_sel = cs_sel + 8; |
2340 | cs.d = 0; | 2409 | cs.d = 0; |
2341 | cs.l = 1; | 2410 | cs.l = 1; |
2411 | if (is_noncanonical_address(rcx) || | ||
2412 | is_noncanonical_address(rdx)) | ||
2413 | return emulate_gp(ctxt, 0); | ||
2342 | break; | 2414 | break; |
2343 | } | 2415 | } |
2344 | cs_sel |= SELECTOR_RPL_MASK; | 2416 | cs_sel |= SELECTOR_RPL_MASK; |
@@ -2347,8 +2419,8 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt) | |||
2347 | ops->set_segment(ctxt, cs_sel, &cs, 0, VCPU_SREG_CS); | 2419 | ops->set_segment(ctxt, cs_sel, &cs, 0, VCPU_SREG_CS); |
2348 | ops->set_segment(ctxt, ss_sel, &ss, 0, VCPU_SREG_SS); | 2420 | ops->set_segment(ctxt, ss_sel, &ss, 0, VCPU_SREG_SS); |
2349 | 2421 | ||
2350 | ctxt->_eip = reg_read(ctxt, VCPU_REGS_RDX); | 2422 | ctxt->_eip = rdx; |
2351 | *reg_write(ctxt, VCPU_REGS_RSP) = reg_read(ctxt, VCPU_REGS_RCX); | 2423 | *reg_write(ctxt, VCPU_REGS_RSP) = rcx; |
2352 | 2424 | ||
2353 | return X86EMUL_CONTINUE; | 2425 | return X86EMUL_CONTINUE; |
2354 | } | 2426 | } |
@@ -2466,19 +2538,24 @@ static int load_state_from_tss16(struct x86_emulate_ctxt *ctxt, | |||
2466 | * Now load segment descriptors. If fault happens at this stage | 2538 | * Now load segment descriptors. If fault happens at this stage |
2467 | * it is handled in a context of new task | 2539 | * it is handled in a context of new task |
2468 | */ | 2540 | */ |
2469 | ret = __load_segment_descriptor(ctxt, tss->ldt, VCPU_SREG_LDTR, cpl, true); | 2541 | ret = __load_segment_descriptor(ctxt, tss->ldt, VCPU_SREG_LDTR, cpl, |
2542 | true, NULL); | ||
2470 | if (ret != X86EMUL_CONTINUE) | 2543 | if (ret != X86EMUL_CONTINUE) |
2471 | return ret; | 2544 | return ret; |
2472 | ret = __load_segment_descriptor(ctxt, tss->es, VCPU_SREG_ES, cpl, true); | 2545 | ret = __load_segment_descriptor(ctxt, tss->es, VCPU_SREG_ES, cpl, |
2546 | true, NULL); | ||
2473 | if (ret != X86EMUL_CONTINUE) | 2547 | if (ret != X86EMUL_CONTINUE) |
2474 | return ret; | 2548 | return ret; |
2475 | ret = __load_segment_descriptor(ctxt, tss->cs, VCPU_SREG_CS, cpl, true); | 2549 | ret = __load_segment_descriptor(ctxt, tss->cs, VCPU_SREG_CS, cpl, |
2550 | true, NULL); | ||
2476 | if (ret != X86EMUL_CONTINUE) | 2551 | if (ret != X86EMUL_CONTINUE) |
2477 | return ret; | 2552 | return ret; |
2478 | ret = __load_segment_descriptor(ctxt, tss->ss, VCPU_SREG_SS, cpl, true); | 2553 | ret = __load_segment_descriptor(ctxt, tss->ss, VCPU_SREG_SS, cpl, |
2554 | true, NULL); | ||
2479 | if (ret != X86EMUL_CONTINUE) | 2555 | if (ret != X86EMUL_CONTINUE) |
2480 | return ret; | 2556 | return ret; |
2481 | ret = __load_segment_descriptor(ctxt, tss->ds, VCPU_SREG_DS, cpl, true); | 2557 | ret = __load_segment_descriptor(ctxt, tss->ds, VCPU_SREG_DS, cpl, |
2558 | true, NULL); | ||
2482 | if (ret != X86EMUL_CONTINUE) | 2559 | if (ret != X86EMUL_CONTINUE) |
2483 | return ret; | 2560 | return ret; |
2484 | 2561 | ||
@@ -2603,25 +2680,32 @@ static int load_state_from_tss32(struct x86_emulate_ctxt *ctxt, | |||
2603 | * Now load segment descriptors. If fault happenes at this stage | 2680 | * Now load segment descriptors. If fault happenes at this stage |
2604 | * it is handled in a context of new task | 2681 | * it is handled in a context of new task |
2605 | */ | 2682 | */ |
2606 | ret = __load_segment_descriptor(ctxt, tss->ldt_selector, VCPU_SREG_LDTR, cpl, true); | 2683 | ret = __load_segment_descriptor(ctxt, tss->ldt_selector, VCPU_SREG_LDTR, |
2684 | cpl, true, NULL); | ||
2607 | if (ret != X86EMUL_CONTINUE) | 2685 | if (ret != X86EMUL_CONTINUE) |
2608 | return ret; | 2686 | return ret; |
2609 | ret = __load_segment_descriptor(ctxt, tss->es, VCPU_SREG_ES, cpl, true); | 2687 | ret = __load_segment_descriptor(ctxt, tss->es, VCPU_SREG_ES, cpl, |
2688 | true, NULL); | ||
2610 | if (ret != X86EMUL_CONTINUE) | 2689 | if (ret != X86EMUL_CONTINUE) |
2611 | return ret; | 2690 | return ret; |
2612 | ret = __load_segment_descriptor(ctxt, tss->cs, VCPU_SREG_CS, cpl, true); | 2691 | ret = __load_segment_descriptor(ctxt, tss->cs, VCPU_SREG_CS, cpl, |
2692 | true, NULL); | ||
2613 | if (ret != X86EMUL_CONTINUE) | 2693 | if (ret != X86EMUL_CONTINUE) |
2614 | return ret; | 2694 | return ret; |
2615 | ret = __load_segment_descriptor(ctxt, tss->ss, VCPU_SREG_SS, cpl, true); | 2695 | ret = __load_segment_descriptor(ctxt, tss->ss, VCPU_SREG_SS, cpl, |
2696 | true, NULL); | ||
2616 | if (ret != X86EMUL_CONTINUE) | 2697 | if (ret != X86EMUL_CONTINUE) |
2617 | return ret; | 2698 | return ret; |
2618 | ret = __load_segment_descriptor(ctxt, tss->ds, VCPU_SREG_DS, cpl, true); | 2699 | ret = __load_segment_descriptor(ctxt, tss->ds, VCPU_SREG_DS, cpl, |
2700 | true, NULL); | ||
2619 | if (ret != X86EMUL_CONTINUE) | 2701 | if (ret != X86EMUL_CONTINUE) |
2620 | return ret; | 2702 | return ret; |
2621 | ret = __load_segment_descriptor(ctxt, tss->fs, VCPU_SREG_FS, cpl, true); | 2703 | ret = __load_segment_descriptor(ctxt, tss->fs, VCPU_SREG_FS, cpl, |
2704 | true, NULL); | ||
2622 | if (ret != X86EMUL_CONTINUE) | 2705 | if (ret != X86EMUL_CONTINUE) |
2623 | return ret; | 2706 | return ret; |
2624 | ret = __load_segment_descriptor(ctxt, tss->gs, VCPU_SREG_GS, cpl, true); | 2707 | ret = __load_segment_descriptor(ctxt, tss->gs, VCPU_SREG_GS, cpl, |
2708 | true, NULL); | ||
2625 | if (ret != X86EMUL_CONTINUE) | 2709 | if (ret != X86EMUL_CONTINUE) |
2626 | return ret; | 2710 | return ret; |
2627 | 2711 | ||
@@ -2888,10 +2972,13 @@ static int em_aad(struct x86_emulate_ctxt *ctxt) | |||
2888 | 2972 | ||
2889 | static int em_call(struct x86_emulate_ctxt *ctxt) | 2973 | static int em_call(struct x86_emulate_ctxt *ctxt) |
2890 | { | 2974 | { |
2975 | int rc; | ||
2891 | long rel = ctxt->src.val; | 2976 | long rel = ctxt->src.val; |
2892 | 2977 | ||
2893 | ctxt->src.val = (unsigned long)ctxt->_eip; | 2978 | ctxt->src.val = (unsigned long)ctxt->_eip; |
2894 | jmp_rel(ctxt, rel); | 2979 | rc = jmp_rel(ctxt, rel); |
2980 | if (rc != X86EMUL_CONTINUE) | ||
2981 | return rc; | ||
2895 | return em_push(ctxt); | 2982 | return em_push(ctxt); |
2896 | } | 2983 | } |
2897 | 2984 | ||
@@ -2900,34 +2987,50 @@ static int em_call_far(struct x86_emulate_ctxt *ctxt) | |||
2900 | u16 sel, old_cs; | 2987 | u16 sel, old_cs; |
2901 | ulong old_eip; | 2988 | ulong old_eip; |
2902 | int rc; | 2989 | int rc; |
2990 | struct desc_struct old_desc, new_desc; | ||
2991 | const struct x86_emulate_ops *ops = ctxt->ops; | ||
2992 | int cpl = ctxt->ops->cpl(ctxt); | ||
2903 | 2993 | ||
2904 | old_cs = get_segment_selector(ctxt, VCPU_SREG_CS); | ||
2905 | old_eip = ctxt->_eip; | 2994 | old_eip = ctxt->_eip; |
2995 | ops->get_segment(ctxt, &old_cs, &old_desc, NULL, VCPU_SREG_CS); | ||
2906 | 2996 | ||
2907 | memcpy(&sel, ctxt->src.valptr + ctxt->op_bytes, 2); | 2997 | memcpy(&sel, ctxt->src.valptr + ctxt->op_bytes, 2); |
2908 | if (load_segment_descriptor(ctxt, sel, VCPU_SREG_CS)) | 2998 | rc = __load_segment_descriptor(ctxt, sel, VCPU_SREG_CS, cpl, false, |
2999 | &new_desc); | ||
3000 | if (rc != X86EMUL_CONTINUE) | ||
2909 | return X86EMUL_CONTINUE; | 3001 | return X86EMUL_CONTINUE; |
2910 | 3002 | ||
2911 | ctxt->_eip = 0; | 3003 | rc = assign_eip_far(ctxt, ctxt->src.val, new_desc.l); |
2912 | memcpy(&ctxt->_eip, ctxt->src.valptr, ctxt->op_bytes); | 3004 | if (rc != X86EMUL_CONTINUE) |
3005 | goto fail; | ||
2913 | 3006 | ||
2914 | ctxt->src.val = old_cs; | 3007 | ctxt->src.val = old_cs; |
2915 | rc = em_push(ctxt); | 3008 | rc = em_push(ctxt); |
2916 | if (rc != X86EMUL_CONTINUE) | 3009 | if (rc != X86EMUL_CONTINUE) |
2917 | return rc; | 3010 | goto fail; |
2918 | 3011 | ||
2919 | ctxt->src.val = old_eip; | 3012 | ctxt->src.val = old_eip; |
2920 | return em_push(ctxt); | 3013 | rc = em_push(ctxt); |
3014 | /* If we failed, we tainted the memory, but the very least we should | ||
3015 | restore cs */ | ||
3016 | if (rc != X86EMUL_CONTINUE) | ||
3017 | goto fail; | ||
3018 | return rc; | ||
3019 | fail: | ||
3020 | ops->set_segment(ctxt, old_cs, &old_desc, 0, VCPU_SREG_CS); | ||
3021 | return rc; | ||
3022 | |||
2921 | } | 3023 | } |
2922 | 3024 | ||
2923 | static int em_ret_near_imm(struct x86_emulate_ctxt *ctxt) | 3025 | static int em_ret_near_imm(struct x86_emulate_ctxt *ctxt) |
2924 | { | 3026 | { |
2925 | int rc; | 3027 | int rc; |
3028 | unsigned long eip; | ||
2926 | 3029 | ||
2927 | ctxt->dst.type = OP_REG; | 3030 | rc = emulate_pop(ctxt, &eip, ctxt->op_bytes); |
2928 | ctxt->dst.addr.reg = &ctxt->_eip; | 3031 | if (rc != X86EMUL_CONTINUE) |
2929 | ctxt->dst.bytes = ctxt->op_bytes; | 3032 | return rc; |
2930 | rc = emulate_pop(ctxt, &ctxt->dst.val, ctxt->op_bytes); | 3033 | rc = assign_eip_near(ctxt, eip); |
2931 | if (rc != X86EMUL_CONTINUE) | 3034 | if (rc != X86EMUL_CONTINUE) |
2932 | return rc; | 3035 | return rc; |
2933 | rsp_increment(ctxt, ctxt->src.val); | 3036 | rsp_increment(ctxt, ctxt->src.val); |
@@ -3254,20 +3357,24 @@ static int em_lmsw(struct x86_emulate_ctxt *ctxt) | |||
3254 | 3357 | ||
3255 | static int em_loop(struct x86_emulate_ctxt *ctxt) | 3358 | static int em_loop(struct x86_emulate_ctxt *ctxt) |
3256 | { | 3359 | { |
3360 | int rc = X86EMUL_CONTINUE; | ||
3361 | |||
3257 | register_address_increment(ctxt, reg_rmw(ctxt, VCPU_REGS_RCX), -1); | 3362 | register_address_increment(ctxt, reg_rmw(ctxt, VCPU_REGS_RCX), -1); |
3258 | if ((address_mask(ctxt, reg_read(ctxt, VCPU_REGS_RCX)) != 0) && | 3363 | if ((address_mask(ctxt, reg_read(ctxt, VCPU_REGS_RCX)) != 0) && |
3259 | (ctxt->b == 0xe2 || test_cc(ctxt->b ^ 0x5, ctxt->eflags))) | 3364 | (ctxt->b == 0xe2 || test_cc(ctxt->b ^ 0x5, ctxt->eflags))) |
3260 | jmp_rel(ctxt, ctxt->src.val); | 3365 | rc = jmp_rel(ctxt, ctxt->src.val); |
3261 | 3366 | ||
3262 | return X86EMUL_CONTINUE; | 3367 | return rc; |
3263 | } | 3368 | } |
3264 | 3369 | ||
3265 | static int em_jcxz(struct x86_emulate_ctxt *ctxt) | 3370 | static int em_jcxz(struct x86_emulate_ctxt *ctxt) |
3266 | { | 3371 | { |
3372 | int rc = X86EMUL_CONTINUE; | ||
3373 | |||
3267 | if (address_mask(ctxt, reg_read(ctxt, VCPU_REGS_RCX)) == 0) | 3374 | if (address_mask(ctxt, reg_read(ctxt, VCPU_REGS_RCX)) == 0) |
3268 | jmp_rel(ctxt, ctxt->src.val); | 3375 | rc = jmp_rel(ctxt, ctxt->src.val); |
3269 | 3376 | ||
3270 | return X86EMUL_CONTINUE; | 3377 | return rc; |
3271 | } | 3378 | } |
3272 | 3379 | ||
3273 | static int em_in(struct x86_emulate_ctxt *ctxt) | 3380 | static int em_in(struct x86_emulate_ctxt *ctxt) |
@@ -3355,6 +3462,12 @@ static int em_bswap(struct x86_emulate_ctxt *ctxt) | |||
3355 | return X86EMUL_CONTINUE; | 3462 | return X86EMUL_CONTINUE; |
3356 | } | 3463 | } |
3357 | 3464 | ||
3465 | static int em_clflush(struct x86_emulate_ctxt *ctxt) | ||
3466 | { | ||
3467 | /* emulating clflush regardless of cpuid */ | ||
3468 | return X86EMUL_CONTINUE; | ||
3469 | } | ||
3470 | |||
3358 | static bool valid_cr(int nr) | 3471 | static bool valid_cr(int nr) |
3359 | { | 3472 | { |
3360 | switch (nr) { | 3473 | switch (nr) { |
@@ -3693,6 +3806,16 @@ static const struct opcode group11[] = { | |||
3693 | X7(D(Undefined)), | 3806 | X7(D(Undefined)), |
3694 | }; | 3807 | }; |
3695 | 3808 | ||
3809 | static const struct gprefix pfx_0f_ae_7 = { | ||
3810 | I(SrcMem | ByteOp, em_clflush), N, N, N, | ||
3811 | }; | ||
3812 | |||
3813 | static const struct group_dual group15 = { { | ||
3814 | N, N, N, N, N, N, N, GP(0, &pfx_0f_ae_7), | ||
3815 | }, { | ||
3816 | N, N, N, N, N, N, N, N, | ||
3817 | } }; | ||
3818 | |||
3696 | static const struct gprefix pfx_0f_6f_0f_7f = { | 3819 | static const struct gprefix pfx_0f_6f_0f_7f = { |
3697 | I(Mmx, em_mov), I(Sse | Aligned, em_mov), N, I(Sse | Unaligned, em_mov), | 3820 | I(Mmx, em_mov), I(Sse | Aligned, em_mov), N, I(Sse | Unaligned, em_mov), |
3698 | }; | 3821 | }; |
@@ -3901,10 +4024,11 @@ static const struct opcode twobyte_table[256] = { | |||
3901 | N, I(ImplicitOps | EmulateOnUD, em_syscall), | 4024 | N, I(ImplicitOps | EmulateOnUD, em_syscall), |
3902 | II(ImplicitOps | Priv, em_clts, clts), N, | 4025 | II(ImplicitOps | Priv, em_clts, clts), N, |
3903 | DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N, | 4026 | DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N, |
3904 | N, D(ImplicitOps | ModRM), N, N, | 4027 | N, D(ImplicitOps | ModRM | SrcMem | NoAccess), N, N, |
3905 | /* 0x10 - 0x1F */ | 4028 | /* 0x10 - 0x1F */ |
3906 | N, N, N, N, N, N, N, N, | 4029 | N, N, N, N, N, N, N, N, |
3907 | D(ImplicitOps | ModRM), N, N, N, N, N, N, D(ImplicitOps | ModRM), | 4030 | D(ImplicitOps | ModRM | SrcMem | NoAccess), |
4031 | N, N, N, N, N, N, D(ImplicitOps | ModRM | SrcMem | NoAccess), | ||
3908 | /* 0x20 - 0x2F */ | 4032 | /* 0x20 - 0x2F */ |
3909 | DIP(ModRM | DstMem | Priv | Op3264 | NoMod, cr_read, check_cr_read), | 4033 | DIP(ModRM | DstMem | Priv | Op3264 | NoMod, cr_read, check_cr_read), |
3910 | DIP(ModRM | DstMem | Priv | Op3264 | NoMod, dr_read, check_dr_read), | 4034 | DIP(ModRM | DstMem | Priv | Op3264 | NoMod, dr_read, check_dr_read), |
@@ -3956,7 +4080,7 @@ static const struct opcode twobyte_table[256] = { | |||
3956 | F(DstMem | SrcReg | ModRM | BitOp | Lock | PageTable, em_bts), | 4080 | F(DstMem | SrcReg | ModRM | BitOp | Lock | PageTable, em_bts), |
3957 | F(DstMem | SrcReg | Src2ImmByte | ModRM, em_shrd), | 4081 | F(DstMem | SrcReg | Src2ImmByte | ModRM, em_shrd), |
3958 | F(DstMem | SrcReg | Src2CL | ModRM, em_shrd), | 4082 | F(DstMem | SrcReg | Src2CL | ModRM, em_shrd), |
3959 | D(ModRM), F(DstReg | SrcMem | ModRM, em_imul), | 4083 | GD(0, &group15), F(DstReg | SrcMem | ModRM, em_imul), |
3960 | /* 0xB0 - 0xB7 */ | 4084 | /* 0xB0 - 0xB7 */ |
3961 | I2bv(DstMem | SrcReg | ModRM | Lock | PageTable, em_cmpxchg), | 4085 | I2bv(DstMem | SrcReg | ModRM | Lock | PageTable, em_cmpxchg), |
3962 | I(DstReg | SrcMemFAddr | ModRM | Src2SS, em_lseg), | 4086 | I(DstReg | SrcMemFAddr | ModRM | Src2SS, em_lseg), |
@@ -4473,10 +4597,10 @@ done_prefixes: | |||
4473 | /* Decode and fetch the destination operand: register or memory. */ | 4597 | /* Decode and fetch the destination operand: register or memory. */ |
4474 | rc = decode_operand(ctxt, &ctxt->dst, (ctxt->d >> DstShift) & OpMask); | 4598 | rc = decode_operand(ctxt, &ctxt->dst, (ctxt->d >> DstShift) & OpMask); |
4475 | 4599 | ||
4476 | done: | ||
4477 | if (ctxt->rip_relative) | 4600 | if (ctxt->rip_relative) |
4478 | ctxt->memopp->addr.mem.ea += ctxt->_eip; | 4601 | ctxt->memopp->addr.mem.ea += ctxt->_eip; |
4479 | 4602 | ||
4603 | done: | ||
4480 | return (rc != X86EMUL_CONTINUE) ? EMULATION_FAILED : EMULATION_OK; | 4604 | return (rc != X86EMUL_CONTINUE) ? EMULATION_FAILED : EMULATION_OK; |
4481 | } | 4605 | } |
4482 | 4606 | ||
@@ -4726,7 +4850,7 @@ special_insn: | |||
4726 | break; | 4850 | break; |
4727 | case 0x70 ... 0x7f: /* jcc (short) */ | 4851 | case 0x70 ... 0x7f: /* jcc (short) */ |
4728 | if (test_cc(ctxt->b, ctxt->eflags)) | 4852 | if (test_cc(ctxt->b, ctxt->eflags)) |
4729 | jmp_rel(ctxt, ctxt->src.val); | 4853 | rc = jmp_rel(ctxt, ctxt->src.val); |
4730 | break; | 4854 | break; |
4731 | case 0x8d: /* lea r16/r32, m */ | 4855 | case 0x8d: /* lea r16/r32, m */ |
4732 | ctxt->dst.val = ctxt->src.addr.mem.ea; | 4856 | ctxt->dst.val = ctxt->src.addr.mem.ea; |
@@ -4756,7 +4880,7 @@ special_insn: | |||
4756 | break; | 4880 | break; |
4757 | case 0xe9: /* jmp rel */ | 4881 | case 0xe9: /* jmp rel */ |
4758 | case 0xeb: /* jmp rel short */ | 4882 | case 0xeb: /* jmp rel short */ |
4759 | jmp_rel(ctxt, ctxt->src.val); | 4883 | rc = jmp_rel(ctxt, ctxt->src.val); |
4760 | ctxt->dst.type = OP_NONE; /* Disable writeback. */ | 4884 | ctxt->dst.type = OP_NONE; /* Disable writeback. */ |
4761 | break; | 4885 | break; |
4762 | case 0xf4: /* hlt */ | 4886 | case 0xf4: /* hlt */ |
@@ -4881,13 +5005,11 @@ twobyte_insn: | |||
4881 | break; | 5005 | break; |
4882 | case 0x80 ... 0x8f: /* jnz rel, etc*/ | 5006 | case 0x80 ... 0x8f: /* jnz rel, etc*/ |
4883 | if (test_cc(ctxt->b, ctxt->eflags)) | 5007 | if (test_cc(ctxt->b, ctxt->eflags)) |
4884 | jmp_rel(ctxt, ctxt->src.val); | 5008 | rc = jmp_rel(ctxt, ctxt->src.val); |
4885 | break; | 5009 | break; |
4886 | case 0x90 ... 0x9f: /* setcc r/m8 */ | 5010 | case 0x90 ... 0x9f: /* setcc r/m8 */ |
4887 | ctxt->dst.val = test_cc(ctxt->b, ctxt->eflags); | 5011 | ctxt->dst.val = test_cc(ctxt->b, ctxt->eflags); |
4888 | break; | 5012 | break; |
4889 | case 0xae: /* clflush */ | ||
4890 | break; | ||
4891 | case 0xb6 ... 0xb7: /* movzx */ | 5013 | case 0xb6 ... 0xb7: /* movzx */ |
4892 | ctxt->dst.bytes = ctxt->op_bytes; | 5014 | ctxt->dst.bytes = ctxt->op_bytes; |
4893 | ctxt->dst.val = (ctxt->src.bytes == 1) ? (u8) ctxt->src.val | 5015 | ctxt->dst.val = (ctxt->src.bytes == 1) ? (u8) ctxt->src.val |
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 518d86471b76..298781d4cfb4 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c | |||
@@ -262,8 +262,10 @@ void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu) | |||
262 | return; | 262 | return; |
263 | 263 | ||
264 | timer = &pit->pit_state.timer; | 264 | timer = &pit->pit_state.timer; |
265 | mutex_lock(&pit->pit_state.lock); | ||
265 | if (hrtimer_cancel(timer)) | 266 | if (hrtimer_cancel(timer)) |
266 | hrtimer_start_expires(timer, HRTIMER_MODE_ABS); | 267 | hrtimer_start_expires(timer, HRTIMER_MODE_ABS); |
268 | mutex_unlock(&pit->pit_state.lock); | ||
267 | } | 269 | } |
268 | 270 | ||
269 | static void destroy_pit_timer(struct kvm_pit *pit) | 271 | static void destroy_pit_timer(struct kvm_pit *pit) |
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 806d58e3c320..fd49c867b25a 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -298,7 +298,7 @@ retry_walk: | |||
298 | } | 298 | } |
299 | #endif | 299 | #endif |
300 | walker->max_level = walker->level; | 300 | walker->max_level = walker->level; |
301 | ASSERT(!is_long_mode(vcpu) && is_pae(vcpu)); | 301 | ASSERT(!(is_long_mode(vcpu) && !is_pae(vcpu))); |
302 | 302 | ||
303 | accessed_dirty = PT_GUEST_ACCESSED_MASK; | 303 | accessed_dirty = PT_GUEST_ACCESSED_MASK; |
304 | pt_access = pte_access = ACC_ALL; | 304 | pt_access = pte_access = ACC_ALL; |
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 65510f624dfe..7527cefc5a43 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -3251,7 +3251,7 @@ static int wrmsr_interception(struct vcpu_svm *svm) | |||
3251 | msr.host_initiated = false; | 3251 | msr.host_initiated = false; |
3252 | 3252 | ||
3253 | svm->next_rip = kvm_rip_read(&svm->vcpu) + 2; | 3253 | svm->next_rip = kvm_rip_read(&svm->vcpu) + 2; |
3254 | if (svm_set_msr(&svm->vcpu, &msr)) { | 3254 | if (kvm_set_msr(&svm->vcpu, &msr)) { |
3255 | trace_kvm_msr_write_ex(ecx, data); | 3255 | trace_kvm_msr_write_ex(ecx, data); |
3256 | kvm_inject_gp(&svm->vcpu, 0); | 3256 | kvm_inject_gp(&svm->vcpu, 0); |
3257 | } else { | 3257 | } else { |
@@ -3551,9 +3551,9 @@ static int handle_exit(struct kvm_vcpu *vcpu) | |||
3551 | 3551 | ||
3552 | if (exit_code >= ARRAY_SIZE(svm_exit_handlers) | 3552 | if (exit_code >= ARRAY_SIZE(svm_exit_handlers) |
3553 | || !svm_exit_handlers[exit_code]) { | 3553 | || !svm_exit_handlers[exit_code]) { |
3554 | kvm_run->exit_reason = KVM_EXIT_UNKNOWN; | 3554 | WARN_ONCE(1, "vmx: unexpected exit reason 0x%x\n", exit_code); |
3555 | kvm_run->hw.hardware_exit_reason = exit_code; | 3555 | kvm_queue_exception(vcpu, UD_VECTOR); |
3556 | return 0; | 3556 | return 1; |
3557 | } | 3557 | } |
3558 | 3558 | ||
3559 | return svm_exit_handlers[exit_code](svm); | 3559 | return svm_exit_handlers[exit_code](svm); |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 0acac81f198b..a8b76c4c95e2 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -2659,12 +2659,15 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) | |||
2659 | default: | 2659 | default: |
2660 | msr = find_msr_entry(vmx, msr_index); | 2660 | msr = find_msr_entry(vmx, msr_index); |
2661 | if (msr) { | 2661 | if (msr) { |
2662 | u64 old_msr_data = msr->data; | ||
2662 | msr->data = data; | 2663 | msr->data = data; |
2663 | if (msr - vmx->guest_msrs < vmx->save_nmsrs) { | 2664 | if (msr - vmx->guest_msrs < vmx->save_nmsrs) { |
2664 | preempt_disable(); | 2665 | preempt_disable(); |
2665 | kvm_set_shared_msr(msr->index, msr->data, | 2666 | ret = kvm_set_shared_msr(msr->index, msr->data, |
2666 | msr->mask); | 2667 | msr->mask); |
2667 | preempt_enable(); | 2668 | preempt_enable(); |
2669 | if (ret) | ||
2670 | msr->data = old_msr_data; | ||
2668 | } | 2671 | } |
2669 | break; | 2672 | break; |
2670 | } | 2673 | } |
@@ -5291,7 +5294,7 @@ static int handle_wrmsr(struct kvm_vcpu *vcpu) | |||
5291 | msr.data = data; | 5294 | msr.data = data; |
5292 | msr.index = ecx; | 5295 | msr.index = ecx; |
5293 | msr.host_initiated = false; | 5296 | msr.host_initiated = false; |
5294 | if (vmx_set_msr(vcpu, &msr) != 0) { | 5297 | if (kvm_set_msr(vcpu, &msr) != 0) { |
5295 | trace_kvm_msr_write_ex(ecx, data); | 5298 | trace_kvm_msr_write_ex(ecx, data); |
5296 | kvm_inject_gp(vcpu, 0); | 5299 | kvm_inject_gp(vcpu, 0); |
5297 | return 1; | 5300 | return 1; |
@@ -6743,6 +6746,12 @@ static int handle_invept(struct kvm_vcpu *vcpu) | |||
6743 | return 1; | 6746 | return 1; |
6744 | } | 6747 | } |
6745 | 6748 | ||
6749 | static int handle_invvpid(struct kvm_vcpu *vcpu) | ||
6750 | { | ||
6751 | kvm_queue_exception(vcpu, UD_VECTOR); | ||
6752 | return 1; | ||
6753 | } | ||
6754 | |||
6746 | /* | 6755 | /* |
6747 | * The exit handlers return 1 if the exit was handled fully and guest execution | 6756 | * The exit handlers return 1 if the exit was handled fully and guest execution |
6748 | * may resume. Otherwise they set the kvm_run parameter to indicate what needs | 6757 | * may resume. Otherwise they set the kvm_run parameter to indicate what needs |
@@ -6788,6 +6797,7 @@ static int (*const kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu) = { | |||
6788 | [EXIT_REASON_MWAIT_INSTRUCTION] = handle_mwait, | 6797 | [EXIT_REASON_MWAIT_INSTRUCTION] = handle_mwait, |
6789 | [EXIT_REASON_MONITOR_INSTRUCTION] = handle_monitor, | 6798 | [EXIT_REASON_MONITOR_INSTRUCTION] = handle_monitor, |
6790 | [EXIT_REASON_INVEPT] = handle_invept, | 6799 | [EXIT_REASON_INVEPT] = handle_invept, |
6800 | [EXIT_REASON_INVVPID] = handle_invvpid, | ||
6791 | }; | 6801 | }; |
6792 | 6802 | ||
6793 | static const int kvm_vmx_max_exit_handlers = | 6803 | static const int kvm_vmx_max_exit_handlers = |
@@ -7023,7 +7033,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu) | |||
7023 | case EXIT_REASON_VMPTRST: case EXIT_REASON_VMREAD: | 7033 | case EXIT_REASON_VMPTRST: case EXIT_REASON_VMREAD: |
7024 | case EXIT_REASON_VMRESUME: case EXIT_REASON_VMWRITE: | 7034 | case EXIT_REASON_VMRESUME: case EXIT_REASON_VMWRITE: |
7025 | case EXIT_REASON_VMOFF: case EXIT_REASON_VMON: | 7035 | case EXIT_REASON_VMOFF: case EXIT_REASON_VMON: |
7026 | case EXIT_REASON_INVEPT: | 7036 | case EXIT_REASON_INVEPT: case EXIT_REASON_INVVPID: |
7027 | /* | 7037 | /* |
7028 | * VMX instructions trap unconditionally. This allows L1 to | 7038 | * VMX instructions trap unconditionally. This allows L1 to |
7029 | * emulate them for its L2 guest, i.e., allows 3-level nesting! | 7039 | * emulate them for its L2 guest, i.e., allows 3-level nesting! |
@@ -7164,10 +7174,10 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu) | |||
7164 | && kvm_vmx_exit_handlers[exit_reason]) | 7174 | && kvm_vmx_exit_handlers[exit_reason]) |
7165 | return kvm_vmx_exit_handlers[exit_reason](vcpu); | 7175 | return kvm_vmx_exit_handlers[exit_reason](vcpu); |
7166 | else { | 7176 | else { |
7167 | vcpu->run->exit_reason = KVM_EXIT_UNKNOWN; | 7177 | WARN_ONCE(1, "vmx: unexpected exit reason 0x%x\n", exit_reason); |
7168 | vcpu->run->hw.hardware_exit_reason = exit_reason; | 7178 | kvm_queue_exception(vcpu, UD_VECTOR); |
7179 | return 1; | ||
7169 | } | 7180 | } |
7170 | return 0; | ||
7171 | } | 7181 | } |
7172 | 7182 | ||
7173 | static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr) | 7183 | static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr) |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 34c8f94331f8..0033df32a745 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -229,20 +229,25 @@ static void kvm_shared_msr_cpu_online(void) | |||
229 | shared_msr_update(i, shared_msrs_global.msrs[i]); | 229 | shared_msr_update(i, shared_msrs_global.msrs[i]); |
230 | } | 230 | } |
231 | 231 | ||
232 | void kvm_set_shared_msr(unsigned slot, u64 value, u64 mask) | 232 | int kvm_set_shared_msr(unsigned slot, u64 value, u64 mask) |
233 | { | 233 | { |
234 | unsigned int cpu = smp_processor_id(); | 234 | unsigned int cpu = smp_processor_id(); |
235 | struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu); | 235 | struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu); |
236 | int err; | ||
236 | 237 | ||
237 | if (((value ^ smsr->values[slot].curr) & mask) == 0) | 238 | if (((value ^ smsr->values[slot].curr) & mask) == 0) |
238 | return; | 239 | return 0; |
239 | smsr->values[slot].curr = value; | 240 | smsr->values[slot].curr = value; |
240 | wrmsrl(shared_msrs_global.msrs[slot], value); | 241 | err = wrmsrl_safe(shared_msrs_global.msrs[slot], value); |
242 | if (err) | ||
243 | return 1; | ||
244 | |||
241 | if (!smsr->registered) { | 245 | if (!smsr->registered) { |
242 | smsr->urn.on_user_return = kvm_on_user_return; | 246 | smsr->urn.on_user_return = kvm_on_user_return; |
243 | user_return_notifier_register(&smsr->urn); | 247 | user_return_notifier_register(&smsr->urn); |
244 | smsr->registered = true; | 248 | smsr->registered = true; |
245 | } | 249 | } |
250 | return 0; | ||
246 | } | 251 | } |
247 | EXPORT_SYMBOL_GPL(kvm_set_shared_msr); | 252 | EXPORT_SYMBOL_GPL(kvm_set_shared_msr); |
248 | 253 | ||
@@ -987,7 +992,6 @@ void kvm_enable_efer_bits(u64 mask) | |||
987 | } | 992 | } |
988 | EXPORT_SYMBOL_GPL(kvm_enable_efer_bits); | 993 | EXPORT_SYMBOL_GPL(kvm_enable_efer_bits); |
989 | 994 | ||
990 | |||
991 | /* | 995 | /* |
992 | * Writes msr value into into the appropriate "register". | 996 | * Writes msr value into into the appropriate "register". |
993 | * Returns 0 on success, non-0 otherwise. | 997 | * Returns 0 on success, non-0 otherwise. |
@@ -995,8 +999,34 @@ EXPORT_SYMBOL_GPL(kvm_enable_efer_bits); | |||
995 | */ | 999 | */ |
996 | int kvm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) | 1000 | int kvm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) |
997 | { | 1001 | { |
1002 | switch (msr->index) { | ||
1003 | case MSR_FS_BASE: | ||
1004 | case MSR_GS_BASE: | ||
1005 | case MSR_KERNEL_GS_BASE: | ||
1006 | case MSR_CSTAR: | ||
1007 | case MSR_LSTAR: | ||
1008 | if (is_noncanonical_address(msr->data)) | ||
1009 | return 1; | ||
1010 | break; | ||
1011 | case MSR_IA32_SYSENTER_EIP: | ||
1012 | case MSR_IA32_SYSENTER_ESP: | ||
1013 | /* | ||
1014 | * IA32_SYSENTER_ESP and IA32_SYSENTER_EIP cause #GP if | ||
1015 | * non-canonical address is written on Intel but not on | ||
1016 | * AMD (which ignores the top 32-bits, because it does | ||
1017 | * not implement 64-bit SYSENTER). | ||
1018 | * | ||
1019 | * 64-bit code should hence be able to write a non-canonical | ||
1020 | * value on AMD. Making the address canonical ensures that | ||
1021 | * vmentry does not fail on Intel after writing a non-canonical | ||
1022 | * value, and that something deterministic happens if the guest | ||
1023 | * invokes 64-bit SYSENTER. | ||
1024 | */ | ||
1025 | msr->data = get_canonical(msr->data); | ||
1026 | } | ||
998 | return kvm_x86_ops->set_msr(vcpu, msr); | 1027 | return kvm_x86_ops->set_msr(vcpu, msr); |
999 | } | 1028 | } |
1029 | EXPORT_SYMBOL_GPL(kvm_set_msr); | ||
1000 | 1030 | ||
1001 | /* | 1031 | /* |
1002 | * Adapt set_msr() to msr_io()'s calling convention | 1032 | * Adapt set_msr() to msr_io()'s calling convention |
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index ae242a7c11c7..36de293caf25 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -409,7 +409,7 @@ phys_addr_t slow_virt_to_phys(void *__virt_addr) | |||
409 | psize = page_level_size(level); | 409 | psize = page_level_size(level); |
410 | pmask = page_level_mask(level); | 410 | pmask = page_level_mask(level); |
411 | offset = virt_addr & ~pmask; | 411 | offset = virt_addr & ~pmask; |
412 | phys_addr = pte_pfn(*pte) << PAGE_SHIFT; | 412 | phys_addr = (phys_addr_t)pte_pfn(*pte) << PAGE_SHIFT; |
413 | return (phys_addr | offset); | 413 | return (phys_addr | offset); |
414 | } | 414 | } |
415 | EXPORT_SYMBOL_GPL(slow_virt_to_phys); | 415 | EXPORT_SYMBOL_GPL(slow_virt_to_phys); |
diff --git a/arch/x86/platform/efi/efi-bgrt.c b/arch/x86/platform/efi/efi-bgrt.c index f15103dff4b4..d143d216d52b 100644 --- a/arch/x86/platform/efi/efi-bgrt.c +++ b/arch/x86/platform/efi/efi-bgrt.c | |||
@@ -40,20 +40,40 @@ void __init efi_bgrt_init(void) | |||
40 | if (ACPI_FAILURE(status)) | 40 | if (ACPI_FAILURE(status)) |
41 | return; | 41 | return; |
42 | 42 | ||
43 | if (bgrt_tab->header.length < sizeof(*bgrt_tab)) | 43 | if (bgrt_tab->header.length < sizeof(*bgrt_tab)) { |
44 | pr_err("Ignoring BGRT: invalid length %u (expected %zu)\n", | ||
45 | bgrt_tab->header.length, sizeof(*bgrt_tab)); | ||
44 | return; | 46 | return; |
45 | if (bgrt_tab->version != 1 || bgrt_tab->status != 1) | 47 | } |
48 | if (bgrt_tab->version != 1) { | ||
49 | pr_err("Ignoring BGRT: invalid version %u (expected 1)\n", | ||
50 | bgrt_tab->version); | ||
51 | return; | ||
52 | } | ||
53 | if (bgrt_tab->status != 1) { | ||
54 | pr_err("Ignoring BGRT: invalid status %u (expected 1)\n", | ||
55 | bgrt_tab->status); | ||
56 | return; | ||
57 | } | ||
58 | if (bgrt_tab->image_type != 0) { | ||
59 | pr_err("Ignoring BGRT: invalid image type %u (expected 0)\n", | ||
60 | bgrt_tab->image_type); | ||
46 | return; | 61 | return; |
47 | if (bgrt_tab->image_type != 0 || !bgrt_tab->image_address) | 62 | } |
63 | if (!bgrt_tab->image_address) { | ||
64 | pr_err("Ignoring BGRT: null image address\n"); | ||
48 | return; | 65 | return; |
66 | } | ||
49 | 67 | ||
50 | image = efi_lookup_mapped_addr(bgrt_tab->image_address); | 68 | image = efi_lookup_mapped_addr(bgrt_tab->image_address); |
51 | if (!image) { | 69 | if (!image) { |
52 | image = early_memremap(bgrt_tab->image_address, | 70 | image = early_memremap(bgrt_tab->image_address, |
53 | sizeof(bmp_header)); | 71 | sizeof(bmp_header)); |
54 | ioremapped = true; | 72 | ioremapped = true; |
55 | if (!image) | 73 | if (!image) { |
74 | pr_err("Ignoring BGRT: failed to map image header memory\n"); | ||
56 | return; | 75 | return; |
76 | } | ||
57 | } | 77 | } |
58 | 78 | ||
59 | memcpy_fromio(&bmp_header, image, sizeof(bmp_header)); | 79 | memcpy_fromio(&bmp_header, image, sizeof(bmp_header)); |
@@ -61,14 +81,18 @@ void __init efi_bgrt_init(void) | |||
61 | early_iounmap(image, sizeof(bmp_header)); | 81 | early_iounmap(image, sizeof(bmp_header)); |
62 | bgrt_image_size = bmp_header.size; | 82 | bgrt_image_size = bmp_header.size; |
63 | 83 | ||
64 | bgrt_image = kmalloc(bgrt_image_size, GFP_KERNEL); | 84 | bgrt_image = kmalloc(bgrt_image_size, GFP_KERNEL | __GFP_NOWARN); |
65 | if (!bgrt_image) | 85 | if (!bgrt_image) { |
86 | pr_err("Ignoring BGRT: failed to allocate memory for image (wanted %zu bytes)\n", | ||
87 | bgrt_image_size); | ||
66 | return; | 88 | return; |
89 | } | ||
67 | 90 | ||
68 | if (ioremapped) { | 91 | if (ioremapped) { |
69 | image = early_memremap(bgrt_tab->image_address, | 92 | image = early_memremap(bgrt_tab->image_address, |
70 | bmp_header.size); | 93 | bmp_header.size); |
71 | if (!image) { | 94 | if (!image) { |
95 | pr_err("Ignoring BGRT: failed to map image memory\n"); | ||
72 | kfree(bgrt_image); | 96 | kfree(bgrt_image); |
73 | bgrt_image = NULL; | 97 | bgrt_image = NULL; |
74 | return; | 98 | return; |
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 850da94fef30..dbc8627a5cdf 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
@@ -70,17 +70,7 @@ static efi_config_table_type_t arch_tables[] __initdata = { | |||
70 | 70 | ||
71 | u64 efi_setup; /* efi setup_data physical address */ | 71 | u64 efi_setup; /* efi setup_data physical address */ |
72 | 72 | ||
73 | static bool disable_runtime __initdata = false; | 73 | static int add_efi_memmap __initdata; |
74 | static int __init setup_noefi(char *arg) | ||
75 | { | ||
76 | disable_runtime = true; | ||
77 | return 0; | ||
78 | } | ||
79 | early_param("noefi", setup_noefi); | ||
80 | |||
81 | int add_efi_memmap; | ||
82 | EXPORT_SYMBOL(add_efi_memmap); | ||
83 | |||
84 | static int __init setup_add_efi_memmap(char *arg) | 74 | static int __init setup_add_efi_memmap(char *arg) |
85 | { | 75 | { |
86 | add_efi_memmap = 1; | 76 | add_efi_memmap = 1; |
@@ -96,7 +86,7 @@ static efi_status_t __init phys_efi_set_virtual_address_map( | |||
96 | { | 86 | { |
97 | efi_status_t status; | 87 | efi_status_t status; |
98 | 88 | ||
99 | efi_call_phys_prelog(); | 89 | efi_call_phys_prolog(); |
100 | status = efi_call_phys(efi_phys.set_virtual_address_map, | 90 | status = efi_call_phys(efi_phys.set_virtual_address_map, |
101 | memory_map_size, descriptor_size, | 91 | memory_map_size, descriptor_size, |
102 | descriptor_version, virtual_map); | 92 | descriptor_version, virtual_map); |
@@ -210,9 +200,12 @@ static void __init print_efi_memmap(void) | |||
210 | for (p = memmap.map, i = 0; | 200 | for (p = memmap.map, i = 0; |
211 | p < memmap.map_end; | 201 | p < memmap.map_end; |
212 | p += memmap.desc_size, i++) { | 202 | p += memmap.desc_size, i++) { |
203 | char buf[64]; | ||
204 | |||
213 | md = p; | 205 | md = p; |
214 | pr_info("mem%02u: type=%u, attr=0x%llx, range=[0x%016llx-0x%016llx) (%lluMB)\n", | 206 | pr_info("mem%02u: %s range=[0x%016llx-0x%016llx) (%lluMB)\n", |
215 | i, md->type, md->attribute, md->phys_addr, | 207 | i, efi_md_typeattr_format(buf, sizeof(buf), md), |
208 | md->phys_addr, | ||
216 | md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), | 209 | md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), |
217 | (md->num_pages >> (20 - EFI_PAGE_SHIFT))); | 210 | (md->num_pages >> (20 - EFI_PAGE_SHIFT))); |
218 | } | 211 | } |
@@ -344,9 +337,9 @@ static int __init efi_runtime_init32(void) | |||
344 | } | 337 | } |
345 | 338 | ||
346 | /* | 339 | /* |
347 | * We will only need *early* access to the following two | 340 | * We will only need *early* access to the SetVirtualAddressMap |
348 | * EFI runtime services before set_virtual_address_map | 341 | * EFI runtime service. All other runtime services will be called |
349 | * is invoked. | 342 | * via the virtual mapping. |
350 | */ | 343 | */ |
351 | efi_phys.set_virtual_address_map = | 344 | efi_phys.set_virtual_address_map = |
352 | (efi_set_virtual_address_map_t *) | 345 | (efi_set_virtual_address_map_t *) |
@@ -368,9 +361,9 @@ static int __init efi_runtime_init64(void) | |||
368 | } | 361 | } |
369 | 362 | ||
370 | /* | 363 | /* |
371 | * We will only need *early* access to the following two | 364 | * We will only need *early* access to the SetVirtualAddressMap |
372 | * EFI runtime services before set_virtual_address_map | 365 | * EFI runtime service. All other runtime services will be called |
373 | * is invoked. | 366 | * via the virtual mapping. |
374 | */ | 367 | */ |
375 | efi_phys.set_virtual_address_map = | 368 | efi_phys.set_virtual_address_map = |
376 | (efi_set_virtual_address_map_t *) | 369 | (efi_set_virtual_address_map_t *) |
@@ -492,7 +485,7 @@ void __init efi_init(void) | |||
492 | if (!efi_runtime_supported()) | 485 | if (!efi_runtime_supported()) |
493 | pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n"); | 486 | pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n"); |
494 | else { | 487 | else { |
495 | if (disable_runtime || efi_runtime_init()) | 488 | if (efi_runtime_disabled() || efi_runtime_init()) |
496 | return; | 489 | return; |
497 | } | 490 | } |
498 | if (efi_memmap_init()) | 491 | if (efi_memmap_init()) |
@@ -537,7 +530,7 @@ void __init runtime_code_page_mkexec(void) | |||
537 | } | 530 | } |
538 | } | 531 | } |
539 | 532 | ||
540 | void efi_memory_uc(u64 addr, unsigned long size) | 533 | void __init efi_memory_uc(u64 addr, unsigned long size) |
541 | { | 534 | { |
542 | unsigned long page_shift = 1UL << EFI_PAGE_SHIFT; | 535 | unsigned long page_shift = 1UL << EFI_PAGE_SHIFT; |
543 | u64 npages; | 536 | u64 npages; |
@@ -732,6 +725,7 @@ static void __init kexec_enter_virtual_mode(void) | |||
732 | */ | 725 | */ |
733 | if (!efi_is_native()) { | 726 | if (!efi_is_native()) { |
734 | efi_unmap_memmap(); | 727 | efi_unmap_memmap(); |
728 | clear_bit(EFI_RUNTIME_SERVICES, &efi.flags); | ||
735 | return; | 729 | return; |
736 | } | 730 | } |
737 | 731 | ||
@@ -805,6 +799,7 @@ static void __init __efi_enter_virtual_mode(void) | |||
805 | new_memmap = efi_map_regions(&count, &pg_shift); | 799 | new_memmap = efi_map_regions(&count, &pg_shift); |
806 | if (!new_memmap) { | 800 | if (!new_memmap) { |
807 | pr_err("Error reallocating memory, EFI runtime non-functional!\n"); | 801 | pr_err("Error reallocating memory, EFI runtime non-functional!\n"); |
802 | clear_bit(EFI_RUNTIME_SERVICES, &efi.flags); | ||
808 | return; | 803 | return; |
809 | } | 804 | } |
810 | 805 | ||
@@ -812,8 +807,10 @@ static void __init __efi_enter_virtual_mode(void) | |||
812 | 807 | ||
813 | BUG_ON(!efi.systab); | 808 | BUG_ON(!efi.systab); |
814 | 809 | ||
815 | if (efi_setup_page_tables(__pa(new_memmap), 1 << pg_shift)) | 810 | if (efi_setup_page_tables(__pa(new_memmap), 1 << pg_shift)) { |
811 | clear_bit(EFI_RUNTIME_SERVICES, &efi.flags); | ||
816 | return; | 812 | return; |
813 | } | ||
817 | 814 | ||
818 | efi_sync_low_kernel_mappings(); | 815 | efi_sync_low_kernel_mappings(); |
819 | efi_dump_pagetable(); | 816 | efi_dump_pagetable(); |
@@ -938,14 +935,11 @@ u64 efi_mem_attributes(unsigned long phys_addr) | |||
938 | return 0; | 935 | return 0; |
939 | } | 936 | } |
940 | 937 | ||
941 | static int __init parse_efi_cmdline(char *str) | 938 | static int __init arch_parse_efi_cmdline(char *str) |
942 | { | 939 | { |
943 | if (*str == '=') | 940 | if (parse_option_str(str, "old_map")) |
944 | str++; | ||
945 | |||
946 | if (!strncmp(str, "old_map", 7)) | ||
947 | set_bit(EFI_OLD_MEMMAP, &efi.flags); | 941 | set_bit(EFI_OLD_MEMMAP, &efi.flags); |
948 | 942 | ||
949 | return 0; | 943 | return 0; |
950 | } | 944 | } |
951 | early_param("efi", parse_efi_cmdline); | 945 | early_param("efi", arch_parse_efi_cmdline); |
diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c index 9ee3491e31fb..40e7cda52936 100644 --- a/arch/x86/platform/efi/efi_32.c +++ b/arch/x86/platform/efi/efi_32.c | |||
@@ -33,7 +33,7 @@ | |||
33 | 33 | ||
34 | /* | 34 | /* |
35 | * To make EFI call EFI runtime service in physical addressing mode we need | 35 | * To make EFI call EFI runtime service in physical addressing mode we need |
36 | * prelog/epilog before/after the invocation to disable interrupt, to | 36 | * prolog/epilog before/after the invocation to disable interrupt, to |
37 | * claim EFI runtime service handler exclusively and to duplicate a memory in | 37 | * claim EFI runtime service handler exclusively and to duplicate a memory in |
38 | * low memory space say 0 - 3G. | 38 | * low memory space say 0 - 3G. |
39 | */ | 39 | */ |
@@ -41,11 +41,13 @@ static unsigned long efi_rt_eflags; | |||
41 | 41 | ||
42 | void efi_sync_low_kernel_mappings(void) {} | 42 | void efi_sync_low_kernel_mappings(void) {} |
43 | void __init efi_dump_pagetable(void) {} | 43 | void __init efi_dump_pagetable(void) {} |
44 | int efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) | 44 | int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) |
45 | { | 45 | { |
46 | return 0; | 46 | return 0; |
47 | } | 47 | } |
48 | void efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages) {} | 48 | void __init efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages) |
49 | { | ||
50 | } | ||
49 | 51 | ||
50 | void __init efi_map_region(efi_memory_desc_t *md) | 52 | void __init efi_map_region(efi_memory_desc_t *md) |
51 | { | 53 | { |
@@ -55,7 +57,7 @@ void __init efi_map_region(efi_memory_desc_t *md) | |||
55 | void __init efi_map_region_fixed(efi_memory_desc_t *md) {} | 57 | void __init efi_map_region_fixed(efi_memory_desc_t *md) {} |
56 | void __init parse_efi_setup(u64 phys_addr, u32 data_len) {} | 58 | void __init parse_efi_setup(u64 phys_addr, u32 data_len) {} |
57 | 59 | ||
58 | void efi_call_phys_prelog(void) | 60 | void __init efi_call_phys_prolog(void) |
59 | { | 61 | { |
60 | struct desc_ptr gdt_descr; | 62 | struct desc_ptr gdt_descr; |
61 | 63 | ||
@@ -69,7 +71,7 @@ void efi_call_phys_prelog(void) | |||
69 | load_gdt(&gdt_descr); | 71 | load_gdt(&gdt_descr); |
70 | } | 72 | } |
71 | 73 | ||
72 | void efi_call_phys_epilog(void) | 74 | void __init efi_call_phys_epilog(void) |
73 | { | 75 | { |
74 | struct desc_ptr gdt_descr; | 76 | struct desc_ptr gdt_descr; |
75 | 77 | ||
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index 290d397e1dd9..35aecb6042fb 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c | |||
@@ -79,7 +79,7 @@ static void __init early_code_mapping_set_exec(int executable) | |||
79 | } | 79 | } |
80 | } | 80 | } |
81 | 81 | ||
82 | void __init efi_call_phys_prelog(void) | 82 | void __init efi_call_phys_prolog(void) |
83 | { | 83 | { |
84 | unsigned long vaddress; | 84 | unsigned long vaddress; |
85 | int pgd; | 85 | int pgd; |
@@ -139,7 +139,7 @@ void efi_sync_low_kernel_mappings(void) | |||
139 | sizeof(pgd_t) * num_pgds); | 139 | sizeof(pgd_t) * num_pgds); |
140 | } | 140 | } |
141 | 141 | ||
142 | int efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) | 142 | int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) |
143 | { | 143 | { |
144 | unsigned long text; | 144 | unsigned long text; |
145 | struct page *page; | 145 | struct page *page; |
@@ -192,7 +192,7 @@ int efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) | |||
192 | return 0; | 192 | return 0; |
193 | } | 193 | } |
194 | 194 | ||
195 | void efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages) | 195 | void __init efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages) |
196 | { | 196 | { |
197 | pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd); | 197 | pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd); |
198 | 198 | ||
diff --git a/arch/x86/platform/efi/efi_stub_32.S b/arch/x86/platform/efi/efi_stub_32.S index fbe66e626c09..040192b50d02 100644 --- a/arch/x86/platform/efi/efi_stub_32.S +++ b/arch/x86/platform/efi/efi_stub_32.S | |||
@@ -27,13 +27,13 @@ ENTRY(efi_call_phys) | |||
27 | * set to 0x0010, DS and SS have been set to 0x0018. In EFI, I found | 27 | * set to 0x0010, DS and SS have been set to 0x0018. In EFI, I found |
28 | * the values of these registers are the same. And, the corresponding | 28 | * the values of these registers are the same. And, the corresponding |
29 | * GDT entries are identical. So I will do nothing about segment reg | 29 | * GDT entries are identical. So I will do nothing about segment reg |
30 | * and GDT, but change GDT base register in prelog and epilog. | 30 | * and GDT, but change GDT base register in prolog and epilog. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * 1. Now I am running with EIP = <physical address> + PAGE_OFFSET. | 34 | * 1. Now I am running with EIP = <physical address> + PAGE_OFFSET. |
35 | * But to make it smoothly switch from virtual mode to flat mode. | 35 | * But to make it smoothly switch from virtual mode to flat mode. |
36 | * The mapping of lower virtual memory has been created in prelog and | 36 | * The mapping of lower virtual memory has been created in prolog and |
37 | * epilog. | 37 | * epilog. |
38 | */ | 38 | */ |
39 | movl $1f, %edx | 39 | movl $1f, %edx |
diff --git a/arch/x86/platform/intel-mid/intel_mid_weak_decls.h b/arch/x86/platform/intel-mid/intel_mid_weak_decls.h index 46aa25c8ce06..3c1c3866d82b 100644 --- a/arch/x86/platform/intel-mid/intel_mid_weak_decls.h +++ b/arch/x86/platform/intel-mid/intel_mid_weak_decls.h | |||
@@ -10,10 +10,9 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | 12 | ||
13 | /* __attribute__((weak)) makes these declarations overridable */ | ||
14 | /* For every CPU addition a new get_<cpuname>_ops interface needs | 13 | /* For every CPU addition a new get_<cpuname>_ops interface needs |
15 | * to be added. | 14 | * to be added. |
16 | */ | 15 | */ |
17 | extern void *get_penwell_ops(void) __attribute__((weak)); | 16 | extern void *get_penwell_ops(void); |
18 | extern void *get_cloverview_ops(void) __attribute__((weak)); | 17 | extern void *get_cloverview_ops(void); |
19 | extern void *get_tangier_ops(void) __attribute__((weak)); | 18 | extern void *get_tangier_ops(void); |
diff --git a/arch/x86/platform/intel-mid/sfi.c b/arch/x86/platform/intel-mid/sfi.c index 3c53a90fdb18..c14ad34776c4 100644 --- a/arch/x86/platform/intel-mid/sfi.c +++ b/arch/x86/platform/intel-mid/sfi.c | |||
@@ -106,6 +106,7 @@ int __init sfi_parse_mtmr(struct sfi_table_header *table) | |||
106 | mp_irq.dstapic = MP_APIC_ALL; | 106 | mp_irq.dstapic = MP_APIC_ALL; |
107 | mp_irq.dstirq = pentry->irq; | 107 | mp_irq.dstirq = pentry->irq; |
108 | mp_save_irq(&mp_irq); | 108 | mp_save_irq(&mp_irq); |
109 | mp_map_gsi_to_irq(pentry->irq, IOAPIC_MAP_ALLOC); | ||
109 | } | 110 | } |
110 | 111 | ||
111 | return 0; | 112 | return 0; |
@@ -176,6 +177,7 @@ int __init sfi_parse_mrtc(struct sfi_table_header *table) | |||
176 | mp_irq.dstapic = MP_APIC_ALL; | 177 | mp_irq.dstapic = MP_APIC_ALL; |
177 | mp_irq.dstirq = pentry->irq; | 178 | mp_irq.dstirq = pentry->irq; |
178 | mp_save_irq(&mp_irq); | 179 | mp_save_irq(&mp_irq); |
180 | mp_map_gsi_to_irq(pentry->irq, IOAPIC_MAP_ALLOC); | ||
179 | } | 181 | } |
180 | return 0; | 182 | return 0; |
181 | } | 183 | } |
diff --git a/arch/x86/um/asm/ptrace.h b/arch/x86/um/asm/ptrace.h index 54f8102ccde5..e59eef20647b 100644 --- a/arch/x86/um/asm/ptrace.h +++ b/arch/x86/um/asm/ptrace.h | |||
@@ -47,8 +47,6 @@ struct user_desc; | |||
47 | 47 | ||
48 | #ifdef CONFIG_X86_32 | 48 | #ifdef CONFIG_X86_32 |
49 | 49 | ||
50 | #define HOST_AUDIT_ARCH AUDIT_ARCH_I386 | ||
51 | |||
52 | extern int ptrace_get_thread_area(struct task_struct *child, int idx, | 50 | extern int ptrace_get_thread_area(struct task_struct *child, int idx, |
53 | struct user_desc __user *user_desc); | 51 | struct user_desc __user *user_desc); |
54 | 52 | ||
@@ -57,8 +55,6 @@ extern int ptrace_set_thread_area(struct task_struct *child, int idx, | |||
57 | 55 | ||
58 | #else | 56 | #else |
59 | 57 | ||
60 | #define HOST_AUDIT_ARCH AUDIT_ARCH_X86_64 | ||
61 | |||
62 | #define PT_REGS_R8(r) UPT_R8(&(r)->regs) | 58 | #define PT_REGS_R8(r) UPT_R8(&(r)->regs) |
63 | #define PT_REGS_R9(r) UPT_R9(&(r)->regs) | 59 | #define PT_REGS_R9(r) UPT_R9(&(r)->regs) |
64 | #define PT_REGS_R10(r) UPT_R10(&(r)->regs) | 60 | #define PT_REGS_R10(r) UPT_R10(&(r)->regs) |
diff --git a/arch/x86/um/asm/syscall.h b/arch/x86/um/asm/syscall.h new file mode 100644 index 000000000000..9fe77b7b5a0e --- /dev/null +++ b/arch/x86/um/asm/syscall.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef __UM_ASM_SYSCALL_H | ||
2 | #define __UM_ASM_SYSCALL_H | ||
3 | |||
4 | #include <uapi/linux/audit.h> | ||
5 | |||
6 | static inline int syscall_get_arch(void) | ||
7 | { | ||
8 | #ifdef CONFIG_X86_32 | ||
9 | return AUDIT_ARCH_I386; | ||
10 | #else | ||
11 | return AUDIT_ARCH_X86_64; | ||
12 | #endif | ||
13 | } | ||
14 | |||
15 | #endif /* __UM_ASM_SYSCALL_H */ | ||
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 1a3f0445432a..fac5e4f9607c 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1636,9 +1636,6 @@ asmlinkage __visible void __init xen_start_kernel(void) | |||
1636 | xen_raw_console_write("mapping kernel into physical memory\n"); | 1636 | xen_raw_console_write("mapping kernel into physical memory\n"); |
1637 | xen_setup_kernel_pagetable((pgd_t *)xen_start_info->pt_base, xen_start_info->nr_pages); | 1637 | xen_setup_kernel_pagetable((pgd_t *)xen_start_info->pt_base, xen_start_info->nr_pages); |
1638 | 1638 | ||
1639 | /* Allocate and initialize top and mid mfn levels for p2m structure */ | ||
1640 | xen_build_mfn_list_list(); | ||
1641 | |||
1642 | /* keep using Xen gdt for now; no urgent need to change it */ | 1639 | /* keep using Xen gdt for now; no urgent need to change it */ |
1643 | 1640 | ||
1644 | #ifdef CONFIG_X86_32 | 1641 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index f62af7647ec9..a8a1a3d08d4d 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1217,10 +1217,13 @@ static void __init xen_pagetable_p2m_copy(void) | |||
1217 | static void __init xen_pagetable_init(void) | 1217 | static void __init xen_pagetable_init(void) |
1218 | { | 1218 | { |
1219 | paging_init(); | 1219 | paging_init(); |
1220 | xen_setup_shared_info(); | ||
1221 | #ifdef CONFIG_X86_64 | 1220 | #ifdef CONFIG_X86_64 |
1222 | xen_pagetable_p2m_copy(); | 1221 | xen_pagetable_p2m_copy(); |
1223 | #endif | 1222 | #endif |
1223 | /* Allocate and initialize top and mid mfn levels for p2m structure */ | ||
1224 | xen_build_mfn_list_list(); | ||
1225 | |||
1226 | xen_setup_shared_info(); | ||
1224 | xen_post_allocator_init(); | 1227 | xen_post_allocator_init(); |
1225 | } | 1228 | } |
1226 | static void xen_write_cr2(unsigned long cr2) | 1229 | static void xen_write_cr2(unsigned long cr2) |
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 9f5983b01ed9..b456b048eca9 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c | |||
@@ -163,6 +163,7 @@ | |||
163 | #include <linux/hash.h> | 163 | #include <linux/hash.h> |
164 | #include <linux/sched.h> | 164 | #include <linux/sched.h> |
165 | #include <linux/seq_file.h> | 165 | #include <linux/seq_file.h> |
166 | #include <linux/bootmem.h> | ||
166 | 167 | ||
167 | #include <asm/cache.h> | 168 | #include <asm/cache.h> |
168 | #include <asm/setup.h> | 169 | #include <asm/setup.h> |
@@ -181,21 +182,20 @@ static void __init m2p_override_init(void); | |||
181 | 182 | ||
182 | unsigned long xen_max_p2m_pfn __read_mostly; | 183 | unsigned long xen_max_p2m_pfn __read_mostly; |
183 | 184 | ||
185 | static unsigned long *p2m_mid_missing_mfn; | ||
186 | static unsigned long *p2m_top_mfn; | ||
187 | static unsigned long **p2m_top_mfn_p; | ||
188 | |||
184 | /* Placeholders for holes in the address space */ | 189 | /* Placeholders for holes in the address space */ |
185 | static RESERVE_BRK_ARRAY(unsigned long, p2m_missing, P2M_PER_PAGE); | 190 | static RESERVE_BRK_ARRAY(unsigned long, p2m_missing, P2M_PER_PAGE); |
186 | static RESERVE_BRK_ARRAY(unsigned long *, p2m_mid_missing, P2M_MID_PER_PAGE); | 191 | static RESERVE_BRK_ARRAY(unsigned long *, p2m_mid_missing, P2M_MID_PER_PAGE); |
187 | static RESERVE_BRK_ARRAY(unsigned long, p2m_mid_missing_mfn, P2M_MID_PER_PAGE); | ||
188 | 192 | ||
189 | static RESERVE_BRK_ARRAY(unsigned long **, p2m_top, P2M_TOP_PER_PAGE); | 193 | static RESERVE_BRK_ARRAY(unsigned long **, p2m_top, P2M_TOP_PER_PAGE); |
190 | static RESERVE_BRK_ARRAY(unsigned long, p2m_top_mfn, P2M_TOP_PER_PAGE); | ||
191 | static RESERVE_BRK_ARRAY(unsigned long *, p2m_top_mfn_p, P2M_TOP_PER_PAGE); | ||
192 | 194 | ||
193 | static RESERVE_BRK_ARRAY(unsigned long, p2m_identity, P2M_PER_PAGE); | 195 | static RESERVE_BRK_ARRAY(unsigned long, p2m_identity, P2M_PER_PAGE); |
194 | static RESERVE_BRK_ARRAY(unsigned long *, p2m_mid_identity, P2M_MID_PER_PAGE); | 196 | static RESERVE_BRK_ARRAY(unsigned long *, p2m_mid_identity, P2M_MID_PER_PAGE); |
195 | static RESERVE_BRK_ARRAY(unsigned long, p2m_mid_identity_mfn, P2M_MID_PER_PAGE); | ||
196 | 197 | ||
197 | RESERVE_BRK(p2m_mid, PAGE_SIZE * (MAX_DOMAIN_PAGES / (P2M_PER_PAGE * P2M_MID_PER_PAGE))); | 198 | RESERVE_BRK(p2m_mid, PAGE_SIZE * (MAX_DOMAIN_PAGES / (P2M_PER_PAGE * P2M_MID_PER_PAGE))); |
198 | RESERVE_BRK(p2m_mid_mfn, PAGE_SIZE * (MAX_DOMAIN_PAGES / (P2M_PER_PAGE * P2M_MID_PER_PAGE))); | ||
199 | 199 | ||
200 | /* For each I/O range remapped we may lose up to two leaf pages for the boundary | 200 | /* For each I/O range remapped we may lose up to two leaf pages for the boundary |
201 | * violations and three mid pages to cover up to 3GB. With | 201 | * violations and three mid pages to cover up to 3GB. With |
@@ -272,11 +272,11 @@ static void p2m_init(unsigned long *p2m) | |||
272 | * Build the parallel p2m_top_mfn and p2m_mid_mfn structures | 272 | * Build the parallel p2m_top_mfn and p2m_mid_mfn structures |
273 | * | 273 | * |
274 | * This is called both at boot time, and after resuming from suspend: | 274 | * This is called both at boot time, and after resuming from suspend: |
275 | * - At boot time we're called very early, and must use extend_brk() | 275 | * - At boot time we're called rather early, and must use alloc_bootmem*() |
276 | * to allocate memory. | 276 | * to allocate memory. |
277 | * | 277 | * |
278 | * - After resume we're called from within stop_machine, but the mfn | 278 | * - After resume we're called from within stop_machine, but the mfn |
279 | * tree should alreay be completely allocated. | 279 | * tree should already be completely allocated. |
280 | */ | 280 | */ |
281 | void __ref xen_build_mfn_list_list(void) | 281 | void __ref xen_build_mfn_list_list(void) |
282 | { | 282 | { |
@@ -287,20 +287,17 @@ void __ref xen_build_mfn_list_list(void) | |||
287 | 287 | ||
288 | /* Pre-initialize p2m_top_mfn to be completely missing */ | 288 | /* Pre-initialize p2m_top_mfn to be completely missing */ |
289 | if (p2m_top_mfn == NULL) { | 289 | if (p2m_top_mfn == NULL) { |
290 | p2m_mid_missing_mfn = extend_brk(PAGE_SIZE, PAGE_SIZE); | 290 | p2m_mid_missing_mfn = alloc_bootmem_align(PAGE_SIZE, PAGE_SIZE); |
291 | p2m_mid_mfn_init(p2m_mid_missing_mfn, p2m_missing); | 291 | p2m_mid_mfn_init(p2m_mid_missing_mfn, p2m_missing); |
292 | p2m_mid_identity_mfn = extend_brk(PAGE_SIZE, PAGE_SIZE); | ||
293 | p2m_mid_mfn_init(p2m_mid_identity_mfn, p2m_identity); | ||
294 | 292 | ||
295 | p2m_top_mfn_p = extend_brk(PAGE_SIZE, PAGE_SIZE); | 293 | p2m_top_mfn_p = alloc_bootmem_align(PAGE_SIZE, PAGE_SIZE); |
296 | p2m_top_mfn_p_init(p2m_top_mfn_p); | 294 | p2m_top_mfn_p_init(p2m_top_mfn_p); |
297 | 295 | ||
298 | p2m_top_mfn = extend_brk(PAGE_SIZE, PAGE_SIZE); | 296 | p2m_top_mfn = alloc_bootmem_align(PAGE_SIZE, PAGE_SIZE); |
299 | p2m_top_mfn_init(p2m_top_mfn); | 297 | p2m_top_mfn_init(p2m_top_mfn); |
300 | } else { | 298 | } else { |
301 | /* Reinitialise, mfn's all change after migration */ | 299 | /* Reinitialise, mfn's all change after migration */ |
302 | p2m_mid_mfn_init(p2m_mid_missing_mfn, p2m_missing); | 300 | p2m_mid_mfn_init(p2m_mid_missing_mfn, p2m_missing); |
303 | p2m_mid_mfn_init(p2m_mid_identity_mfn, p2m_identity); | ||
304 | } | 301 | } |
305 | 302 | ||
306 | for (pfn = 0; pfn < xen_max_p2m_pfn; pfn += P2M_PER_PAGE) { | 303 | for (pfn = 0; pfn < xen_max_p2m_pfn; pfn += P2M_PER_PAGE) { |
@@ -328,10 +325,9 @@ void __ref xen_build_mfn_list_list(void) | |||
328 | /* | 325 | /* |
329 | * XXX boot-time only! We should never find | 326 | * XXX boot-time only! We should never find |
330 | * missing parts of the mfn tree after | 327 | * missing parts of the mfn tree after |
331 | * runtime. extend_brk() will BUG if we call | 328 | * runtime. |
332 | * it too late. | ||
333 | */ | 329 | */ |
334 | mid_mfn_p = extend_brk(PAGE_SIZE, PAGE_SIZE); | 330 | mid_mfn_p = alloc_bootmem_align(PAGE_SIZE, PAGE_SIZE); |
335 | p2m_mid_mfn_init(mid_mfn_p, p2m_missing); | 331 | p2m_mid_mfn_init(mid_mfn_p, p2m_missing); |
336 | 332 | ||
337 | p2m_top_mfn_p[topidx] = mid_mfn_p; | 333 | p2m_top_mfn_p[topidx] = mid_mfn_p; |
@@ -415,7 +411,6 @@ void __init xen_build_dynamic_phys_to_machine(void) | |||
415 | m2p_override_init(); | 411 | m2p_override_init(); |
416 | } | 412 | } |
417 | #ifdef CONFIG_X86_64 | 413 | #ifdef CONFIG_X86_64 |
418 | #include <linux/bootmem.h> | ||
419 | unsigned long __init xen_revector_p2m_tree(void) | 414 | unsigned long __init xen_revector_p2m_tree(void) |
420 | { | 415 | { |
421 | unsigned long va_start; | 416 | unsigned long va_start; |
@@ -477,7 +472,6 @@ unsigned long __init xen_revector_p2m_tree(void) | |||
477 | 472 | ||
478 | copy_page(new, mid_p); | 473 | copy_page(new, mid_p); |
479 | p2m_top[topidx][mididx] = &mfn_list[pfn_free]; | 474 | p2m_top[topidx][mididx] = &mfn_list[pfn_free]; |
480 | p2m_top_mfn_p[topidx][mididx] = virt_to_mfn(&mfn_list[pfn_free]); | ||
481 | 475 | ||
482 | pfn_free += P2M_PER_PAGE; | 476 | pfn_free += P2M_PER_PAGE; |
483 | 477 | ||
@@ -538,12 +532,13 @@ static bool alloc_p2m(unsigned long pfn) | |||
538 | unsigned topidx, mididx; | 532 | unsigned topidx, mididx; |
539 | unsigned long ***top_p, **mid; | 533 | unsigned long ***top_p, **mid; |
540 | unsigned long *top_mfn_p, *mid_mfn; | 534 | unsigned long *top_mfn_p, *mid_mfn; |
535 | unsigned long *p2m_orig; | ||
541 | 536 | ||
542 | topidx = p2m_top_index(pfn); | 537 | topidx = p2m_top_index(pfn); |
543 | mididx = p2m_mid_index(pfn); | 538 | mididx = p2m_mid_index(pfn); |
544 | 539 | ||
545 | top_p = &p2m_top[topidx]; | 540 | top_p = &p2m_top[topidx]; |
546 | mid = *top_p; | 541 | mid = ACCESS_ONCE(*top_p); |
547 | 542 | ||
548 | if (mid == p2m_mid_missing) { | 543 | if (mid == p2m_mid_missing) { |
549 | /* Mid level is missing, allocate a new one */ | 544 | /* Mid level is missing, allocate a new one */ |
@@ -558,7 +553,7 @@ static bool alloc_p2m(unsigned long pfn) | |||
558 | } | 553 | } |
559 | 554 | ||
560 | top_mfn_p = &p2m_top_mfn[topidx]; | 555 | top_mfn_p = &p2m_top_mfn[topidx]; |
561 | mid_mfn = p2m_top_mfn_p[topidx]; | 556 | mid_mfn = ACCESS_ONCE(p2m_top_mfn_p[topidx]); |
562 | 557 | ||
563 | BUG_ON(virt_to_mfn(mid_mfn) != *top_mfn_p); | 558 | BUG_ON(virt_to_mfn(mid_mfn) != *top_mfn_p); |
564 | 559 | ||
@@ -566,6 +561,7 @@ static bool alloc_p2m(unsigned long pfn) | |||
566 | /* Separately check the mid mfn level */ | 561 | /* Separately check the mid mfn level */ |
567 | unsigned long missing_mfn; | 562 | unsigned long missing_mfn; |
568 | unsigned long mid_mfn_mfn; | 563 | unsigned long mid_mfn_mfn; |
564 | unsigned long old_mfn; | ||
569 | 565 | ||
570 | mid_mfn = alloc_p2m_page(); | 566 | mid_mfn = alloc_p2m_page(); |
571 | if (!mid_mfn) | 567 | if (!mid_mfn) |
@@ -575,17 +571,19 @@ static bool alloc_p2m(unsigned long pfn) | |||
575 | 571 | ||
576 | missing_mfn = virt_to_mfn(p2m_mid_missing_mfn); | 572 | missing_mfn = virt_to_mfn(p2m_mid_missing_mfn); |
577 | mid_mfn_mfn = virt_to_mfn(mid_mfn); | 573 | mid_mfn_mfn = virt_to_mfn(mid_mfn); |
578 | if (cmpxchg(top_mfn_p, missing_mfn, mid_mfn_mfn) != missing_mfn) | 574 | old_mfn = cmpxchg(top_mfn_p, missing_mfn, mid_mfn_mfn); |
575 | if (old_mfn != missing_mfn) { | ||
579 | free_p2m_page(mid_mfn); | 576 | free_p2m_page(mid_mfn); |
580 | else | 577 | mid_mfn = mfn_to_virt(old_mfn); |
578 | } else { | ||
581 | p2m_top_mfn_p[topidx] = mid_mfn; | 579 | p2m_top_mfn_p[topidx] = mid_mfn; |
580 | } | ||
582 | } | 581 | } |
583 | 582 | ||
584 | if (p2m_top[topidx][mididx] == p2m_identity || | 583 | p2m_orig = ACCESS_ONCE(p2m_top[topidx][mididx]); |
585 | p2m_top[topidx][mididx] == p2m_missing) { | 584 | if (p2m_orig == p2m_identity || p2m_orig == p2m_missing) { |
586 | /* p2m leaf page is missing */ | 585 | /* p2m leaf page is missing */ |
587 | unsigned long *p2m; | 586 | unsigned long *p2m; |
588 | unsigned long *p2m_orig = p2m_top[topidx][mididx]; | ||
589 | 587 | ||
590 | p2m = alloc_p2m_page(); | 588 | p2m = alloc_p2m_page(); |
591 | if (!p2m) | 589 | if (!p2m) |
@@ -606,7 +604,6 @@ static bool __init early_alloc_p2m(unsigned long pfn, bool check_boundary) | |||
606 | { | 604 | { |
607 | unsigned topidx, mididx, idx; | 605 | unsigned topidx, mididx, idx; |
608 | unsigned long *p2m; | 606 | unsigned long *p2m; |
609 | unsigned long *mid_mfn_p; | ||
610 | 607 | ||
611 | topidx = p2m_top_index(pfn); | 608 | topidx = p2m_top_index(pfn); |
612 | mididx = p2m_mid_index(pfn); | 609 | mididx = p2m_mid_index(pfn); |
@@ -633,43 +630,21 @@ static bool __init early_alloc_p2m(unsigned long pfn, bool check_boundary) | |||
633 | 630 | ||
634 | p2m_top[topidx][mididx] = p2m; | 631 | p2m_top[topidx][mididx] = p2m; |
635 | 632 | ||
636 | /* For save/restore we need to MFN of the P2M saved */ | ||
637 | |||
638 | mid_mfn_p = p2m_top_mfn_p[topidx]; | ||
639 | WARN(mid_mfn_p[mididx] != virt_to_mfn(p2m_missing), | ||
640 | "P2M_TOP_P[%d][%d] != MFN of p2m_missing!\n", | ||
641 | topidx, mididx); | ||
642 | mid_mfn_p[mididx] = virt_to_mfn(p2m); | ||
643 | |||
644 | return true; | 633 | return true; |
645 | } | 634 | } |
646 | 635 | ||
647 | static bool __init early_alloc_p2m_middle(unsigned long pfn) | 636 | static bool __init early_alloc_p2m_middle(unsigned long pfn) |
648 | { | 637 | { |
649 | unsigned topidx = p2m_top_index(pfn); | 638 | unsigned topidx = p2m_top_index(pfn); |
650 | unsigned long *mid_mfn_p; | ||
651 | unsigned long **mid; | 639 | unsigned long **mid; |
652 | 640 | ||
653 | mid = p2m_top[topidx]; | 641 | mid = p2m_top[topidx]; |
654 | mid_mfn_p = p2m_top_mfn_p[topidx]; | ||
655 | if (mid == p2m_mid_missing) { | 642 | if (mid == p2m_mid_missing) { |
656 | mid = extend_brk(PAGE_SIZE, PAGE_SIZE); | 643 | mid = extend_brk(PAGE_SIZE, PAGE_SIZE); |
657 | 644 | ||
658 | p2m_mid_init(mid, p2m_missing); | 645 | p2m_mid_init(mid, p2m_missing); |
659 | 646 | ||
660 | p2m_top[topidx] = mid; | 647 | p2m_top[topidx] = mid; |
661 | |||
662 | BUG_ON(mid_mfn_p != p2m_mid_missing_mfn); | ||
663 | } | ||
664 | /* And the save/restore P2M tables.. */ | ||
665 | if (mid_mfn_p == p2m_mid_missing_mfn) { | ||
666 | mid_mfn_p = extend_brk(PAGE_SIZE, PAGE_SIZE); | ||
667 | p2m_mid_mfn_init(mid_mfn_p, p2m_missing); | ||
668 | |||
669 | p2m_top_mfn_p[topidx] = mid_mfn_p; | ||
670 | p2m_top_mfn[topidx] = virt_to_mfn(mid_mfn_p); | ||
671 | /* Note: we don't set mid_mfn_p[midix] here, | ||
672 | * look in early_alloc_p2m() */ | ||
673 | } | 648 | } |
674 | return true; | 649 | return true; |
675 | } | 650 | } |
@@ -680,14 +655,13 @@ static bool __init early_alloc_p2m_middle(unsigned long pfn) | |||
680 | * replace the P2M leaf with a p2m_missing or p2m_identity. | 655 | * replace the P2M leaf with a p2m_missing or p2m_identity. |
681 | * Stick the old page in the new P2M tree location. | 656 | * Stick the old page in the new P2M tree location. |
682 | */ | 657 | */ |
683 | bool __init early_can_reuse_p2m_middle(unsigned long set_pfn, unsigned long set_mfn) | 658 | static bool __init early_can_reuse_p2m_middle(unsigned long set_pfn) |
684 | { | 659 | { |
685 | unsigned topidx; | 660 | unsigned topidx; |
686 | unsigned mididx; | 661 | unsigned mididx; |
687 | unsigned ident_pfns; | 662 | unsigned ident_pfns; |
688 | unsigned inv_pfns; | 663 | unsigned inv_pfns; |
689 | unsigned long *p2m; | 664 | unsigned long *p2m; |
690 | unsigned long *mid_mfn_p; | ||
691 | unsigned idx; | 665 | unsigned idx; |
692 | unsigned long pfn; | 666 | unsigned long pfn; |
693 | 667 | ||
@@ -733,11 +707,6 @@ bool __init early_can_reuse_p2m_middle(unsigned long set_pfn, unsigned long set_ | |||
733 | found: | 707 | found: |
734 | /* Found one, replace old with p2m_identity or p2m_missing */ | 708 | /* Found one, replace old with p2m_identity or p2m_missing */ |
735 | p2m_top[topidx][mididx] = (ident_pfns ? p2m_identity : p2m_missing); | 709 | p2m_top[topidx][mididx] = (ident_pfns ? p2m_identity : p2m_missing); |
736 | /* And the other for save/restore.. */ | ||
737 | mid_mfn_p = p2m_top_mfn_p[topidx]; | ||
738 | /* NOTE: Even if it is a p2m_identity it should still be point to | ||
739 | * a page filled with INVALID_P2M_ENTRY entries. */ | ||
740 | mid_mfn_p[mididx] = virt_to_mfn(p2m_missing); | ||
741 | 710 | ||
742 | /* Reset where we want to stick the old page in. */ | 711 | /* Reset where we want to stick the old page in. */ |
743 | topidx = p2m_top_index(set_pfn); | 712 | topidx = p2m_top_index(set_pfn); |
@@ -752,8 +721,6 @@ found: | |||
752 | 721 | ||
753 | p2m_init(p2m); | 722 | p2m_init(p2m); |
754 | p2m_top[topidx][mididx] = p2m; | 723 | p2m_top[topidx][mididx] = p2m; |
755 | mid_mfn_p = p2m_top_mfn_p[topidx]; | ||
756 | mid_mfn_p[mididx] = virt_to_mfn(p2m); | ||
757 | 724 | ||
758 | return true; | 725 | return true; |
759 | } | 726 | } |
@@ -763,7 +730,7 @@ bool __init early_set_phys_to_machine(unsigned long pfn, unsigned long mfn) | |||
763 | if (!early_alloc_p2m_middle(pfn)) | 730 | if (!early_alloc_p2m_middle(pfn)) |
764 | return false; | 731 | return false; |
765 | 732 | ||
766 | if (early_can_reuse_p2m_middle(pfn, mfn)) | 733 | if (early_can_reuse_p2m_middle(pfn)) |
767 | return __set_phys_to_machine(pfn, mfn); | 734 | return __set_phys_to_machine(pfn, mfn); |
768 | 735 | ||
769 | if (!early_alloc_p2m(pfn, false /* boundary crossover OK!*/)) | 736 | if (!early_alloc_p2m(pfn, false /* boundary crossover OK!*/)) |
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index af7216128d93..29834b3fd87f 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -595,6 +595,7 @@ char * __init xen_memory_setup(void) | |||
595 | rc = 0; | 595 | rc = 0; |
596 | } | 596 | } |
597 | BUG_ON(rc); | 597 | BUG_ON(rc); |
598 | BUG_ON(memmap.nr_entries == 0); | ||
598 | 599 | ||
599 | /* | 600 | /* |
600 | * Xen won't allow a 1:1 mapping to be created to UNUSABLE | 601 | * Xen won't allow a 1:1 mapping to be created to UNUSABLE |
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index a1d430b112b3..f473d268d387 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
@@ -158,7 +158,7 @@ cycle_t xen_clocksource_read(void) | |||
158 | cycle_t ret; | 158 | cycle_t ret; |
159 | 159 | ||
160 | preempt_disable_notrace(); | 160 | preempt_disable_notrace(); |
161 | src = this_cpu_ptr(&xen_vcpu->time); | 161 | src = &__this_cpu_read(xen_vcpu)->time; |
162 | ret = pvclock_clocksource_read(src); | 162 | ret = pvclock_clocksource_read(src); |
163 | preempt_enable_notrace(); | 163 | preempt_enable_notrace(); |
164 | return ret; | 164 | return ret; |
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c index 562fac664751..4d54b481123b 100644 --- a/arch/xtensa/kernel/ptrace.c +++ b/arch/xtensa/kernel/ptrace.c | |||
@@ -342,7 +342,7 @@ void do_syscall_trace_enter(struct pt_regs *regs) | |||
342 | do_syscall_trace(); | 342 | do_syscall_trace(); |
343 | 343 | ||
344 | #if 0 | 344 | #if 0 |
345 | audit_syscall_entry(current, AUDIT_ARCH_XTENSA..); | 345 | audit_syscall_entry(...); |
346 | #endif | 346 | #endif |
347 | } | 347 | } |
348 | 348 | ||