Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/mm: Remove long disabled SLB code

We have a bunch of SLB related code in the tree which is there to handle
dynamic VSIDs - but currently it's all disabled at compile time. The
comments say "Keep that around for when we re-implement dynamic VSIDs".

But that was over 10 years ago (commit 3c726f8dee6f ("[PATCH] ppc64:
support 64k pages")). The chance that it would still work unchanged is
minimal, and in the meantime it's confusing to folks browsing/grepping
the code. If we ever want to re-instate it, it's in the git history.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Balbir Singh <bsingharora@gmail.com>

-153
-102
arch/powerpc/kernel/exceptions-64s.S
··· 209 209 EXCEPTION_PROLOG_1(PACA_EXSLB, KVMTEST, 0x380) 210 210 std r3,PACA_EXSLB+EX_R3(r13) 211 211 mfspr r3,SPRN_DAR 212 - #ifdef __DISABLED__ 213 - /* Keep that around for when we re-implement dynamic VSIDs */ 214 - cmpdi r3,0 215 - bge slb_miss_user_pseries 216 - #endif /* __DISABLED__ */ 217 212 mfspr r12,SPRN_SRR1 218 213 #ifndef CONFIG_RELOCATABLE 219 214 b slb_miss_realmode ··· 235 240 EXCEPTION_PROLOG_1(PACA_EXSLB, KVMTEST, 0x480) 236 241 std r3,PACA_EXSLB+EX_R3(r13) 237 242 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ 238 - #ifdef __DISABLED__ 239 - /* Keep that around for when we re-implement dynamic VSIDs */ 240 - cmpdi r3,0 241 - bge slb_miss_user_pseries 242 - #endif /* __DISABLED__ */ 243 243 mfspr r12,SPRN_SRR1 244 244 #ifndef CONFIG_RELOCATABLE 245 245 b slb_miss_realmode ··· 699 709 700 710 #endif /* CONFIG_PPC_PSERIES */ 701 711 702 - #ifdef __DISABLED__ 703 - /* 704 - * This is used for when the SLB miss handler has to go virtual, 705 - * which doesn't happen for now anymore but will once we re-implement 706 - * dynamic VSIDs for shared page tables 707 - */ 708 - slb_miss_user_pseries: 709 - std r10,PACA_EXGEN+EX_R10(r13) 710 - std r11,PACA_EXGEN+EX_R11(r13) 711 - std r12,PACA_EXGEN+EX_R12(r13) 712 - GET_SCRATCH0(r10) 713 - ld r11,PACA_EXSLB+EX_R9(r13) 714 - ld r12,PACA_EXSLB+EX_R3(r13) 715 - std r10,PACA_EXGEN+EX_R13(r13) 716 - std r11,PACA_EXGEN+EX_R9(r13) 717 - std r12,PACA_EXGEN+EX_R3(r13) 718 - clrrdi r12,r13,32 719 - mfmsr r10 720 - mfspr r11,SRR0 /* save SRR0 */ 721 - ori r12,r12,slb_miss_user_common@l /* virt addr of handler */ 722 - ori r10,r10,MSR_IR|MSR_DR|MSR_RI 723 - mtspr SRR0,r12 724 - mfspr r12,SRR1 /* and SRR1 */ 725 - mtspr SRR1,r10 726 - rfid 727 - b . /* prevent spec. execution */ 728 - #endif /* __DISABLED__ */ 729 - 730 712 #ifdef CONFIG_KVM_BOOK3S_64_HANDLER 731 713 kvmppc_skip_interrupt: 732 714 /* ··· 973 1011 b do_hash_page /* Try to handle as hpte fault */ 974 1012 975 1013 STD_EXCEPTION_COMMON(0xe20, h_instr_storage, unknown_exception) 976 - 977 - /* 978 - * Here is the common SLB miss user that is used when going to virtual 979 - * mode for SLB misses, that is currently not used 980 - */ 981 - #ifdef __DISABLED__ 982 - .align 7 983 - .globl slb_miss_user_common 984 - slb_miss_user_common: 985 - mflr r10 986 - std r3,PACA_EXGEN+EX_DAR(r13) 987 - stw r9,PACA_EXGEN+EX_CCR(r13) 988 - std r10,PACA_EXGEN+EX_LR(r13) 989 - std r11,PACA_EXGEN+EX_SRR0(r13) 990 - bl slb_allocate_user 991 - 992 - ld r10,PACA_EXGEN+EX_LR(r13) 993 - ld r3,PACA_EXGEN+EX_R3(r13) 994 - lwz r9,PACA_EXGEN+EX_CCR(r13) 995 - ld r11,PACA_EXGEN+EX_SRR0(r13) 996 - mtlr r10 997 - beq- slb_miss_fault 998 - 999 - andi. r10,r12,MSR_RI /* check for unrecoverable exception */ 1000 - beq- unrecov_user_slb 1001 - mfmsr r10 1002 - 1003 - .machine push 1004 - .machine "power4" 1005 - mtcrf 0x80,r9 1006 - .machine pop 1007 - 1008 - clrrdi r10,r10,2 /* clear RI before setting SRR0/1 */ 1009 - mtmsrd r10,1 1010 - 1011 - mtspr SRR0,r11 1012 - mtspr SRR1,r12 1013 - 1014 - ld r9,PACA_EXGEN+EX_R9(r13) 1015 - ld r10,PACA_EXGEN+EX_R10(r13) 1016 - ld r11,PACA_EXGEN+EX_R11(r13) 1017 - ld r12,PACA_EXGEN+EX_R12(r13) 1018 - ld r13,PACA_EXGEN+EX_R13(r13) 1019 - rfid 1020 - b . 1021 - 1022 - slb_miss_fault: 1023 - EXCEPTION_PROLOG_COMMON(0x380, PACA_EXGEN) 1024 - ld r4,PACA_EXGEN+EX_DAR(r13) 1025 - li r5,0 1026 - std r4,_DAR(r1) 1027 - std r5,_DSISR(r1) 1028 - b handle_page_fault 1029 - 1030 - unrecov_user_slb: 1031 - EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN) 1032 - RECONCILE_IRQ_STATE(r10, r11) 1033 - bl save_nvgprs 1034 - 1: addi r3,r1,STACK_FRAME_OVERHEAD 1035 - bl unrecoverable_exception 1036 - b 1b 1037 - 1038 - #endif /* __DISABLED__ */ 1039 - 1040 1014 1041 1015 /* 1042 1016 * Machine check is different because we use a different
-1
arch/powerpc/mm/slb.c
··· 32 32 }; 33 33 34 34 extern void slb_allocate_realmode(unsigned long ea); 35 - extern void slb_allocate_user(unsigned long ea); 36 35 37 36 static void slb_allocate(unsigned long ea) 38 37 {
-50
arch/powerpc/mm/slb_low.S
··· 179 179 li r11,SLB_VSID_USER /* flags don't much matter */ 180 180 b slb_finish_load 181 181 182 - #ifdef __DISABLED__ 183 - 184 - /* void slb_allocate_user(unsigned long ea); 185 - * 186 - * Create an SLB entry for the given EA (user or kernel). 187 - * r3 = faulting address, r13 = PACA 188 - * r9, r10, r11 are clobbered by this function 189 - * No other registers are examined or changed. 190 - * 191 - * It is called with translation enabled in order to be able to walk the 192 - * page tables. This is not currently used. 193 - */ 194 - _GLOBAL(slb_allocate_user) 195 - /* r3 = faulting address */ 196 - srdi r10,r3,28 /* get esid */ 197 - 198 - crset 4*cr7+lt /* set "user" flag for later */ 199 - 200 - /* check if we fit in the range covered by the pagetables*/ 201 - srdi. r9,r3,PGTABLE_EADDR_SIZE 202 - crnot 4*cr0+eq,4*cr0+eq 203 - beqlr 204 - 205 - /* now we need to get to the page tables in order to get the page 206 - * size encoding from the PMD. In the future, we'll be able to deal 207 - * with 1T segments too by getting the encoding from the PGD instead 208 - */ 209 - ld r9,PACAPGDIR(r13) 210 - cmpldi cr0,r9,0 211 - beqlr 212 - rlwinm r11,r10,8,25,28 213 - ldx r9,r9,r11 /* get pgd_t */ 214 - cmpldi cr0,r9,0 215 - beqlr 216 - rlwinm r11,r10,3,17,28 217 - ldx r9,r9,r11 /* get pmd_t */ 218 - cmpldi cr0,r9,0 219 - beqlr 220 - 221 - /* build vsid flags */ 222 - andi. r11,r9,SLB_VSID_LLP 223 - ori r11,r11,SLB_VSID_USER 224 - 225 - /* get context to calculate proto-VSID */ 226 - ld r9,PACACONTEXTID(r13) 227 - /* fall through slb_finish_load */ 228 - 229 - #endif /* __DISABLED__ */ 230 - 231 - 232 182 /* 233 183 * Finish loading of an SLB entry and return 234 184 *