Re: [RFC PATCH] drm/amdgpu: add support for user trap handlers

2020-08-25 Thread Alex Deucher
On Tue, Aug 25, 2020 at 3:06 AM Samuel Pitoiset wrote: > > > On 8/24/20 11:32 PM, Alex Deucher wrote: > > On Mon, Aug 24, 2020 at 2:33 PM Alex Deucher wrote: > >> On Mon, Aug 24, 2020 at 7:57 AM Samuel Pitoiset > >> wrote: > >>> A trap handler can be used by userspace to catch shader exceptions

Re: [RFC PATCH] drm/amdgpu: add support for user trap handlers

2020-08-25 Thread Samuel Pitoiset
On 8/24/20 11:32 PM, Alex Deucher wrote: On Mon, Aug 24, 2020 at 2:33 PM Alex Deucher wrote: On Mon, Aug 24, 2020 at 7:57 AM Samuel Pitoiset wrote: A trap handler can be used by userspace to catch shader exceptions like divide by zero, memory violations etc. On GFX6-GFX8, the registers

Re: [RFC PATCH] drm/amdgpu: add support for user trap handlers

2020-08-25 Thread Samuel Pitoiset
On 8/24/20 8:17 PM, Marek Olšák wrote: SET_SH_REG won't work with CP register shadowing. You need to use WRITE_DATA or WREG32. You are right, will fix. Marek On Mon, Aug 24, 2020 at 7:57 AM Samuel Pitoiset mailto:samuel.pitoi...@gmail.com>> wrote: A trap handler can be used by

Re: [RFC PATCH] drm/amdgpu: add support for user trap handlers

2020-08-24 Thread Alex Deucher
On Mon, Aug 24, 2020 at 2:33 PM Alex Deucher wrote: > > On Mon, Aug 24, 2020 at 7:57 AM Samuel Pitoiset > wrote: > > > > A trap handler can be used by userspace to catch shader exceptions > > like divide by zero, memory violations etc. > > > > On GFX6-GFX8, the registers used to configure

Re: [RFC PATCH] drm/amdgpu: add support for user trap handlers

2020-08-24 Thread Alex Deucher
On Mon, Aug 24, 2020 at 7:57 AM Samuel Pitoiset wrote: > > A trap handler can be used by userspace to catch shader exceptions > like divide by zero, memory violations etc. > > On GFX6-GFX8, the registers used to configure TBA/TMA aren't > privileged while on GFX9+ they are per VMID and

Re: [RFC PATCH] drm/amdgpu: add support for user trap handlers

2020-08-24 Thread Marek Olšák
SET_SH_REG won't work with CP register shadowing. You need to use WRITE_DATA or WREG32. Marek On Mon, Aug 24, 2020 at 7:57 AM Samuel Pitoiset wrote: > A trap handler can be used by userspace to catch shader exceptions > like divide by zero, memory violations etc. > > On GFX6-GFX8, the

[RFC PATCH] drm/amdgpu: add support for user trap handlers

2020-08-24 Thread Samuel Pitoiset
A trap handler can be used by userspace to catch shader exceptions like divide by zero, memory violations etc. On GFX6-GFX8, the registers used to configure TBA/TMA aren't privileged while on GFX9+ they are per VMID and privileged, so that only the KMD can configure them. This introduces a new