Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+54 -24
-4
arch/sparc/configs/sparc32_defconfig
··· 1 - CONFIG_EXPERIMENTAL=y 2 1 CONFIG_SYSVIPC=y 3 2 CONFIG_POSIX_MQUEUE=y 4 3 CONFIG_LOG_BUF_SHIFT=14 ··· 22 23 CONFIG_INET_AH=y 23 24 CONFIG_INET_ESP=y 24 25 CONFIG_INET_IPCOMP=y 25 - # CONFIG_INET_LRO is not set 26 26 CONFIG_INET6_AH=m 27 27 CONFIG_INET6_ESP=m 28 28 CONFIG_INET6_IPCOMP=m ··· 67 69 CONFIG_EXT2_FS_XATTR=y 68 70 CONFIG_EXT2_FS_POSIX_ACL=y 69 71 CONFIG_EXT2_FS_SECURITY=y 70 - CONFIG_AUTOFS_FS=m 71 72 CONFIG_AUTOFS4_FS=m 72 73 CONFIG_ISO9660_FS=m 73 74 CONFIG_PROC_KCORE=y ··· 79 82 CONFIG_DEBUG_KERNEL=y 80 83 CONFIG_DETECT_HUNG_TASK=y 81 84 # CONFIG_SCHED_DEBUG is not set 82 - # CONFIG_RCU_CPU_STALL_DETECTOR is not set 83 85 CONFIG_KGDB=y 84 86 CONFIG_KGDB_TESTS=y 85 87 CONFIG_CRYPTO_NULL=m
-4
arch/sparc/configs/sparc64_defconfig
··· 1 1 CONFIG_64BIT=y 2 - CONFIG_EXPERIMENTAL=y 3 2 # CONFIG_LOCALVERSION_AUTO is not set 4 3 CONFIG_SYSVIPC=y 5 4 CONFIG_POSIX_MQUEUE=y ··· 183 184 CONFIG_HID_THRUSTMASTER=y 184 185 CONFIG_HID_ZEROPLUS=y 185 186 CONFIG_USB=y 186 - # CONFIG_USB_DEVICE_CLASS is not set 187 187 CONFIG_USB_EHCI_HCD=m 188 188 # CONFIG_USB_EHCI_TT_NEWSCHED is not set 189 189 CONFIG_USB_OHCI_HCD=y ··· 208 210 CONFIG_DETECT_HUNG_TASK=y 209 211 # CONFIG_SCHED_DEBUG is not set 210 212 CONFIG_SCHEDSTATS=y 211 - # CONFIG_RCU_CPU_STALL_DETECTOR is not set 212 - CONFIG_SYSCTL_SYSCALL_CHECK=y 213 213 CONFIG_BLK_DEV_IO_TRACE=y 214 214 CONFIG_UPROBE_EVENTS=y 215 215 CONFIG_KEYS=y
+9 -5
arch/sparc/include/asm/mmu_context_64.h
··· 27 27 void __tsb_context_switch(unsigned long pgd_pa, 28 28 struct tsb_config *tsb_base, 29 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 36 __tsb_context_switch(__pa(mm->pgd), 35 37 &mm->context.tsb_block[MM_TSB_BASE], ··· 42 40 #else 43 41 NULL 44 42 #endif 45 - , __pa(&mm->context.tsb_descr[MM_TSB_BASE])); 43 + , __pa(&mm->context.tsb_descr[MM_TSB_BASE]), 44 + ctx); 46 45 } 46 + 47 + #define tsb_context_switch(X) tsb_context_switch_ctx(X, 0) 47 48 48 49 void tsb_grow(struct mm_struct *mm, 49 50 unsigned long tsb_index, ··· 117 112 * cpu0 to update it's TSB because at that point the cpu_vm_mask 118 113 * only had cpu1 set in it. 119 114 */ 120 - load_secondary_context(mm); 121 - tsb_context_switch(mm); 115 + tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context)); 122 116 123 117 /* Any time a processor runs a context on an address space 124 118 * for the first time, we must flush that context out of the
+12
arch/sparc/kernel/tsb.S
··· 360 360 * %o1: TSB base config pointer 361 361 * %o2: TSB huge config pointer, or NULL if none 362 362 * %o3: Hypervisor TSB descriptor physical address 363 + * %o4: Secondary context to load, if non-zero 363 364 * 364 365 * We have to run this whole thing with interrupts 365 366 * disabled so that the current cpu doesn't change ··· 373 372 rdpr %pstate, %g1 374 373 wrpr %g1, PSTATE_IE, %pstate 375 374 375 + brz,pn %o4, 1f 376 + mov SECONDARY_CONTEXT, %o5 377 + 378 + 661: stxa %o4, [%o5] ASI_DMMU 379 + .section .sun4v_1insn_patch, "ax" 380 + .word 661b 381 + stxa %o4, [%o5] ASI_MMU 382 + .previous 383 + flush %g6 384 + 385 + 1: 376 386 TRAP_LOAD_TRAP_BLOCK(%g2, %g3) 377 387 378 388 stx %o0, [%g2 + TRAP_PER_CPU_PGD_PADDR]
+2 -2
arch/sparc/lib/U3memcpy.S
··· 145 145 ENTRY(U3_retl_o2_and_7_plus_GS) 146 146 and %o2, 7, %o2 147 147 retl 148 - add %o2, GLOBAL_SPARE, %o2 148 + add %o2, GLOBAL_SPARE, %o0 149 149 ENDPROC(U3_retl_o2_and_7_plus_GS) 150 150 ENTRY(U3_retl_o2_and_7_plus_GS_plus_8) 151 151 add GLOBAL_SPARE, 8, GLOBAL_SPARE 152 152 and %o2, 7, %o2 153 153 retl 154 - add %o2, GLOBAL_SPARE, %o2 154 + add %o2, GLOBAL_SPARE, %o0 155 155 ENDPROC(U3_retl_o2_and_7_plus_GS_plus_8) 156 156 #endif 157 157
+24 -1
arch/sparc/mm/init_64.c
··· 325 325 } 326 326 327 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 351 static int __init setup_hugepagesz(char *string) 329 352 { 330 353 unsigned long long hugepage_size; ··· 387 364 goto out; 388 365 } 389 366 390 - hugetlb_add_hstate(hugepage_shift - PAGE_SHIFT); 367 + add_huge_page_size(hugepage_size); 391 368 rc = 1; 392 369 393 370 out:
+1 -2
arch/sparc/power/hibernate.c
··· 35 35 { 36 36 struct mm_struct *mm = current->active_mm; 37 37 38 - load_secondary_context(mm); 39 - tsb_context_switch(mm); 38 + tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context)); 40 39 }
+2 -2
drivers/sbus/char/display7seg.c
··· 212 212 213 213 writeb(regs, p->regs); 214 214 215 - printk(KERN_INFO PFX "7-Segment Display%s at [%s:0x%llx] %s\n", 216 - op->dev.of_node->full_name, 215 + printk(KERN_INFO PFX "7-Segment Display%pOF at [%s:0x%llx] %s\n", 216 + op->dev.of_node, 217 217 (regs & D7S_FLIP) ? " (FLIPPED)" : "", 218 218 op->resource[0].start, 219 219 sol_compat ? "in sol_compat mode" : "");
+2 -2
drivers/sbus/char/flash.c
··· 181 181 } 182 182 flash.busy = 0; 183 183 184 - printk(KERN_INFO "%s: OBP Flash, RD %lx[%lx] WR %lx[%lx]\n", 185 - op->dev.of_node->full_name, 184 + printk(KERN_INFO "%pOF: OBP Flash, RD %lx[%lx] WR %lx[%lx]\n", 185 + op->dev.of_node, 186 186 flash.read_base, flash.read_size, 187 187 flash.write_base, flash.write_size); 188 188
+2 -2
drivers/sbus/char/uctrl.c
··· 379 379 } 380 380 381 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", 383 - op->dev.of_node->full_name, p->regs, p->irq); 382 + printk(KERN_INFO "%pOF: uctrl regs[0x%p] (irq %d)\n", 383 + op->dev.of_node, p->regs, p->irq); 384 384 uctrl_get_event_status(p); 385 385 uctrl_get_external_status(p); 386 386