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

powerpc/mm: Use appropriate ESID mask in copro_calculate_slb()

This patch makes copro_calculate_slb() mask the ESID by the correct mask
for 1T vs 256M segments.

This has no effect by itself as the extra bits were ignored, but it
makes debugging the segment table entries easier and means that we can
directly compare the ESID values for duplicates without needing to worry
about masking in the comparison.

This will be used to simplify a comparison in the following patch.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Ian Munsie and committed by
Michael Ellerman
03f54397 b03a7f57

+1 -2
+1 -2
arch/powerpc/mm/copro_fault.c
··· 99 99 u64 vsid; 100 100 int psize, ssize; 101 101 102 - slb->esid = (ea & ESID_MASK) | SLB_ESID_V; 103 - 104 102 switch (REGION_ID(ea)) { 105 103 case USER_REGION_ID: 106 104 pr_devel("%s: 0x%llx -- USER_REGION_ID\n", __func__, ea); ··· 131 133 vsid |= mmu_psize_defs[psize].sllp | 132 134 ((ssize == MMU_SEGSIZE_1T) ? SLB_VSID_B_1T : 0); 133 135 136 + slb->esid = (ea & (ssize == MMU_SEGSIZE_1T ? ESID_MASK_1T : ESID_MASK)) | SLB_ESID_V; 134 137 slb->vsid = vsid; 135 138 136 139 return 0;