diff options
author | Sam bobroff <sam.bobroff@au1.ibm.com> | 2014-05-21 02:32:38 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-05-27 23:35:40 -0400 |
commit | 1739ea9e13e636590dd56c2f4ca85e783da512e7 (patch) | |
tree | fcdebf258849e18544f05cdabcf176837c0b3778 /arch/powerpc/kernel/entry_64.S | |
parent | 39a360ef7234942333436709fd6cf641d5c51b7b (diff) |
powerpc: Fix regression of per-CPU DSCR setting
Since commit "efcac65 powerpc: Per process DSCR + some fixes (try#4)"
it is no longer possible to set the DSCR on a per-CPU basis.
The old behaviour was to minipulate the DSCR SPR directly but this is no
longer sufficient: the value is quickly overwritten by context switching.
This patch stores the per-CPU DSCR value in a kernel variable rather than
directly in the SPR and it is used whenever a process has not set the DSCR
itself. The sysfs interface (/sys/devices/system/cpu/cpuN/dscr) is unchanged.
Writes to the old global default (/sys/devices/system/cpu/dscr_default)
now set all of the per-CPU values and reads return the last written value.
The new per-CPU default is added to the paca_struct and is used everywhere
outside of sysfs.c instead of the old global default.
Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 9fde8a1bf1e1..911d45366f59 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -387,12 +387,6 @@ _GLOBAL(ret_from_kernel_thread) | |||
387 | li r3,0 | 387 | li r3,0 |
388 | b syscall_exit | 388 | b syscall_exit |
389 | 389 | ||
390 | .section ".toc","aw" | ||
391 | DSCR_DEFAULT: | ||
392 | .tc dscr_default[TC],dscr_default | ||
393 | |||
394 | .section ".text" | ||
395 | |||
396 | /* | 390 | /* |
397 | * This routine switches between two different tasks. The process | 391 | * This routine switches between two different tasks. The process |
398 | * state of one is saved on its kernel stack. Then the state | 392 | * state of one is saved on its kernel stack. Then the state |
@@ -577,11 +571,10 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) | |||
577 | #ifdef CONFIG_PPC64 | 571 | #ifdef CONFIG_PPC64 |
578 | BEGIN_FTR_SECTION | 572 | BEGIN_FTR_SECTION |
579 | lwz r6,THREAD_DSCR_INHERIT(r4) | 573 | lwz r6,THREAD_DSCR_INHERIT(r4) |
580 | ld r7,DSCR_DEFAULT@toc(2) | ||
581 | ld r0,THREAD_DSCR(r4) | 574 | ld r0,THREAD_DSCR(r4) |
582 | cmpwi r6,0 | 575 | cmpwi r6,0 |
583 | bne 1f | 576 | bne 1f |
584 | ld r0,0(r7) | 577 | ld r0,PACA_DSCR(r13) |
585 | 1: | 578 | 1: |
586 | BEGIN_FTR_SECTION_NESTED(70) | 579 | BEGIN_FTR_SECTION_NESTED(70) |
587 | mfspr r8, SPRN_FSCR | 580 | mfspr r8, SPRN_FSCR |