diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-04 13:17:45 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-04 13:17:45 -0400 |
| commit | 0a23ea65ce9f10ec2ea392571006b781b150327f (patch) | |
| tree | 1906d633c94131ed850b8b8b0672bc774b694697 | |
| parent | c63716ab4d77f3df7d12260fc62cbf847c2a85d1 (diff) | |
| parent | 0ede1c401332173ab0693121dc6cde04a4dbf131 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc fixes from David Miller:
- block interrupts properly across the entire MMU context change (both
the hw MMU context change and the TSB table change) so that we don't
get a perf event interrupt in the middle. From Rob Gardner.
- be sure to register hugepages early enough, from Nitin Gupta.
- UltraSPARC-III user copy exception handling would return garbage for
the copied length in some circumstances.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
sparc64: Fix exception handling in UltraSPARC-III memcpy.
sbus: Convert to using %pOF instead of full_name
sparc: defconfig: Cleanup from old Kconfig options
sparc64: Register hugepages during arch init
sparc64: Prevent perf from running during super critical sections
| -rw-r--r-- | arch/sparc/configs/sparc32_defconfig | 4 | ||||
| -rw-r--r-- | arch/sparc/configs/sparc64_defconfig | 4 | ||||
| -rw-r--r-- | arch/sparc/include/asm/mmu_context_64.h | 14 | ||||
| -rw-r--r-- | arch/sparc/kernel/tsb.S | 12 | ||||
| -rw-r--r-- | arch/sparc/lib/U3memcpy.S | 4 | ||||
| -rw-r--r-- | arch/sparc/mm/init_64.c | 25 | ||||
| -rw-r--r-- | arch/sparc/power/hibernate.c | 3 | ||||
| -rw-r--r-- | drivers/sbus/char/display7seg.c | 4 | ||||
| -rw-r--r-- | drivers/sbus/char/flash.c | 4 | ||||
| -rw-r--r-- | drivers/sbus/char/uctrl.c | 4 |
10 files changed, 54 insertions, 24 deletions
diff --git a/arch/sparc/configs/sparc32_defconfig b/arch/sparc/configs/sparc32_defconfig index c74d3701ad68..207a43a2d8b3 100644 --- a/arch/sparc/configs/sparc32_defconfig +++ b/arch/sparc/configs/sparc32_defconfig | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | 1 | CONFIG_SYSVIPC=y |
| 3 | CONFIG_POSIX_MQUEUE=y | 2 | CONFIG_POSIX_MQUEUE=y |
| 4 | CONFIG_LOG_BUF_SHIFT=14 | 3 | CONFIG_LOG_BUF_SHIFT=14 |
| @@ -23,7 +22,6 @@ CONFIG_IP_PNP_DHCP=y | |||
| 23 | CONFIG_INET_AH=y | 22 | CONFIG_INET_AH=y |
| 24 | CONFIG_INET_ESP=y | 23 | CONFIG_INET_ESP=y |
| 25 | CONFIG_INET_IPCOMP=y | 24 | CONFIG_INET_IPCOMP=y |
| 26 | # CONFIG_INET_LRO is not set | ||
| 27 | CONFIG_INET6_AH=m | 25 | CONFIG_INET6_AH=m |
| 28 | CONFIG_INET6_ESP=m | 26 | CONFIG_INET6_ESP=m |
| 29 | CONFIG_INET6_IPCOMP=m | 27 | CONFIG_INET6_IPCOMP=m |
| @@ -69,7 +67,6 @@ CONFIG_EXT2_FS=y | |||
| 69 | CONFIG_EXT2_FS_XATTR=y | 67 | CONFIG_EXT2_FS_XATTR=y |
| 70 | CONFIG_EXT2_FS_POSIX_ACL=y | 68 | CONFIG_EXT2_FS_POSIX_ACL=y |
| 71 | CONFIG_EXT2_FS_SECURITY=y | 69 | CONFIG_EXT2_FS_SECURITY=y |
| 72 | CONFIG_AUTOFS_FS=m | ||
| 73 | CONFIG_AUTOFS4_FS=m | 70 | CONFIG_AUTOFS4_FS=m |
| 74 | CONFIG_ISO9660_FS=m | 71 | CONFIG_ISO9660_FS=m |
| 75 | CONFIG_PROC_KCORE=y | 72 | CONFIG_PROC_KCORE=y |
| @@ -82,7 +79,6 @@ CONFIG_NLS=y | |||
| 82 | CONFIG_DEBUG_KERNEL=y | 79 | CONFIG_DEBUG_KERNEL=y |
| 83 | CONFIG_DETECT_HUNG_TASK=y | 80 | CONFIG_DETECT_HUNG_TASK=y |
| 84 | # CONFIG_SCHED_DEBUG is not set | 81 | # CONFIG_SCHED_DEBUG is not set |
| 85 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
| 86 | CONFIG_KGDB=y | 82 | CONFIG_KGDB=y |
| 87 | CONFIG_KGDB_TESTS=y | 83 | CONFIG_KGDB_TESTS=y |
| 88 | CONFIG_CRYPTO_NULL=m | 84 | CONFIG_CRYPTO_NULL=m |
diff --git a/arch/sparc/configs/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig index b2e650d1764f..ca8609d7292f 100644 --- a/arch/sparc/configs/sparc64_defconfig +++ b/arch/sparc/configs/sparc64_defconfig | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | CONFIG_64BIT=y | 1 | CONFIG_64BIT=y |
| 2 | CONFIG_EXPERIMENTAL=y | ||
| 3 | # CONFIG_LOCALVERSION_AUTO is not set | 2 | # CONFIG_LOCALVERSION_AUTO is not set |
| 4 | CONFIG_SYSVIPC=y | 3 | CONFIG_SYSVIPC=y |
| 5 | CONFIG_POSIX_MQUEUE=y | 4 | CONFIG_POSIX_MQUEUE=y |
| @@ -184,7 +183,6 @@ CONFIG_HID_TOPSEED=y | |||
| 184 | CONFIG_HID_THRUSTMASTER=y | 183 | CONFIG_HID_THRUSTMASTER=y |
| 185 | CONFIG_HID_ZEROPLUS=y | 184 | CONFIG_HID_ZEROPLUS=y |
| 186 | CONFIG_USB=y | 185 | CONFIG_USB=y |
| 187 | # CONFIG_USB_DEVICE_CLASS is not set | ||
| 188 | CONFIG_USB_EHCI_HCD=m | 186 | CONFIG_USB_EHCI_HCD=m |
| 189 | # CONFIG_USB_EHCI_TT_NEWSCHED is not set | 187 | # CONFIG_USB_EHCI_TT_NEWSCHED is not set |
| 190 | CONFIG_USB_OHCI_HCD=y | 188 | CONFIG_USB_OHCI_HCD=y |
| @@ -210,8 +208,6 @@ CONFIG_LOCKUP_DETECTOR=y | |||
| 210 | CONFIG_DETECT_HUNG_TASK=y | 208 | CONFIG_DETECT_HUNG_TASK=y |
| 211 | # CONFIG_SCHED_DEBUG is not set | 209 | # CONFIG_SCHED_DEBUG is not set |
| 212 | CONFIG_SCHEDSTATS=y | 210 | CONFIG_SCHEDSTATS=y |
| 213 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
| 214 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
| 215 | CONFIG_BLK_DEV_IO_TRACE=y | 211 | CONFIG_BLK_DEV_IO_TRACE=y |
| 216 | CONFIG_UPROBE_EVENTS=y | 212 | CONFIG_UPROBE_EVENTS=y |
| 217 | CONFIG_KEYS=y | 213 | CONFIG_KEYS=y |
diff --git a/arch/sparc/include/asm/mmu_context_64.h b/arch/sparc/include/asm/mmu_context_64.h index 2cddcda4f85f..87841d687f8d 100644 --- a/arch/sparc/include/asm/mmu_context_64.h +++ b/arch/sparc/include/asm/mmu_context_64.h | |||
| @@ -27,9 +27,11 @@ void destroy_context(struct mm_struct *mm); | |||
| 27 | void __tsb_context_switch(unsigned long pgd_pa, | 27 | void __tsb_context_switch(unsigned long pgd_pa, |
| 28 | struct tsb_config *tsb_base, | 28 | struct tsb_config *tsb_base, |
| 29 | struct tsb_config *tsb_huge, | 29 | struct tsb_config *tsb_huge, |
| 30 | unsigned long tsb_descr_pa); | 30 | unsigned long tsb_descr_pa, |
| 31 | unsigned long secondary_ctx); | ||
| 31 | 32 | ||
| 32 | static inline void tsb_context_switch(struct mm_struct *mm) | 33 | static inline void tsb_context_switch_ctx(struct mm_struct *mm, |
| 34 | unsigned long ctx) | ||
| 33 | { | 35 | { |
| 34 | __tsb_context_switch(__pa(mm->pgd), | 36 | __tsb_context_switch(__pa(mm->pgd), |
| 35 | &mm->context.tsb_block[MM_TSB_BASE], | 37 | &mm->context.tsb_block[MM_TSB_BASE], |
| @@ -40,9 +42,12 @@ static inline void tsb_context_switch(struct mm_struct *mm) | |||
| 40 | #else | 42 | #else |
| 41 | NULL | 43 | NULL |
| 42 | #endif | 44 | #endif |
| 43 | , __pa(&mm->context.tsb_descr[MM_TSB_BASE])); | 45 | , __pa(&mm->context.tsb_descr[MM_TSB_BASE]), |
| 46 | ctx); | ||
| 44 | } | 47 | } |
| 45 | 48 | ||
| 49 | #define tsb_context_switch(X) tsb_context_switch_ctx(X, 0) | ||
| 50 | |||
| 46 | void tsb_grow(struct mm_struct *mm, | 51 | void tsb_grow(struct mm_struct *mm, |
| 47 | unsigned long tsb_index, | 52 | unsigned long tsb_index, |
| 48 | unsigned long mm_rss); | 53 | unsigned long mm_rss); |
| @@ -112,8 +117,7 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str | |||
| 112 | * cpu0 to update it's TSB because at that point the cpu_vm_mask | 117 | * cpu0 to update it's TSB because at that point the cpu_vm_mask |
| 113 | * only had cpu1 set in it. | 118 | * only had cpu1 set in it. |
| 114 | */ | 119 | */ |
| 115 | load_secondary_context(mm); | 120 | tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context)); |
| 116 | tsb_context_switch(mm); | ||
| 117 | 121 | ||
| 118 | /* Any time a processor runs a context on an address space | 122 | /* Any time a processor runs a context on an address space |
| 119 | * for the first time, we must flush that context out of the | 123 | * for the first time, we must flush that context out of the |
diff --git a/arch/sparc/kernel/tsb.S b/arch/sparc/kernel/tsb.S index 07c0df924960..db872dbfafe9 100644 --- a/arch/sparc/kernel/tsb.S +++ b/arch/sparc/kernel/tsb.S | |||
| @@ -360,6 +360,7 @@ tsb_flush: | |||
| 360 | * %o1: TSB base config pointer | 360 | * %o1: TSB base config pointer |
| 361 | * %o2: TSB huge config pointer, or NULL if none | 361 | * %o2: TSB huge config pointer, or NULL if none |
| 362 | * %o3: Hypervisor TSB descriptor physical address | 362 | * %o3: Hypervisor TSB descriptor physical address |
| 363 | * %o4: Secondary context to load, if non-zero | ||
| 363 | * | 364 | * |
| 364 | * We have to run this whole thing with interrupts | 365 | * We have to run this whole thing with interrupts |
| 365 | * disabled so that the current cpu doesn't change | 366 | * disabled so that the current cpu doesn't change |
| @@ -372,6 +373,17 @@ __tsb_context_switch: | |||
| 372 | rdpr %pstate, %g1 | 373 | rdpr %pstate, %g1 |
| 373 | wrpr %g1, PSTATE_IE, %pstate | 374 | wrpr %g1, PSTATE_IE, %pstate |
| 374 | 375 | ||
| 376 | brz,pn %o4, 1f | ||
| 377 | mov SECONDARY_CONTEXT, %o5 | ||
| 378 | |||
| 379 | 661: stxa %o4, [%o5] ASI_DMMU | ||
| 380 | .section .sun4v_1insn_patch, "ax" | ||
| 381 | .word 661b | ||
| 382 | stxa %o4, [%o5] ASI_MMU | ||
| 383 | .previous | ||
| 384 | flush %g6 | ||
| 385 | |||
| 386 | 1: | ||
| 375 | TRAP_LOAD_TRAP_BLOCK(%g2, %g3) | 387 | TRAP_LOAD_TRAP_BLOCK(%g2, %g3) |
| 376 | 388 | ||
| 377 | stx %o0, [%g2 + TRAP_PER_CPU_PGD_PADDR] | 389 | stx %o0, [%g2 + TRAP_PER_CPU_PGD_PADDR] |
diff --git a/arch/sparc/lib/U3memcpy.S b/arch/sparc/lib/U3memcpy.S index 54f98706b03b..5a8cb37f0a3b 100644 --- a/arch/sparc/lib/U3memcpy.S +++ b/arch/sparc/lib/U3memcpy.S | |||
| @@ -145,13 +145,13 @@ ENDPROC(U3_retl_o2_plus_GS_plus_0x08) | |||
| 145 | ENTRY(U3_retl_o2_and_7_plus_GS) | 145 | ENTRY(U3_retl_o2_and_7_plus_GS) |
| 146 | and %o2, 7, %o2 | 146 | and %o2, 7, %o2 |
| 147 | retl | 147 | retl |
| 148 | add %o2, GLOBAL_SPARE, %o2 | 148 | add %o2, GLOBAL_SPARE, %o0 |
| 149 | ENDPROC(U3_retl_o2_and_7_plus_GS) | 149 | ENDPROC(U3_retl_o2_and_7_plus_GS) |
| 150 | ENTRY(U3_retl_o2_and_7_plus_GS_plus_8) | 150 | ENTRY(U3_retl_o2_and_7_plus_GS_plus_8) |
| 151 | add GLOBAL_SPARE, 8, GLOBAL_SPARE | 151 | add GLOBAL_SPARE, 8, GLOBAL_SPARE |
| 152 | and %o2, 7, %o2 | 152 | and %o2, 7, %o2 |
| 153 | retl | 153 | retl |
| 154 | add %o2, GLOBAL_SPARE, %o2 | 154 | add %o2, GLOBAL_SPARE, %o0 |
| 155 | ENDPROC(U3_retl_o2_and_7_plus_GS_plus_8) | 155 | ENDPROC(U3_retl_o2_and_7_plus_GS_plus_8) |
| 156 | #endif | 156 | #endif |
| 157 | 157 | ||
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 3c40ebd50f92..fed73f14aa49 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
| @@ -325,6 +325,29 @@ static void __update_mmu_tsb_insert(struct mm_struct *mm, unsigned long tsb_inde | |||
| 325 | } | 325 | } |
| 326 | 326 | ||
| 327 | #ifdef CONFIG_HUGETLB_PAGE | 327 | #ifdef CONFIG_HUGETLB_PAGE |
| 328 | static void __init add_huge_page_size(unsigned long size) | ||
| 329 | { | ||
| 330 | unsigned int order; | ||
| 331 | |||
| 332 | if (size_to_hstate(size)) | ||
| 333 | return; | ||
| 334 | |||
| 335 | order = ilog2(size) - PAGE_SHIFT; | ||
| 336 | hugetlb_add_hstate(order); | ||
| 337 | } | ||
| 338 | |||
| 339 | static int __init hugetlbpage_init(void) | ||
| 340 | { | ||
| 341 | add_huge_page_size(1UL << HPAGE_64K_SHIFT); | ||
| 342 | add_huge_page_size(1UL << HPAGE_SHIFT); | ||
| 343 | add_huge_page_size(1UL << HPAGE_256MB_SHIFT); | ||
| 344 | add_huge_page_size(1UL << HPAGE_2GB_SHIFT); | ||
| 345 | |||
| 346 | return 0; | ||
| 347 | } | ||
| 348 | |||
| 349 | arch_initcall(hugetlbpage_init); | ||
| 350 | |||
| 328 | static int __init setup_hugepagesz(char *string) | 351 | static int __init setup_hugepagesz(char *string) |
| 329 | { | 352 | { |
| 330 | unsigned long long hugepage_size; | 353 | unsigned long long hugepage_size; |
| @@ -364,7 +387,7 @@ static int __init setup_hugepagesz(char *string) | |||
| 364 | goto out; | 387 | goto out; |
| 365 | } | 388 | } |
| 366 | 389 | ||
| 367 | hugetlb_add_hstate(hugepage_shift - PAGE_SHIFT); | 390 | add_huge_page_size(hugepage_size); |
| 368 | rc = 1; | 391 | rc = 1; |
| 369 | 392 | ||
| 370 | out: | 393 | out: |
diff --git a/arch/sparc/power/hibernate.c b/arch/sparc/power/hibernate.c index 17bd2e167e07..df707a8ad311 100644 --- a/arch/sparc/power/hibernate.c +++ b/arch/sparc/power/hibernate.c | |||
| @@ -35,6 +35,5 @@ void restore_processor_state(void) | |||
| 35 | { | 35 | { |
| 36 | struct mm_struct *mm = current->active_mm; | 36 | struct mm_struct *mm = current->active_mm; |
| 37 | 37 | ||
| 38 | load_secondary_context(mm); | 38 | tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context)); |
| 39 | tsb_context_switch(mm); | ||
| 40 | } | 39 | } |
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c index 04efed171c88..f32765d3cbd8 100644 --- a/drivers/sbus/char/display7seg.c +++ b/drivers/sbus/char/display7seg.c | |||
| @@ -212,8 +212,8 @@ static int d7s_probe(struct platform_device *op) | |||
| 212 | 212 | ||
| 213 | writeb(regs, p->regs); | 213 | writeb(regs, p->regs); |
| 214 | 214 | ||
| 215 | printk(KERN_INFO PFX "7-Segment Display%s at [%s:0x%llx] %s\n", | 215 | printk(KERN_INFO PFX "7-Segment Display%pOF at [%s:0x%llx] %s\n", |
| 216 | op->dev.of_node->full_name, | 216 | op->dev.of_node, |
| 217 | (regs & D7S_FLIP) ? " (FLIPPED)" : "", | 217 | (regs & D7S_FLIP) ? " (FLIPPED)" : "", |
| 218 | op->resource[0].start, | 218 | op->resource[0].start, |
| 219 | sol_compat ? "in sol_compat mode" : ""); | 219 | sol_compat ? "in sol_compat mode" : ""); |
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index 216f923161d1..a610b8d3d11f 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c | |||
| @@ -181,8 +181,8 @@ static int flash_probe(struct platform_device *op) | |||
| 181 | } | 181 | } |
| 182 | flash.busy = 0; | 182 | flash.busy = 0; |
| 183 | 183 | ||
| 184 | printk(KERN_INFO "%s: OBP Flash, RD %lx[%lx] WR %lx[%lx]\n", | 184 | printk(KERN_INFO "%pOF: OBP Flash, RD %lx[%lx] WR %lx[%lx]\n", |
| 185 | op->dev.of_node->full_name, | 185 | op->dev.of_node, |
| 186 | flash.read_base, flash.read_size, | 186 | flash.read_base, flash.read_size, |
| 187 | flash.write_base, flash.write_size); | 187 | flash.write_base, flash.write_size); |
| 188 | 188 | ||
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index 57696fc0b482..0a5013350acd 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c | |||
| @@ -379,8 +379,8 @@ static int uctrl_probe(struct platform_device *op) | |||
| 379 | } | 379 | } |
| 380 | 380 | ||
| 381 | sbus_writel(UCTRL_INTR_RXNE_REQ|UCTRL_INTR_RXNE_MSK, &p->regs->uctrl_intr); | 381 | sbus_writel(UCTRL_INTR_RXNE_REQ|UCTRL_INTR_RXNE_MSK, &p->regs->uctrl_intr); |
| 382 | printk(KERN_INFO "%s: uctrl regs[0x%p] (irq %d)\n", | 382 | printk(KERN_INFO "%pOF: uctrl regs[0x%p] (irq %d)\n", |
| 383 | op->dev.of_node->full_name, p->regs, p->irq); | 383 | op->dev.of_node, p->regs, p->irq); |
| 384 | uctrl_get_event_status(p); | 384 | uctrl_get_event_status(p); |
| 385 | uctrl_get_external_status(p); | 385 | uctrl_get_external_status(p); |
| 386 | 386 | ||
