diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2010-10-14 16:23:03 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2010-10-15 15:38:09 -0400 |
commit | a78c942df64ef4cf495fd4d8715e48501bd7f8a4 (patch) | |
tree | fe44212d36e6ca23dbe9f2c633824389216a3d1d /arch/tile/kernel/process.c | |
parent | bf65e440e8248f22b2eacf8d47961bb9d52260f7 (diff) |
arch/tile: parameterize system PLs to support KVM port
While not a port to KVM (yet), this change modifies the kernel
to be able to build either at PL1 or at PL2 with a suitable
config switch. Pushing up this change avoids handling branch
merge issues going forward with the KVM work.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/kernel/process.c')
-rw-r--r-- | arch/tile/kernel/process.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c index 221f12bd27fa..8430f45daea6 100644 --- a/arch/tile/kernel/process.c +++ b/arch/tile/kernel/process.c | |||
@@ -305,15 +305,25 @@ int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) | |||
305 | /* Allow user processes to access the DMA SPRs */ | 305 | /* Allow user processes to access the DMA SPRs */ |
306 | void grant_dma_mpls(void) | 306 | void grant_dma_mpls(void) |
307 | { | 307 | { |
308 | #if CONFIG_KERNEL_PL == 2 | ||
309 | __insn_mtspr(SPR_MPL_DMA_CPL_SET_1, 1); | ||
310 | __insn_mtspr(SPR_MPL_DMA_NOTIFY_SET_1, 1); | ||
311 | #else | ||
308 | __insn_mtspr(SPR_MPL_DMA_CPL_SET_0, 1); | 312 | __insn_mtspr(SPR_MPL_DMA_CPL_SET_0, 1); |
309 | __insn_mtspr(SPR_MPL_DMA_NOTIFY_SET_0, 1); | 313 | __insn_mtspr(SPR_MPL_DMA_NOTIFY_SET_0, 1); |
314 | #endif | ||
310 | } | 315 | } |
311 | 316 | ||
312 | /* Forbid user processes from accessing the DMA SPRs */ | 317 | /* Forbid user processes from accessing the DMA SPRs */ |
313 | void restrict_dma_mpls(void) | 318 | void restrict_dma_mpls(void) |
314 | { | 319 | { |
320 | #if CONFIG_KERNEL_PL == 2 | ||
321 | __insn_mtspr(SPR_MPL_DMA_CPL_SET_2, 1); | ||
322 | __insn_mtspr(SPR_MPL_DMA_NOTIFY_SET_2, 1); | ||
323 | #else | ||
315 | __insn_mtspr(SPR_MPL_DMA_CPL_SET_1, 1); | 324 | __insn_mtspr(SPR_MPL_DMA_CPL_SET_1, 1); |
316 | __insn_mtspr(SPR_MPL_DMA_NOTIFY_SET_1, 1); | 325 | __insn_mtspr(SPR_MPL_DMA_NOTIFY_SET_1, 1); |
326 | #endif | ||
317 | } | 327 | } |
318 | 328 | ||
319 | /* Pause the DMA engine, then save off its state registers. */ | 329 | /* Pause the DMA engine, then save off its state registers. */ |
@@ -524,7 +534,7 @@ struct task_struct *__sched _switch_to(struct task_struct *prev, | |||
524 | * Switch kernel SP, PC, and callee-saved registers. | 534 | * Switch kernel SP, PC, and callee-saved registers. |
525 | * In the context of the new task, return the old task pointer | 535 | * In the context of the new task, return the old task pointer |
526 | * (i.e. the task that actually called __switch_to). | 536 | * (i.e. the task that actually called __switch_to). |
527 | * Pass the value to use for SYSTEM_SAVE_1_0 when we reset our sp. | 537 | * Pass the value to use for SYSTEM_SAVE_K_0 when we reset our sp. |
528 | */ | 538 | */ |
529 | return __switch_to(prev, next, next_current_ksp0(next)); | 539 | return __switch_to(prev, next, next_current_ksp0(next)); |
530 | } | 540 | } |