diff options
Diffstat (limited to 'arch/sparc64/kernel/process.c')
-rw-r--r-- | arch/sparc64/kernel/process.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c index 059b0d025224..2784aab0d3e5 100644 --- a/arch/sparc64/kernel/process.c +++ b/arch/sparc64/kernel/process.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <asm/fpumacro.h> | 44 | #include <asm/fpumacro.h> |
45 | #include <asm/head.h> | 45 | #include <asm/head.h> |
46 | #include <asm/cpudata.h> | 46 | #include <asm/cpudata.h> |
47 | #include <asm/mmu_context.h> | ||
47 | #include <asm/unistd.h> | 48 | #include <asm/unistd.h> |
48 | 49 | ||
49 | /* #define VERBOSE_SHOWREGS */ | 50 | /* #define VERBOSE_SHOWREGS */ |
@@ -433,30 +434,16 @@ void exit_thread(void) | |||
433 | void flush_thread(void) | 434 | void flush_thread(void) |
434 | { | 435 | { |
435 | struct thread_info *t = current_thread_info(); | 436 | struct thread_info *t = current_thread_info(); |
437 | struct mm_struct *mm; | ||
436 | 438 | ||
437 | if (t->flags & _TIF_ABI_PENDING) | 439 | if (t->flags & _TIF_ABI_PENDING) |
438 | t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); | 440 | t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); |
439 | 441 | ||
440 | if (t->task->mm) { | 442 | mm = t->task->mm; |
441 | unsigned long pgd_cache = 0UL; | 443 | if (mm) |
442 | if (test_thread_flag(TIF_32BIT)) { | 444 | tsb_context_switch(__pa(mm->pgd), |
443 | struct mm_struct *mm = t->task->mm; | 445 | mm->context.sparc64_tsb); |
444 | pgd_t *pgd0 = &mm->pgd[0]; | ||
445 | pud_t *pud0 = pud_offset(pgd0, 0); | ||
446 | 446 | ||
447 | if (pud_none(*pud0)) { | ||
448 | pmd_t *page = pmd_alloc_one(mm, 0); | ||
449 | pud_set(pud0, page); | ||
450 | } | ||
451 | pgd_cache = get_pgd_cache(pgd0); | ||
452 | } | ||
453 | __asm__ __volatile__("stxa %0, [%1] %2\n\t" | ||
454 | "membar #Sync" | ||
455 | : /* no outputs */ | ||
456 | : "r" (pgd_cache), | ||
457 | "r" (TSB_REG), | ||
458 | "i" (ASI_DMMU)); | ||
459 | } | ||
460 | set_thread_wsaved(0); | 447 | set_thread_wsaved(0); |
461 | 448 | ||
462 | /* Turn off performance counters if on. */ | 449 | /* Turn off performance counters if on. */ |