diff options
author | LEROY Christophe <christophe.leroy@c-s.fr> | 2015-01-20 04:57:33 -0500 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2015-01-29 22:58:02 -0500 |
commit | 5ddb75cee5afab3bdaf6eb4efefc8029923a9cc7 (patch) | |
tree | 928619c9727e20a74565398bd0181a996829f1ce /arch/powerpc/kernel | |
parent | 2374d0af29c154d6d989987a94278caed8c13be5 (diff) |
powerpc/8xx: remove tests on PGDIR entry validity
Kernel MMU handling code handles validity of entries via _PMD_PRESENT which
corresponds to V bit in MD_TWC and MI_TWC. When the V bit is not set, MPC8xx
triggers TLBError exception. So we don't have to check that and branch ourself
to TLBError. We can set TLB entries with non present entries, remove all those
tests and let the 8xx handle it. This reduce the number of cycle when the
entries are valid which is the case most of the time, and doesn't significantly
increase the time for handling invalid entries.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/head_8xx.S | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index 73715cd0de45..32cc9e55b772 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S | |||
@@ -329,12 +329,9 @@ InstructionTLBMiss: | |||
329 | /* Extract level 1 index */ | 329 | /* Extract level 1 index */ |
330 | rlwinm r10, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 | 330 | rlwinm r10, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 |
331 | lwzx r11, r10, r11 /* Get the level 1 entry */ | 331 | lwzx r11, r10, r11 /* Get the level 1 entry */ |
332 | rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */ | 332 | rlwinm r10, r11,0,0,19 /* Extract page descriptor page address */ |
333 | beq 2f /* If zero, don't try to find a pte */ | ||
334 | 333 | ||
335 | /* We have a pte table, so load the MI_TWC with the attributes | 334 | /* Load the MI_TWC with the attributes for this "segment." */ |
336 | * for this "segment." | ||
337 | */ | ||
338 | MTSPR_CPU6(SPRN_MI_TWC, r11, r3) /* Set segment attributes */ | 335 | MTSPR_CPU6(SPRN_MI_TWC, r11, r3) /* Set segment attributes */ |
339 | mfspr r11, SPRN_SRR0 /* Get effective address of fault */ | 336 | mfspr r11, SPRN_SRR0 /* Get effective address of fault */ |
340 | /* Extract level 2 index */ | 337 | /* Extract level 2 index */ |
@@ -342,13 +339,11 @@ InstructionTLBMiss: | |||
342 | lwzx r10, r10, r11 /* Get the pte */ | 339 | lwzx r10, r10, r11 /* Get the pte */ |
343 | 340 | ||
344 | #ifdef CONFIG_SWAP | 341 | #ifdef CONFIG_SWAP |
345 | andi. r11, r10, _PAGE_ACCESSED | _PAGE_PRESENT | 342 | rlwinm r11, r10, 32-5, _PAGE_PRESENT |
346 | cmpwi cr0, r11, _PAGE_ACCESSED | _PAGE_PRESENT | 343 | and r11, r11, r10 |
347 | li r11, RPN_PATTERN | 344 | rlwimi r10, r11, 0, _PAGE_PRESENT |
348 | bne- cr0, 2f | ||
349 | #else | ||
350 | li r11, RPN_PATTERN | ||
351 | #endif | 345 | #endif |
346 | li r11, RPN_PATTERN | ||
352 | /* The Linux PTE won't go exactly into the MMU TLB. | 347 | /* The Linux PTE won't go exactly into the MMU TLB. |
353 | * Software indicator bits 21 and 28 must be clear. | 348 | * Software indicator bits 21 and 28 must be clear. |
354 | * Software indicator bits 24, 25, 26, and 27 must be | 349 | * Software indicator bits 24, 25, 26, and 27 must be |
@@ -366,21 +361,6 @@ InstructionTLBMiss: | |||
366 | mfspr r10, SPRN_SPRG_SCRATCH2 | 361 | mfspr r10, SPRN_SPRG_SCRATCH2 |
367 | EXCEPTION_EPILOG_0 | 362 | EXCEPTION_EPILOG_0 |
368 | rfi | 363 | rfi |
369 | 2: | ||
370 | mfspr r10, SPRN_SRR1 | ||
371 | /* clear all error bits as TLB Miss | ||
372 | * sets a few unconditionally | ||
373 | */ | ||
374 | rlwinm r10, r10, 0, 0xffff | ||
375 | mtspr SPRN_SRR1, r10 | ||
376 | |||
377 | /* Restore registers */ | ||
378 | #ifdef CONFIG_8xx_CPU6 | ||
379 | mfspr r3, SPRN_DAR | ||
380 | mtspr SPRN_DAR, r11 /* Tag DAR */ | ||
381 | #endif | ||
382 | mfspr r10, SPRN_SPRG_SCRATCH2 | ||
383 | b InstructionTLBError1 | ||
384 | 364 | ||
385 | . = 0x1200 | 365 | . = 0x1200 |
386 | DataStoreTLBMiss: | 366 | DataStoreTLBMiss: |
@@ -403,8 +383,6 @@ DataStoreTLBMiss: | |||
403 | /* Extract level 1 index */ | 383 | /* Extract level 1 index */ |
404 | rlwinm r10, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 | 384 | rlwinm r10, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 |
405 | lwzx r11, r10, r11 /* Get the level 1 entry */ | 385 | lwzx r11, r10, r11 /* Get the level 1 entry */ |
406 | rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */ | ||
407 | beq 2f /* If zero, don't try to find a pte */ | ||
408 | 386 | ||
409 | /* We have a pte table, so load fetch the pte from the table. | 387 | /* We have a pte table, so load fetch the pte from the table. |
410 | */ | 388 | */ |
@@ -447,7 +425,7 @@ DataStoreTLBMiss: | |||
447 | * set. All other Linux PTE bits control the behavior | 425 | * set. All other Linux PTE bits control the behavior |
448 | * of the MMU. | 426 | * of the MMU. |
449 | */ | 427 | */ |
450 | 2: li r11, RPN_PATTERN | 428 | li r11, RPN_PATTERN |
451 | rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */ | 429 | rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */ |
452 | MTSPR_CPU6(SPRN_MD_RPN, r10, r3) /* Update TLB entry */ | 430 | MTSPR_CPU6(SPRN_MD_RPN, r10, r3) /* Update TLB entry */ |
453 | 431 | ||
@@ -466,10 +444,7 @@ DataStoreTLBMiss: | |||
466 | */ | 444 | */ |
467 | . = 0x1300 | 445 | . = 0x1300 |
468 | InstructionTLBError: | 446 | InstructionTLBError: |
469 | EXCEPTION_PROLOG_0 | 447 | EXCEPTION_PROLOG |
470 | InstructionTLBError1: | ||
471 | EXCEPTION_PROLOG_1 | ||
472 | EXCEPTION_PROLOG_2 | ||
473 | mr r4,r12 | 448 | mr r4,r12 |
474 | mr r5,r9 | 449 | mr r5,r9 |
475 | andis. r10,r5,0x4000 | 450 | andis. r10,r5,0x4000 |