diff mbox

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

Message ID 20161115150606.14090-1-aneesh.kumar@linux.vnet.ibm.com (mailing list archive)
State Accepted
Headers show

Commit Message

Aneesh Kumar K.V Nov. 15, 2016, 3:06 p.m. UTC
VSID 0 is bad address. Don't create slb entries on coproc fault for
bad address

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
NOTE: note tested

 arch/powerpc/mm/copro_fault.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Balbir Singh Nov. 16, 2016, 12:08 a.m. UTC | #1
On 16/11/16 02:06, Aneesh Kumar K.V wrote:
> VSID 0 is bad address. Don't create slb entries on coproc fault for
> bad address
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
> NOTE: note tested
        ^^^ ?
> 
>  arch/powerpc/mm/copro_fault.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/powerpc/mm/copro_fault.c b/arch/powerpc/mm/copro_fault.c
> index 362954f98029..aaa7ec6788b9 100644
> --- a/arch/powerpc/mm/copro_fault.c
> +++ b/arch/powerpc/mm/copro_fault.c
> @@ -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;


Reviewed-by: Balbir Singh <bsingharora@gmail.com>

Balbir Singh.
Ian Munsie Nov. 16, 2016, 1:11 a.m. UTC | #2
Reviewed-by: Ian Munsie <imunsie@au1.ibm.com>
Michael Ellerman Nov. 25, 2016, 12:04 a.m. UTC | #3
On Tue, 2016-11-15 at 15:06:06 UTC, "Aneesh Kumar K.V" wrote:
> VSID 0 is bad address. Don't create slb entries on coproc fault for
> bad address
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Reviewed-by: Balbir Singh <bsingharora@gmail.com>
> Reviewed-by: Ian Munsie <imunsie@au1.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/64168f4296fa507ba059307984cddc

cheers
diff mbox

Patch

diff --git a/arch/powerpc/mm/copro_fault.c b/arch/powerpc/mm/copro_fault.c
index 362954f98029..aaa7ec6788b9 100644
--- a/arch/powerpc/mm/copro_fault.c
+++ b/arch/powerpc/mm/copro_fault.c
@@ -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;