Skip to contentSkip to conversation

powerpc/mm/coproc: Handle bad address on coproc slb fault

PATCH Applied Aneesh Kumar K.V 4 participants 4 messages Nov 15, 2016 – Nov 25, 2016 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/mm/coproc: Handle bad address on coproc slb fault

VSID 0 is bad address. Don't create slb entries on coproc fault for bad address

---
NOTE: note tested

 arch/powerpc/mm/copro_fault.c | 3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/mm/copro_fault.c +3 -0
index 362954f98029..aaa7ec6788b9 100644
@@ -134,6 +134,9 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)
 		pr_debug("%s: invalid region access at %016llx\n", __func__, ea);
 		return 1;
 	}
+	/* Bad address */
+	if (!vsid)
+		return 1;
 
 	vsid = (vsid << slb_vsid_shift(ssize)) | vsidkey;
 
Signature · 1 line
2.10.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Aneesh Kumar K.V

VSID 0 is bad address. Don't create slb entries on coproc fault for bad address

---
NOTE: note tested

        ^^^ ?
Quoted 9 lines
 arch/powerpc/mm/copro_fault.c | 3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/mm/copro_fault.c +0 -0
index 362954f98029..aaa7ec6788b9 100644

arch/powerpc/mm/copro_fault.c int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb) · line 139

Quoted 6 lines
arch/powerpc/mm/copro_fault.c +3 -0
@@ -134,6 +134,9 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)
 		pr_debug("%s: invalid region access at %016llx\n", __func__, ea);
 		return 1;
 	}
+	/* Bad address */
+	if (!vsid)
+		return 1;

Balbir Singh.