[PATCH 08/18] drm/amdgpu:halt when vm fault

Christian König ckoenig.leichtzumerken at gmail.com
Mon Sep 18 09:14:46 UTC 2017


Am 18.09.2017 um 08:11 schrieb Monk Liu:
> only with this way we can debug the VMC page fault issue
>
> Change-Id: Ifc8373c3c3c40d54ae94dedf1be74d6314faeb10
> Signed-off-by: Monk Liu <Monk.Liu at amd.com>

Please make this behavior depend on the vm_fault_stop module parameter 
just like it is handled on older generations.

Apart from that it looks like a really good idea to me,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 6 ++++++
>   drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c  | 7 +++++++
>   2 files changed, 13 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
> index 6c8040e..c17996e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
> @@ -319,6 +319,12 @@ void gfxhub_v1_0_set_fault_enable_default(struct amdgpu_device *adev,
>   			WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value);
>   	tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL,
>   			EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT, value);
> +	if (!value) {
> +		tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL,
> +				CRASH_ON_NO_RETRY_FAULT, 1);
> +		tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL,
> +				CRASH_ON_RETRY_FAULT, 1);
> +    }
>   	WREG32_SOC15(GC, 0, mmVM_L2_PROTECTION_FAULT_CNTL, tmp);
>   }
>   
> diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> index 7ff7076..cc21c4b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> @@ -561,6 +561,13 @@ void mmhub_v1_0_set_fault_enable_default(struct amdgpu_device *adev, bool value)
>   			WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value);
>   	tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL,
>   			EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT, value);
> +	if (!value) {
> +		tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL,
> +				CRASH_ON_NO_RETRY_FAULT, 1);
> +		tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL,
> +				CRASH_ON_RETRY_FAULT, 1);
> +    }
> +
>   	WREG32_SOC15(MMHUB, 0, mmVM_L2_PROTECTION_FAULT_CNTL, tmp);
>   }
>   




More information about the amd-gfx mailing list