diff options
author | LEROY Christophe <christophe.leroy@c-s.fr> | 2015-01-20 04:57:34 -0500 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2015-01-29 22:59:02 -0500 |
commit | 17bb312f4c75e59ef6f18015011c4efbb545a748 (patch) | |
tree | fa5a5500cd0a25f9d3c8e86ce5734004439ae354 /arch | |
parent | ce67f5d0a00cce231e62334c3624737623c32d6a (diff) |
powerpc/8xx: Take benefit of aligned PGDIR
L1 base address is now aligned so we can insert L1 index into r11 directly and
then preserve r10
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/head_8xx.S | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index 32cc9e55b772..0ab16b66d712 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S | |||
@@ -326,16 +326,15 @@ InstructionTLBMiss: | |||
326 | ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l | 326 | ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l |
327 | 3: | 327 | 3: |
328 | #endif | 328 | #endif |
329 | /* Extract level 1 index */ | 329 | /* Insert level 1 index */ |
330 | rlwinm r10, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 | 330 | rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 |
331 | lwzx r11, r10, r11 /* Get the level 1 entry */ | 331 | lwz r11, 0(r11) /* Get the level 1 entry */ |
332 | rlwinm r10, r11,0,0,19 /* Extract page descriptor page address */ | ||
333 | 332 | ||
334 | /* Load the MI_TWC with the attributes for this "segment." */ | 333 | /* Load the MI_TWC with the attributes for this "segment." */ |
335 | MTSPR_CPU6(SPRN_MI_TWC, r11, r3) /* Set segment attributes */ | 334 | MTSPR_CPU6(SPRN_MI_TWC, r11, r3) /* Set segment attributes */ |
336 | mfspr r11, SPRN_SRR0 /* Get effective address of fault */ | 335 | rlwinm r11, r11,0,0,19 /* Extract page descriptor page address */ |
337 | /* Extract level 2 index */ | 336 | /* Extract level 2 index */ |
338 | rlwinm r11, r11, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29 | 337 | rlwinm r10, r10, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29 |
339 | lwzx r10, r10, r11 /* Get the pte */ | 338 | lwzx r10, r10, r11 /* Get the pte */ |
340 | 339 | ||
341 | #ifdef CONFIG_SWAP | 340 | #ifdef CONFIG_SWAP |
@@ -380,13 +379,12 @@ DataStoreTLBMiss: | |||
380 | lis r11, (swapper_pg_dir-PAGE_OFFSET)@h | 379 | lis r11, (swapper_pg_dir-PAGE_OFFSET)@h |
381 | ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l | 380 | ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l |
382 | 3: | 381 | 3: |
383 | /* Extract level 1 index */ | 382 | /* Insert level 1 index */ |
384 | rlwinm r10, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 | 383 | rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 |
385 | lwzx r11, r10, r11 /* Get the level 1 entry */ | 384 | lwz r11, 0(r11) /* Get the level 1 entry */ |
386 | 385 | ||
387 | /* We have a pte table, so load fetch the pte from the table. | 386 | /* We have a pte table, so load fetch the pte from the table. |
388 | */ | 387 | */ |
389 | mfspr r10, SPRN_MD_EPN /* Get address of fault */ | ||
390 | /* Extract level 2 index */ | 388 | /* Extract level 2 index */ |
391 | rlwinm r10, r10, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29 | 389 | rlwinm r10, r10, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29 |
392 | rlwimi r10, r11, 0, 0, 32 - PAGE_SHIFT - 1 /* Add level 2 base */ | 390 | rlwimi r10, r11, 0, 0, 32 - PAGE_SHIFT - 1 /* Add level 2 base */ |
@@ -512,16 +510,14 @@ FixupDAR:/* Entry point for dcbx workaround. */ | |||
512 | beq- 3f /* Branch if user space */ | 510 | beq- 3f /* Branch if user space */ |
513 | lis r11, (swapper_pg_dir-PAGE_OFFSET)@h | 511 | lis r11, (swapper_pg_dir-PAGE_OFFSET)@h |
514 | ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l | 512 | ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l |
515 | /* Extract level 1 index */ | 513 | /* Insert level 1 index */ |
516 | 3: rlwinm r10, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 | 514 | 3: rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 |
517 | lwzx r11, r10, r11 /* Get the level 1 entry */ | 515 | lwz r11, 0(r11) /* Get the level 1 entry */ |
518 | rlwinm r10, r11,0,0,19 /* Extract page descriptor page address */ | 516 | rlwinm r11, r11,0,0,19 /* Extract page descriptor page address */ |
519 | mfspr r11, SPRN_SRR0 /* Get effective address of fault */ | 517 | /* Insert level 2 index */ |
520 | /* Extract level 2 index */ | 518 | rlwimi r11, r10, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29 |
521 | rlwinm r11, r11, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29 | 519 | lwz r11, 0(r11) /* Get the pte */ |
522 | lwzx r11, r10, r11 /* Get the pte */ | ||
523 | /* concat physical page address(r11) and page offset(r10) */ | 520 | /* concat physical page address(r11) and page offset(r10) */ |
524 | mfspr r10, SPRN_SRR0 | ||
525 | rlwimi r11, r10, 0, 32 - PAGE_SHIFT, 31 | 521 | rlwimi r11, r10, 0, 32 - PAGE_SHIFT, 31 |
526 | lwz r11,0(r11) | 522 | lwz r11,0(r11) |
527 | /* Check if it really is a dcbx instruction. */ | 523 | /* Check if it really is a dcbx instruction. */ |