diff options
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 915fbb4fc2fe..0e9095e47b5b 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <asm/irqflags.h> | 33 | #include <asm/irqflags.h> |
34 | #include <asm/ftrace.h> | 34 | #include <asm/ftrace.h> |
35 | #include <asm/hw_irq.h> | 35 | #include <asm/hw_irq.h> |
36 | #include <asm/context_tracking.h> | ||
36 | 37 | ||
37 | /* | 38 | /* |
38 | * System calls. | 39 | * System calls. |
@@ -376,8 +377,6 @@ _GLOBAL(ret_from_fork) | |||
376 | _GLOBAL(ret_from_kernel_thread) | 377 | _GLOBAL(ret_from_kernel_thread) |
377 | bl .schedule_tail | 378 | bl .schedule_tail |
378 | REST_NVGPRS(r1) | 379 | REST_NVGPRS(r1) |
379 | li r3,0 | ||
380 | std r3,0(r1) | ||
381 | ld r14, 0(r14) | 380 | ld r14, 0(r14) |
382 | mtlr r14 | 381 | mtlr r14 |
383 | mr r3,r15 | 382 | mr r3,r15 |
@@ -466,6 +465,20 @@ BEGIN_FTR_SECTION | |||
466 | std r0, THREAD_EBBHR(r3) | 465 | std r0, THREAD_EBBHR(r3) |
467 | mfspr r0, SPRN_EBBRR | 466 | mfspr r0, SPRN_EBBRR |
468 | std r0, THREAD_EBBRR(r3) | 467 | std r0, THREAD_EBBRR(r3) |
468 | |||
469 | /* PMU registers made user read/(write) by EBB */ | ||
470 | mfspr r0, SPRN_SIAR | ||
471 | std r0, THREAD_SIAR(r3) | ||
472 | mfspr r0, SPRN_SDAR | ||
473 | std r0, THREAD_SDAR(r3) | ||
474 | mfspr r0, SPRN_SIER | ||
475 | std r0, THREAD_SIER(r3) | ||
476 | mfspr r0, SPRN_MMCR0 | ||
477 | std r0, THREAD_MMCR0(r3) | ||
478 | mfspr r0, SPRN_MMCR2 | ||
479 | std r0, THREAD_MMCR2(r3) | ||
480 | mfspr r0, SPRN_MMCRA | ||
481 | std r0, THREAD_MMCRA(r3) | ||
469 | END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) | 482 | END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) |
470 | #endif | 483 | #endif |
471 | 484 | ||
@@ -561,6 +574,20 @@ BEGIN_FTR_SECTION | |||
561 | ld r0, THREAD_EBBRR(r4) | 574 | ld r0, THREAD_EBBRR(r4) |
562 | mtspr SPRN_EBBRR, r0 | 575 | mtspr SPRN_EBBRR, r0 |
563 | 576 | ||
577 | /* PMU registers made user read/(write) by EBB */ | ||
578 | ld r0, THREAD_SIAR(r4) | ||
579 | mtspr SPRN_SIAR, r0 | ||
580 | ld r0, THREAD_SDAR(r4) | ||
581 | mtspr SPRN_SDAR, r0 | ||
582 | ld r0, THREAD_SIER(r4) | ||
583 | mtspr SPRN_SIER, r0 | ||
584 | ld r0, THREAD_MMCR0(r4) | ||
585 | mtspr SPRN_MMCR0, r0 | ||
586 | ld r0, THREAD_MMCR2(r4) | ||
587 | mtspr SPRN_MMCR2, r0 | ||
588 | ld r0, THREAD_MMCRA(r4) | ||
589 | mtspr SPRN_MMCRA, r0 | ||
590 | |||
564 | ld r0,THREAD_TAR(r4) | 591 | ld r0,THREAD_TAR(r4) |
565 | mtspr SPRN_TAR,r0 | 592 | mtspr SPRN_TAR,r0 |
566 | END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) | 593 | END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) |
@@ -634,7 +661,7 @@ _GLOBAL(ret_from_except_lite) | |||
634 | andi. r0,r4,_TIF_NEED_RESCHED | 661 | andi. r0,r4,_TIF_NEED_RESCHED |
635 | beq 1f | 662 | beq 1f |
636 | bl .restore_interrupts | 663 | bl .restore_interrupts |
637 | bl .schedule | 664 | SCHEDULE_USER |
638 | b .ret_from_except_lite | 665 | b .ret_from_except_lite |
639 | 666 | ||
640 | 1: bl .save_nvgprs | 667 | 1: bl .save_nvgprs |