diff options
| -rw-r--r-- | arch/powerpc/include/asm/mmu-book3e.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/kernel/exceptions-64e.S | 45 |
2 files changed, 45 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h index 80d68afb0200..ec61e7b998c0 100644 --- a/arch/powerpc/include/asm/mmu-book3e.h +++ b/arch/powerpc/include/asm/mmu-book3e.h | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | #define MAS0_TLBSEL(x) (((x) << 28) & 0x30000000) | 43 | #define MAS0_TLBSEL(x) (((x) << 28) & 0x30000000) |
| 44 | #define MAS0_ESEL(x) (((x) << 16) & 0x0FFF0000) | 44 | #define MAS0_ESEL(x) (((x) << 16) & 0x0FFF0000) |
| 45 | #define MAS0_NV(x) ((x) & 0x00000FFF) | 45 | #define MAS0_NV(x) ((x) & 0x00000FFF) |
| 46 | #define MAS0_ESEL_MASK 0x0FFF0000 | ||
| 46 | #define MAS0_HES 0x00004000 | 47 | #define MAS0_HES 0x00004000 |
| 47 | #define MAS0_WQ_ALLWAYS 0x00000000 | 48 | #define MAS0_WQ_ALLWAYS 0x00000000 |
| 48 | #define MAS0_WQ_COND 0x00001000 | 49 | #define MAS0_WQ_COND 0x00001000 |
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S index 8fe0fc233f02..23bd83b20be4 100644 --- a/arch/powerpc/kernel/exceptions-64e.S +++ b/arch/powerpc/kernel/exceptions-64e.S | |||
| @@ -886,8 +886,51 @@ have_hes: | |||
| 886 | bctr | 886 | bctr |
| 887 | 887 | ||
| 888 | 1: /* We are now running at PAGE_OFFSET, clean the TLB of everything | 888 | 1: /* We are now running at PAGE_OFFSET, clean the TLB of everything |
| 889 | * else (XXX we should scan for bolted crap from the firmware too) | 889 | * else (including IPROTed things left by firmware) |
| 890 | * r4 = TLBnCFG | ||
| 891 | * r3 = current address (more or less) | ||
| 890 | */ | 892 | */ |
| 893 | |||
| 894 | li r5,0 | ||
| 895 | mtspr SPRN_MAS6,r5 | ||
| 896 | tlbsx 0,r3 | ||
| 897 | |||
| 898 | rlwinm r9,r4,0,TLBnCFG_N_ENTRY | ||
| 899 | rlwinm r10,r4,8,0xff | ||
| 900 | addi r10,r10,-1 /* Get inner loop mask */ | ||
| 901 | |||
| 902 | li r3,1 | ||
| 903 | |||
| 904 | mfspr r5,SPRN_MAS1 | ||
| 905 | rlwinm r5,r5,0,(~(MAS1_VALID|MAS1_IPROT)) | ||
| 906 | |||
| 907 | mfspr r6,SPRN_MAS2 | ||
| 908 | rldicr r6,r6,0,51 /* Extract EPN */ | ||
| 909 | |||
| 910 | mfspr r7,SPRN_MAS0 | ||
| 911 | rlwinm r7,r7,0,0xffff0fff /* Clear HES and WQ */ | ||
| 912 | |||
| 913 | rlwinm r8,r7,16,0xfff /* Extract ESEL */ | ||
| 914 | |||
| 915 | 2: add r4,r3,r8 | ||
| 916 | and r4,r4,r10 | ||
| 917 | |||
| 918 | rlwimi r7,r4,16,MAS0_ESEL_MASK | ||
| 919 | |||
| 920 | mtspr SPRN_MAS0,r7 | ||
| 921 | mtspr SPRN_MAS1,r5 | ||
| 922 | mtspr SPRN_MAS2,r6 | ||
| 923 | tlbwe | ||
| 924 | |||
| 925 | addi r3,r3,1 | ||
| 926 | and. r4,r3,r10 | ||
| 927 | |||
| 928 | bne 3f | ||
| 929 | addis r6,r6,(1<<30)@h | ||
| 930 | 3: | ||
| 931 | cmpw r3,r9 | ||
| 932 | blt 2b | ||
| 933 | |||
| 891 | PPC_TLBILX(0,0,0) | 934 | PPC_TLBILX(0,0,0) |
| 892 | sync | 935 | sync |
| 893 | isync | 936 | isync |
