diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2007-10-11 14:36:52 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-10-11 14:36:52 -0400 |
commit | 8a13c4f972e6c107d8cff54de647544c00e25b41 (patch) | |
tree | bd1e291a935fe8420b270d0a4f8e9d3b7a8e1bd1 /arch/powerpc/kernel/head_32.S | |
parent | f5d7d13cd96313a90f8d13fa5d6e0704f6d534ba (diff) |
[POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB handlers
Move to using PAGE_OFFSET instead of TASK_SIZE or KERNELBASE value on
6xx/40x/44x/fsl-booke to determine if the faulting address is a kernel or
user space address. This mimics how the macro is_kernel_addr() works.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/head_32.S')
-rw-r--r-- | arch/powerpc/kernel/head_32.S | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index d83f04e5a599..a5b13ae7fd20 100644 --- a/arch/powerpc/kernel/head_32.S +++ b/arch/powerpc/kernel/head_32.S | |||
@@ -469,12 +469,12 @@ InstructionTLBMiss: | |||
469 | mfctr r0 | 469 | mfctr r0 |
470 | /* Get PTE (linux-style) and check access */ | 470 | /* Get PTE (linux-style) and check access */ |
471 | mfspr r3,SPRN_IMISS | 471 | mfspr r3,SPRN_IMISS |
472 | lis r1,KERNELBASE@h /* check if kernel address */ | 472 | lis r1,PAGE_OFFSET@h /* check if kernel address */ |
473 | cmplw 0,r3,r1 | 473 | cmplw 0,r1,r3 |
474 | mfspr r2,SPRN_SPRG3 | 474 | mfspr r2,SPRN_SPRG3 |
475 | li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */ | 475 | li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */ |
476 | lwz r2,PGDIR(r2) | 476 | lwz r2,PGDIR(r2) |
477 | blt+ 112f | 477 | bge- 112f |
478 | mfspr r2,SPRN_SRR1 /* and MSR_PR bit from SRR1 */ | 478 | mfspr r2,SPRN_SRR1 /* and MSR_PR bit from SRR1 */ |
479 | rlwimi r1,r2,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */ | 479 | rlwimi r1,r2,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */ |
480 | lis r2,swapper_pg_dir@ha /* if kernel address, use */ | 480 | lis r2,swapper_pg_dir@ha /* if kernel address, use */ |
@@ -543,12 +543,12 @@ DataLoadTLBMiss: | |||
543 | mfctr r0 | 543 | mfctr r0 |
544 | /* Get PTE (linux-style) and check access */ | 544 | /* Get PTE (linux-style) and check access */ |
545 | mfspr r3,SPRN_DMISS | 545 | mfspr r3,SPRN_DMISS |
546 | lis r1,KERNELBASE@h /* check if kernel address */ | 546 | lis r1,PAGE_OFFSET@h /* check if kernel address */ |
547 | cmplw 0,r3,r1 | 547 | cmplw 0,r1,r3 |
548 | mfspr r2,SPRN_SPRG3 | 548 | mfspr r2,SPRN_SPRG3 |
549 | li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */ | 549 | li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */ |
550 | lwz r2,PGDIR(r2) | 550 | lwz r2,PGDIR(r2) |
551 | blt+ 112f | 551 | bge- 112f |
552 | mfspr r2,SPRN_SRR1 /* and MSR_PR bit from SRR1 */ | 552 | mfspr r2,SPRN_SRR1 /* and MSR_PR bit from SRR1 */ |
553 | rlwimi r1,r2,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */ | 553 | rlwimi r1,r2,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */ |
554 | lis r2,swapper_pg_dir@ha /* if kernel address, use */ | 554 | lis r2,swapper_pg_dir@ha /* if kernel address, use */ |
@@ -615,12 +615,12 @@ DataStoreTLBMiss: | |||
615 | mfctr r0 | 615 | mfctr r0 |
616 | /* Get PTE (linux-style) and check access */ | 616 | /* Get PTE (linux-style) and check access */ |
617 | mfspr r3,SPRN_DMISS | 617 | mfspr r3,SPRN_DMISS |
618 | lis r1,KERNELBASE@h /* check if kernel address */ | 618 | lis r1,PAGE_OFFSET@h /* check if kernel address */ |
619 | cmplw 0,r3,r1 | 619 | cmplw 0,r1,r3 |
620 | mfspr r2,SPRN_SPRG3 | 620 | mfspr r2,SPRN_SPRG3 |
621 | li r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */ | 621 | li r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */ |
622 | lwz r2,PGDIR(r2) | 622 | lwz r2,PGDIR(r2) |
623 | blt+ 112f | 623 | bge- 112f |
624 | mfspr r2,SPRN_SRR1 /* and MSR_PR bit from SRR1 */ | 624 | mfspr r2,SPRN_SRR1 /* and MSR_PR bit from SRR1 */ |
625 | rlwimi r1,r2,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */ | 625 | rlwimi r1,r2,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */ |
626 | lis r2,swapper_pg_dir@ha /* if kernel address, use */ | 626 | lis r2,swapper_pg_dir@ha /* if kernel address, use */ |