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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6

* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
avr32: pm_standby low-power ram bug fix
avr32: Fix lockup after Java stack underflow in user mode

+64 -3
+6
arch/avr32/kernel/asm-offsets.c
··· 4 4 * to extract and format the required data. 5 5 */ 6 6 7 + #include <linux/mm.h> 8 + #include <linux/sched.h> 7 9 #include <linux/thread_info.h> 8 10 #include <linux/kbuild.h> 9 11 ··· 19 17 OFFSET(TI_rar_saved, thread_info, rar_saved); 20 18 OFFSET(TI_rsr_saved, thread_info, rsr_saved); 21 19 OFFSET(TI_restart_block, thread_info, restart_block); 20 + BLANK(); 21 + OFFSET(TSK_active_mm, task_struct, active_mm); 22 + BLANK(); 23 + OFFSET(MM_pgd, mm_struct, pgd); 22 24 }
+57 -2
arch/avr32/kernel/entry-avr32b.S
··· 334 334 335 335 /* Low-level exception handlers */ 336 336 handle_critical: 337 + /* 338 + * AT32AP700x errata: 339 + * 340 + * After a Java stack overflow or underflow trap, any CPU 341 + * memory access may cause erratic behavior. This will happen 342 + * when the four least significant bits of the JOSP system 343 + * register contains any value between 9 and 15 (inclusive). 344 + * 345 + * Possible workarounds: 346 + * - Don't use the Java Extension Module 347 + * - Ensure that the stack overflow and underflow trap 348 + * handlers do not do any memory access or trigger any 349 + * exceptions before the overflow/underflow condition is 350 + * cleared (by incrementing or decrementing the JOSP) 351 + * - Make sure that JOSP does not contain any problematic 352 + * value before doing any exception or interrupt 353 + * processing. 354 + * - Set up a critical exception handler which writes a 355 + * known-to-be-safe value, e.g. 4, to JOSP before doing 356 + * any further processing. 357 + * 358 + * We'll use the last workaround for now since we cannot 359 + * guarantee that user space processes don't use Java mode. 360 + * Non-well-behaving userland will be terminated with extreme 361 + * prejudice. 362 + */ 363 + #ifdef CONFIG_CPU_AT32AP700X 364 + /* 365 + * There's a chance we can't touch memory, so temporarily 366 + * borrow PTBR to save the stack pointer while we fix things 367 + * up... 368 + */ 369 + mtsr SYSREG_PTBR, sp 370 + mov sp, 4 371 + mtsr SYSREG_JOSP, sp 372 + mfsr sp, SYSREG_PTBR 373 + sub pc, -2 374 + 375 + /* Push most of pt_regs on stack. We'll do the rest later */ 337 376 sub sp, 4 338 - stmts --sp, r0-lr 339 - rcall save_full_context_ex 377 + pushm r0-r12 378 + 379 + /* PTBR mirrors current_thread_info()->task->active_mm->pgd */ 380 + get_thread_info r0 381 + ld.w r1, r0[TI_task] 382 + ld.w r2, r1[TSK_active_mm] 383 + ld.w r3, r2[MM_pgd] 384 + mtsr SYSREG_PTBR, r3 385 + #else 386 + sub sp, 4 387 + pushm r0-r12 388 + #endif 389 + sub r0, sp, -(14 * 4) 390 + mov r1, lr 391 + mfsr r2, SYSREG_RAR_EX 392 + mfsr r3, SYSREG_RSR_EX 393 + pushm r0-r3 394 + 340 395 mfsr r12, SYSREG_ECR 341 396 mov r11, sp 342 397 rcall do_critical_exception
+1 -1
arch/avr32/mach-at32ap/pm-at32ap700x.S
··· 134 134 mov r11, SDRAMC_LPR_LPCB_SELF_RFR 135 135 bfins r10, r11, 0, 2 /* LPCB <- self Refresh */ 136 136 sync 0 /* flush write buffer */ 137 - st.w r12[SDRAMC_LPR], r11 /* put SDRAM in self-refresh mode */ 137 + st.w r12[SDRAMC_LPR], r10 /* put SDRAM in self-refresh mode */ 138 138 ld.w r11, r12[SDRAMC_LPR] 139 139 unmask_interrupts 140 140 sleep CPU_SLEEP_FROZEN