diff options
author | LEROY Christophe <christophe.leroy@c-s.fr> | 2014-09-19 04:36:10 -0400 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-11-07 19:10:45 -0500 |
commit | c51a6821bdbc9068adda93b3b8ee65df8e4642a6 (patch) | |
tree | 0ff47308ec2dbb867a316d3eaf57d2e965041922 | |
parent | 83c17ba35e0306e671b5c9ab622535f23a9a3e78 (diff) |
powerpc/8xx: Invalidate non present TLB as early as possible
8xx sometimes need to load a invalid/non-present TLBs in
it DTLB asm handler.
These must be invalidated separaly as linux mm doesn't.
Commit 5efab4a02c89c252fb4cce097aafde5f8208dbfe was invalidating them in
arch/powerpc/mm/fault.c.
This patch does the invalidation earlier in order to free the TLB as soon as
possible. This also has the advantage of removing some 8xx specific code from
fault.c
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <scottwood@freescale.com>
-rw-r--r-- | arch/powerpc/kernel/head_8xx.S | 15 | ||||
-rw-r--r-- | arch/powerpc/mm/fault.c | 7 |
2 files changed, 10 insertions, 12 deletions
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index acf6d7eab6d5..d99aac0d69f1 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S | |||
@@ -475,8 +475,11 @@ InstructionTLBError1: | |||
475 | EXCEPTION_PROLOG_2 | 475 | EXCEPTION_PROLOG_2 |
476 | mr r4,r12 | 476 | mr r4,r12 |
477 | mr r5,r9 | 477 | mr r5,r9 |
478 | andis. r10,r5,0x4000 | ||
479 | beq+ 1f | ||
480 | tlbie r4 | ||
478 | /* 0x400 is InstructionAccess exception, needed by bad_page_fault() */ | 481 | /* 0x400 is InstructionAccess exception, needed by bad_page_fault() */ |
479 | EXC_XFER_LITE(0x400, handle_page_fault) | 482 | 1: EXC_XFER_LITE(0x400, handle_page_fault) |
480 | 483 | ||
481 | /* This is the data TLB error on the MPC8xx. This could be due to | 484 | /* This is the data TLB error on the MPC8xx. This could be due to |
482 | * many reasons, including a dirty update to a pte. We bail out to | 485 | * many reasons, including a dirty update to a pte. We bail out to |
@@ -492,11 +495,13 @@ DataTLBError: | |||
492 | DARFixed:/* Return from dcbx instruction bug workaround */ | 495 | DARFixed:/* Return from dcbx instruction bug workaround */ |
493 | EXCEPTION_PROLOG_1 | 496 | EXCEPTION_PROLOG_1 |
494 | EXCEPTION_PROLOG_2 | 497 | EXCEPTION_PROLOG_2 |
495 | mfspr r10,SPRN_DSISR | 498 | mfspr r5,SPRN_DSISR |
496 | stw r10,_DSISR(r11) | 499 | stw r5,_DSISR(r11) |
497 | mr r5,r10 | ||
498 | mfspr r4,SPRN_DAR | 500 | mfspr r4,SPRN_DAR |
499 | li r10,RPN_PATTERN | 501 | andis. r10,r5,0x4000 |
502 | beq+ 1f | ||
503 | tlbie r4 | ||
504 | 1: li r10,RPN_PATTERN | ||
500 | mtspr SPRN_DAR,r10 /* Tag DAR, to be used in DTLB Error */ | 505 | mtspr SPRN_DAR,r10 /* Tag DAR, to be used in DTLB Error */ |
501 | /* 0x300 is DataAccess exception, needed by bad_page_fault() */ | 506 | /* 0x300 is DataAccess exception, needed by bad_page_fault() */ |
502 | EXC_XFER_LITE(0x300, handle_page_fault) | 507 | EXC_XFER_LITE(0x300, handle_page_fault) |
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 08d659a9fcdb..eb79907f34fa 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c | |||
@@ -43,7 +43,6 @@ | |||
43 | #include <asm/tlbflush.h> | 43 | #include <asm/tlbflush.h> |
44 | #include <asm/siginfo.h> | 44 | #include <asm/siginfo.h> |
45 | #include <asm/debug.h> | 45 | #include <asm/debug.h> |
46 | #include <mm/mmu_decl.h> | ||
47 | 46 | ||
48 | #include "icswx.h" | 47 | #include "icswx.h" |
49 | 48 | ||
@@ -380,12 +379,6 @@ good_area: | |||
380 | goto bad_area; | 379 | goto bad_area; |
381 | #endif /* CONFIG_6xx */ | 380 | #endif /* CONFIG_6xx */ |
382 | #if defined(CONFIG_8xx) | 381 | #if defined(CONFIG_8xx) |
383 | /* 8xx sometimes need to load a invalid/non-present TLBs. | ||
384 | * These must be invalidated separately as linux mm don't. | ||
385 | */ | ||
386 | if (error_code & 0x40000000) /* no translation? */ | ||
387 | _tlbil_va(address, 0, 0, 0); | ||
388 | |||
389 | /* The MPC8xx seems to always set 0x80000000, which is | 382 | /* The MPC8xx seems to always set 0x80000000, which is |
390 | * "undefined". Of those that can be set, this is the only | 383 | * "undefined". Of those that can be set, this is the only |
391 | * one which seems bad. | 384 | * one which seems bad. |