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

powerpc/mm: Use the required number of VSID bits in slbmte

ASM_VSID_SCRAMBLE can leave non-zero bits in the high 28 bits of the result
for 256MB segment (40 bits for 1T segment). Properly mask them before using
the values in slbmte

Reviewed-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Aneesh Kumar K.V and committed by
Benjamin Herrenschmidt
ac8dc282 7aa0727f

+10 -2
+10 -2
arch/powerpc/mm/slb_low.S
··· 223 223 */ 224 224 slb_finish_load: 225 225 ASM_VSID_SCRAMBLE(r10,r9,256M) 226 - rldimi r11,r10,SLB_VSID_SHIFT,16 /* combine VSID and flags */ 226 + /* 227 + * bits above VSID_BITS_256M need to be ignored from r10 228 + * also combine VSID and flags 229 + */ 230 + rldimi r11,r10,SLB_VSID_SHIFT,(64 - (SLB_VSID_SHIFT + VSID_BITS_256M)) 227 231 228 232 /* r3 = EA, r11 = VSID data */ 229 233 /* ··· 291 287 slb_finish_load_1T: 292 288 srdi r10,r10,40-28 /* get 1T ESID */ 293 289 ASM_VSID_SCRAMBLE(r10,r9,1T) 294 - rldimi r11,r10,SLB_VSID_SHIFT_1T,16 /* combine VSID and flags */ 290 + /* 291 + * bits above VSID_BITS_1T need to be ignored from r10 292 + * also combine VSID and flags 293 + */ 294 + rldimi r11,r10,SLB_VSID_SHIFT_1T,(64 - (SLB_VSID_SHIFT_1T + VSID_BITS_1T)) 295 295 li r10,MMU_SEGSIZE_1T 296 296 rldimi r11,r10,SLB_VSID_SSIZE_SHIFT,0 /* insert segment size */ 297 297