Re: [PATCH -next v2] drm/amdgpu: return 'ret' in amdgpu_pmu_init

2019-06-24 Thread maowenan
On 2019/6/22 22:00, Julia Lawall wrote: > > > On Sat, 22 Jun 2019, maowenan wrote: > >> >> >> On 2019/6/22 21:06, Julia Lawall wrote: >>> >>> >>> On Sat, 22 Jun 2019, Mao Wenan wrote: >>> There is one warning: drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c: In function ‘amdgpu_pmu_init’: >>

RE: [PATCH] drm/amd/powerplay: no memory activity support on Vega10

2019-06-24 Thread Quan, Evan
Smu7 ASICs support memory activity report also by reading register directly. But for Vega10, there is not any SMC message and metrics table for that. And there is no information about any register related with that. So, we cannot get the memory activity on Vega10. It's not a regression. Regards

Re: [PATCH -next v3] drm/amdgpu: return 'ret' immediately if failed in amdgpu_pmu_init

2019-06-24 Thread Dan Carpenter
On Mon, Jun 24, 2019 at 11:45:32AM +0800, Mao Wenan wrote: > There is one warning: > drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c: In function ‘amdgpu_pmu_init’: > drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c:249:6: warning: variable ‘ret’ set > but not used [-Wunused-but-set-variable] > int ret = 0; >

[PATCH] drm/amdgpu: fix scheduler timeout calc

2019-06-24 Thread Cui, Flora
scheduler timeout is in jiffies Change-Id: I26708c163db943ff8d930dd81bcab4b4b9d84eb2 Signed-off-by: Flora Cui --- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.

Re: [PATCH -next v3] drm/amdgpu: return 'ret' immediately if failed in amdgpu_pmu_init

2019-06-24 Thread maowenan
On 2019/6/24 16:39, Dan Carpenter wrote: > On Mon, Jun 24, 2019 at 11:45:32AM +0800, Mao Wenan wrote: >> There is one warning: >> drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c: In function ‘amdgpu_pmu_init’: >> drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c:249:6: warning: variable ‘ret’ set >> but not used

Re: [PATCH] drm/amdgpu: fix scheduler timeout calc

2019-06-24 Thread Christian König
Am 24.06.19 um 10:50 schrieb Cui, Flora: scheduler timeout is in jiffies Change-Id: I26708c163db943ff8d930dd81bcab4b4b9d84eb2 Signed-off-by: Flora Cui I actually suggested to do this consistently in amdgpu_device_get_job_timeout_settings after parsing the value. BTW: The test for negative

Re: [PATCH 01/13] drm/amdgpu: introduce and honour DRM_FORCE_AUTH workaround

2019-06-24 Thread Michel Dänzer
On 2019-06-21 5:52 p.m., Michel Dänzer wrote: > On 2019-06-21 5:44 p.m., Daniel Vetter wrote: >> On Fri, Jun 21, 2019 at 05:15:22PM +0200, Michel Dänzer wrote: >>> On 2019-06-21 1:50 p.m., Daniel Vetter wrote: On Fri, Jun 21, 2019 at 1:37 PM Christian König wrote: > Am 21.06.19 um 13

[PATCH] drm/amd/powerplay:clean up the residual mutex for smu_hw_init

2019-06-24 Thread Prike Liang
Change-Id: I1f071e465c97f70048df5b24466bc7e225833c7f Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index edd1da6..0be2845 100644

Re: [PATCH 01/13] drm/amdgpu: introduce and honour DRM_FORCE_AUTH workaround

2019-06-24 Thread Daniel Vetter
On Mon, Jun 24, 2019 at 11:37 AM Michel Dänzer wrote: > On 2019-06-21 5:52 p.m., Michel Dänzer wrote: > >> That was the entire point of kms, and it succeed really well. That's > >> why I don't think amdgpu doing their own flavour pick is going to help > >> anyone here, > > Other drivers are welcom

Re: [PATCH -next v3] drm/amdgpu: return 'ret' immediately if failed in amdgpu_pmu_init

2019-06-24 Thread Dan Carpenter
On Mon, Jun 24, 2019 at 05:29:33PM +0800, maowenan wrote: > > > On 2019/6/24 16:39, Dan Carpenter wrote: > > On Mon, Jun 24, 2019 at 11:45:32AM +0800, Mao Wenan wrote: > >> There is one warning: > >> drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c: In function ‘amdgpu_pmu_init’: > >> drivers/gpu/drm/amd/

Re: [PATCH] drm/amdgpu: fix scheduler timeout calc

2019-06-24 Thread Cui, Flora
OK. will update in v2. 在 6/24/2019 5:36 PM, Christian König 写道: > Am 24.06.19 um 10:50 schrieb Cui, Flora: >> scheduler timeout is in jiffies >> >> Change-Id: I26708c163db943ff8d930dd81bcab4b4b9d84eb2 >> Signed-off-by: Flora Cui > > I actually suggested to do this consistently in > amdgpu_device

[PATCH libdrm] drm: add fallback function to get device name

2019-06-24 Thread Wang, Kevin(Yang)
1.optimize code logic. 2.if not found device name in amdgpu.ids, will return a fallback device name "deviceid:revisionid", eg:69a0:01 Change-Id: I0d0c95a402533a74978681309680cb73d6a36e60 Signed-off-by: Kevin Wang --- amdgpu/amdgpu_asic_id.c | 131 --- amdgpu/

[PATCH -next v4] drm/amdgpu: return 'ret' immediately if failed in amdgpu_pmu_init

2019-06-24 Thread Mao Wenan
There is one warning: drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c: In function ‘amdgpu_pmu_init’: drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c:249:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] int ret = 0; ^ amdgpu_pmu_init() is called by amdgpu_device_init() in drivers/g

Re: [Intel-gfx] [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v10

2019-06-24 Thread Koenig, Christian
Am 21.06.19 um 18:27 schrieb Daniel Vetter: >>> Your scenario here is new, and iirc my suggestion back then was to >>> count the number of pending mappings so you don't go around calling >>> ->invalidate on mappings that don't exist. >> Well the key point is we don't call invalidate on mappings, bu

[PATCH libdrm v2] drm: add fallback function to get device name

2019-06-24 Thread Wang, Kevin(Yang)
1.optimize code logic. 2.if not found device name in amdgpu.ids, will return a fallback device name "deviceid:revisionid", eg:69a0:01 Change-Id: I0d0c95a402533a74978681309680cb73d6a36e60 Signed-off-by: Kevin Wang --- amdgpu/amdgpu_asic_id.c | 134 --- amdgpu/

[PATCH] drm/amdgpu: fix modprobe failure for uvd_4/5/6

2019-06-24 Thread Hawking Zhang
For uvd_4/5/6, amdgpu driver will only power on them when there are jobs assigned to decode/enc rings.uvd_4/5/6 dpm was broken since amdgpu_dpm_set_powergating_by_smu only covers gfx block. The change would add more IP block support in amdgpu_dpm_set_powergating_by_smu For GFX/UVD/VCN/VCE, if the

Re: [PATCH] drm/amdgpu: fix modprobe failure for uvd_4/5/6

2019-06-24 Thread Yin, Tianci (Rico)
Reviewed-by: Tianci Yin From: Hawking Zhang Sent: Monday, June 24, 2019 19:58 To: amd-gfx@lists.freedesktop.org; Deucher, Alexander; Yin, Tianci (Rico) Cc: Zhang, Hawking Subject: [PATCH] drm/amdgpu: fix modprobe failure for uvd_4/5/6 For uvd_4/5/6, amdgpu driver

[PATCH] drm/amdgpu: disable gfxoff on navi10

2019-06-24 Thread Tianci Yin
From: tiancyin The gfxoff brings unstability, disable it by default Change-Id: I43bdab0f93d64f7e207f96157665a2bb232f6956 Signed-off-by: tiancyin --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_

RE: [PATCH] drm/amdgpu: disable gfxoff on navi10

2019-06-24 Thread Zhang, Hawking
Reviewed-by: Hawking Zhang Regards, Hawking -Original Message- From: Tianci Yin Sent: 2019年6月24日 20:16 To: amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking ; Yin, Tianci (Rico) Subject: [PATCH] drm/amdgpu: disable gfxoff on navi10 From: tiancyin The gfxoff brings unstability, disab

[bug report] drm/amdkfd: Add procfs-style information for KFD processes

2019-06-24 Thread Dan Carpenter
Hello Kent Russell, The patch de9f26bbd384: "drm/amdkfd: Add procfs-style information for KFD processes" from Jun 13, 2019, leads to the following static checker warning: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:297 kfd_create_process() error: 'process' dereferencing po

[amd-staging-drm-next] broken after Navi merge

2019-06-24 Thread Dieter Nützel
Hello Alex, after your latest Navi merge 'amd-staging-drm-next' is broken with Polaris 20. It hangs with very light gray (mostly black) screen after first mode switch. Tested commit: 317d5033ab6c (HEAD -> amd-staging-drm-next, origin/amd-staging-drm-next) drm/amdgpu: add job->preamble_stat

RE: [PATCH 1/1] drm/amdkfd: Add queue status indicator to HQD dump

2019-06-24 Thread Zeng, Oak
Hi Felix, See one comment inline Regards, Oak -Original Message- From: amd-gfx On Behalf Of Kuehling, Felix Sent: Friday, June 21, 2019 3:48 PM To: amd-gfx@lists.freedesktop.org Cc: Kuehling, Felix Subject: [PATCH 1/1] drm/amdkfd: Add queue status indicator to HQD dump Make it easy t

Re: [PATCH] drm/amd/powerplay: no memory activity support on Vega10

2019-06-24 Thread Deucher, Alexander
Sounds good. Thanks for confirming. Alex From: Quan, Evan Sent: Monday, June 24, 2019 3:50 AM To: Deucher, Alexander; Russell, Kent; amd-gfx@lists.freedesktop.org Subject: RE: [PATCH] drm/amd/powerplay: no memory activity support on Vega10 Smu7 ASICs support m

RE: [amd-staging-drm-next] broken after Navi merge

2019-06-24 Thread Zhang, Hawking
Please pull my latest fixes that probably helps on issue you ran into. 61adda1f6f080717a9ee4c96a74c8df6ffab1ff0 drm/amdgpu: fix modprobe failure for uvd_4/5/6 Regards, Hawking -Original Message- From: amd-gfx On Behalf Of Dieter Nützel Sent: 2019年6月24日 21:29 To: Alex Deucher Cc: amd-dev

RE: [amd-staging-drm-next] broken after Navi merge

2019-06-24 Thread Zhang, Hawking
Ah, sorry, it has not landed yet. but the patch is in review list now. [PATCH] drm/amdgpu: fix modprobe failure for uvd_4/5/6 Regards, Hawking -Original Message- From: amd-gfx On Behalf Of Zhang, Hawking Sent: 2019年6月24日 21:50 To: Dieter Nützel ; Alex Deucher Cc: amd-devel Subject: RE:

Re: [Intel-gfx] [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v10

2019-06-24 Thread Christian König
Am 24.06.19 um 13:23 schrieb Koenig, Christian: Am 21.06.19 um 18:27 schrieb Daniel Vetter: So I pondered a few ideas while working out: 1) We drop this filtering. Importer needs to keep track of all its mappings and filter out invalidates that aren't for that specific importer (either because

[PATCH 1/6] dma-buf: add dynamic DMA-buf handling v11

2019-06-24 Thread Christian König
On the exporter side we add optional explicit pinning callbacks. If those callbacks are implemented the framework no longer caches sg tables and the map/unmap callbacks are always called with the lock of the reservation object held. On the importer side we add an optional invalidate callback. This

[PATCH 2/6] drm/ttm: remove the backing store if no placement is given

2019-06-24 Thread Christian König
Pipeline removal of the BOs backing store when no placement is given during validation. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c7de667d482a

[PATCH 3/6] drm/ttm: use the parent resv for ghost objects v2

2019-06-24 Thread Christian König
This way we can even pipeline imported BO evictions. v2: Limit this to only cases when the parent object uses a separate reservation object as well. This fixes another OOM problem. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo_util.c | 20 +++- 1 file changed

[PATCH 6/6] drm/amdgpu: add independent DMA-buf import v7

2019-06-24 Thread Christian König
Instead of relying on the DRM functions just implement our own import functions. This prepares support for taking care of unpinned DMA-buf. v2: enable for all exporters, not just amdgpu, fix invalidation handling, lock reservation object while setting callback v3: change to new dma_buf attach

[PATCH 5/6] drm/amdgpu: add independent DMA-buf export v6

2019-06-24 Thread Christian König
The caching of SGT's is actually quite harmful and should probably removed altogether when all drivers are audited. Start by providing a separate DMA-buf export implementation in amdgpu. This is also a prerequisite of unpinned DMA-buf handling. v2: fix unintended recursion, remove debugging lefto

[PATCH 4/6] drm/amdgpu: use allowed_domains for exported DMA-bufs

2019-06-24 Thread Christian König
Avoid that we ping/pong the buffers when we stop to pin DMA-buf exports by using the allowed domains for exported buffers. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/

Re: [PATCH v17 04/15] mm, arm64: untag user pointers passed to memory syscalls

2019-06-24 Thread Andrey Konovalov
On Wed, Jun 19, 2019 at 6:46 PM Khalid Aziz wrote: > > On 6/19/19 9:55 AM, Khalid Aziz wrote: > > On 6/12/19 5:43 AM, Andrey Konovalov wrote: > >> This patch is a part of a series that extends arm64 kernel ABI to allow to > >> pass tagged user pointers (with the top byte set to something else othe

[PATCH v18 00/15] arm64: untag user pointers passed to the kernel

2019-06-24 Thread Andrey Konovalov
=== Overview arm64 has a feature called Top Byte Ignore, which allows to embed pointer tags into the top byte of each pointer. Userspace programs (such as HWASan, a memory debugging tool [1]) might use this feature and pass tagged user pointers to the kernel through syscalls or other interfaces.

[PATCH v18 01/15] arm64: untag user pointers in access_ok and __uaccess_mask_ptr

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. copy_from_user (and a few other similar functions) are used to copy data from user memory into the kernel memory or vice ve

[PATCH v18 02/15] arm64: Introduce prctl() options to control the tagged user addresses ABI

2019-06-24 Thread Andrey Konovalov
From: Catalin Marinas It is not desirable to relax the ABI to allow tagged user addresses into the kernel indiscriminately. This patch introduces a prctl() interface for enabling or disabling the tagged ABI with a global sysctl control for preventing applications from enabling the relaxed ABI (me

[PATCH v18 05/15] mm: untag user pointers in mm/gup.c

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. mm/gup.c provides a kernel interface that accepts user addresses and manipulates user pages directly (for example get_user_

[PATCH v18 04/15] mm: untag user pointers passed to memory syscalls

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. This patch allows tagged pointers to be passed to the following memory syscalls: get_mempolicy, madvise, mbind, mincore, ml

[PATCH v18 07/15] fs/namespace: untag user pointers in copy_mount_options

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. In copy_mount_options a user address is being subtracted from TASK_SIZE. If the address is lower than TASK_SIZE, the size i

[PATCH v18 08/15] userfaultfd: untag user pointers

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. userfaultfd code use provided user pointers for vma lookups, which can only by done with untagged pointers. Untag user poi

[PATCH v18 06/15] mm: untag user pointers in get_vaddr_frames

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. get_vaddr_frames uses provided user pointers for vma lookups, which can only by done with untagged pointers. Instead of loc

[PATCH v18 13/15] tee/shm: untag user pointers in tee_shm_register

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. tee_shm_register()->optee_shm_unregister()->check_mem_type() uses provided user pointers for vma lookups (via __check_mem_t

[PATCH v18 14/15] vfio/type1: untag user pointers in vaddr_get_pfn

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. vaddr_get_pfn() uses provided user pointers for vma lookups, which can only by done with untagged pointers. Untag user poi

[PATCH v18 15/15] selftests, arm64: add a selftest for passing tagged pointers to kernel

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. This patch adds a simple test, that calls the uname syscall with a tagged user pointer as an argument. Without the kernel a

[PATCH v18 12/15] media/v4l2-core: untag user pointers in videobuf_dma_contig_user_get

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. videobuf_dma_contig_user_get() uses provided user pointers for vma lookups, which can only by done with untagged pointers.

[PATCH v18 11/15] IB/mlx4: untag user pointers in mlx4_get_umem_mr

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. mlx4_get_umem_mr() uses provided user pointers for vma lookups, which can only by done with untagged pointers. Untag user

[PATCH v18 10/15] drm/radeon: untag user pointers in radeon_gem_userptr_ioctl

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. In radeon_gem_userptr_ioctl() an MMU notifier is set up with a (tagged) userspace pointer. The untagged address should be u

[PATCH v18 09/15] drm/amdgpu: untag user pointers

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. In amdgpu_gem_userptr_ioctl() and amdgpu_amdkfd_gpuvm.c/init_user_pages() an MMU notifier is set up with a (tagged) userspa

[PATCH v18 03/15] lib: untag user pointers in strn*_user

2019-06-24 Thread Andrey Konovalov
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. strncpy_from_user and strnlen_user accept user addresses as arguments, and do not go through the same path as copy_from_use

Re: [Intel-gfx] [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v10

2019-06-24 Thread Daniel Vetter
On Mon, Jun 24, 2019 at 11:23:34AM +, Koenig, Christian wrote: > Am 21.06.19 um 18:27 schrieb Daniel Vetter: > >>> Your scenario here is new, and iirc my suggestion back then was to > >>> count the number of pending mappings so you don't go around calling > >>> ->invalidate on mappings that don

Re: [Intel-gfx] [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v10

2019-06-24 Thread Daniel Vetter
On Mon, Jun 24, 2019 at 03:58:00PM +0200, Christian König wrote: > Am 24.06.19 um 13:23 schrieb Koenig, Christian: > > Am 21.06.19 um 18:27 schrieb Daniel Vetter: > > > > > So I pondered a few ideas while working out: > > > > > > 1) We drop this filtering. Importer needs to keep track of all its

[pull] amdgpu drm-next-5.3

2019-06-24 Thread Alex Deucher
Hi Dave, Daniel, Just a follow up pull to fix a regression on older asics due to the navi10 merge. The following changes since commit f3f48d7331cf5ad9a6b3a6beff38f3dad1871b49: drm/amdgpu: drop unused df init callback (2019-06-22 09:34:14 -0500) are available in the Git repository at: git:/

Re: [PATCH v18 09/15] drm/amdgpu: untag user pointers

2019-06-24 Thread Kees Cook
On Mon, Jun 24, 2019 at 04:32:54PM +0200, Andrey Konovalov wrote: > This patch is a part of a series that extends kernel ABI to allow to pass > tagged user pointers (with the top byte set to something else other than > 0x00) as syscall arguments. > > In amdgpu_gem_userptr_ioctl() and amdgpu_amdkfd

Re: [PATCH v18 10/15] drm/radeon: untag user pointers in radeon_gem_userptr_ioctl

2019-06-24 Thread Kees Cook
On Mon, Jun 24, 2019 at 04:32:55PM +0200, Andrey Konovalov wrote: > This patch is a part of a series that extends kernel ABI to allow to pass > tagged user pointers (with the top byte set to something else other than > 0x00) as syscall arguments. > > In radeon_gem_userptr_ioctl() an MMU notifier i

Re: [PATCH v18 11/15] IB/mlx4: untag user pointers in mlx4_get_umem_mr

2019-06-24 Thread Kees Cook
On Mon, Jun 24, 2019 at 04:32:56PM +0200, Andrey Konovalov wrote: > This patch is a part of a series that extends kernel ABI to allow to pass > tagged user pointers (with the top byte set to something else other than > 0x00) as syscall arguments. > > mlx4_get_umem_mr() uses provided user pointers

Re: [PATCH v18 15/15] selftests, arm64: add a selftest for passing tagged pointers to kernel

2019-06-24 Thread Kees Cook
On Mon, Jun 24, 2019 at 04:33:00PM +0200, Andrey Konovalov wrote: > This patch is a part of a series that extends kernel ABI to allow to pass > tagged user pointers (with the top byte set to something else other than > 0x00) as syscall arguments. > > This patch adds a simple test, that calls the u

Re: [PATCH v18 10/15] drm/radeon: untag user pointers in radeon_gem_userptr_ioctl

2019-06-24 Thread Kees Cook
On Mon, Jun 24, 2019 at 04:32:55PM +0200, Andrey Konovalov wrote: > This patch is a part of a series that extends kernel ABI to allow to pass > tagged user pointers (with the top byte set to something else other than > 0x00) as syscall arguments. > > In radeon_gem_userptr_ioctl() an MMU notifier i

Re: [PATCH v18 02/15] arm64: Introduce prctl() options to control the tagged user addresses ABI

2019-06-24 Thread Kees Cook
On Mon, Jun 24, 2019 at 04:32:47PM +0200, Andrey Konovalov wrote: > From: Catalin Marinas > > It is not desirable to relax the ABI to allow tagged user addresses into > the kernel indiscriminately. This patch introduces a prctl() interface > for enabling or disabling the tagged ABI with a global

[PATCH 3/6] drm/amd/amdgpu: amdgpu_hwmon_show_temp: initialize temp

2019-06-24 Thread Ernst Sjöstrand
Reported by smatch: drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:1496 amdgpu_hwmon_show_temp() error: uninitialized symbol 'temp'. Signed-off-by: Ernst Sjöstrand --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/a

[PATCH 6/6] drm/amd/amdgpu: sdma_v4_0_start: initialize r

2019-06-24 Thread Ernst Sjöstrand
Reported by smatch: drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1167 sdma_v4_0_start() error: uninitialized symbol 'r'. Signed-off-by: Ernst Sjöstrand --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c

[PATCH 5/6] drm/amd/amdgpu: Fix style issues in dcn20_resource.c

2019-06-24 Thread Ernst Sjöstrand
Inconsistent indentation and mixed use of brackets. Signed-off-by: Ernst Sjöstrand --- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd

[PATCH 2/6] drm/amd/amdgpu: Fix amdgpu_set_pp_od_clk_voltage error check

2019-06-24 Thread Ernst Sjöstrand
Reported by smatch: drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:693 amdgpu_set_pp_od_clk_voltage() error: uninitialized symbol 'ret'. Signed-off-by: Ernst Sjöstrand --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/

[PATCH 1/6] drm/amd/amdgpu: Indent AMD_IS_APU properly

2019-06-24 Thread Ernst Sjöstrand
Reported by smatch: drivers/gpu/drm/amd/amdgpu/soc15.c:715 soc15_get_pcie_usage() warn: inconsistent indenting And a similar one in si.c. Signed-off-by: Ernst Sjöstrand --- drivers/gpu/drm/amd/amdgpu/si.c| 4 ++-- drivers/gpu/drm/amd/amdgpu/soc15.c | 4 ++-- 2 files changed, 4 insertions(+)

[PATCH 4/6] drm/amd/amdgpu: Check stream in amdgpu_dm_commit_planes

2019-06-24 Thread Ernst Sjöstrand
Reported by smatch: amdgpu_dm.c:5637 amdgpu_dm_commit_planes() error: we previously assumed 'acrtc_state->stream' could be null This seems to be checked for null pretty consistently elsewhere. Signed-off-by: Ernst Sjöstrand --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file c

[PATCH] drm/amdgpu/display: drop ifdefs around comments

2019-06-24 Thread Alex Deucher
No need to protect the comments. The DCN1_01 config was dopped anyway. Got accidently brought back with the navi merge. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dc

Re: [PATCH] drm/amdgpu/display: drop ifdefs around comments

2019-06-24 Thread Kazlauskas, Nicholas
On 6/24/19 11:16 AM, Alex Deucher wrote: > No need to protect the comments. The DCN1_01 config > was dopped anyway. Got accidently brought back with the > navi merge. > > Signed-off-by: Alex Deucher Reviewed-by: Nicholas Kazlauskas > --- > drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.

[PATCH libdrm 0/2] amdgpu: Minor cleanups

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer I stumbled over these while working on bigger changes. Michel Dänzer (2): amdgpu: Move union declaration to top of amdgpu_cs_ctx_override_priority amdgpu: Update amdgpu_bo_handle_type_kms_noimport documentation amdgpu/amdgpu.h| 4 ++-- amdgpu/amdgpu_cs.c | 2 +-

[PATCH libdrm 1/2] amdgpu: Move union declaration to top of amdgpu_cs_ctx_override_priority

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer Avoids compiler warning: ../../amdgpu/amdgpu_cs.c: In function 'amdgpu_cs_ctx_override_priority': ../../amdgpu/amdgpu_cs.c:155:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] union drm_amdgpu_sched args; ^ Signed-off-by: Miche

[PATCH libdrm 2/2] amdgpu: Update amdgpu_bo_handle_type_kms_noimport documentation

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer To reflect current reality. Signed-off-by: Michel Dänzer --- amdgpu/amdgpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index 9d9b0832..66e45f73 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -87,8 +87,8

Re: [PATCH libdrm v2] drm: add fallback function to get device name

2019-06-24 Thread Wang, Kevin(Yang)
changes history: v1: 1. Simplify the old code logic, 2. Provides a backup function when the name is not found in the amdgpu.ids file v2: 1. when open ids file fail, not ids version or ids version not matched, it will generate a device name by device id and revision id. eg:69a0:01

[PATCH libdrm 3/9] amdgpu: Rename fd_mutex/list to dev_mutex/list

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer Seems to better reflect what they're for. Signed-off-by: Michel Dänzer --- amdgpu/amdgpu_device.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c index 362494b1..76b4e5eb 10

[PATCH libdrm 8/9] amdgpu: Drop refcount member from struct amdgpu_core_bo/device

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer We can just walk the lists of struct amdgpu_bo/device to find out if there are any references left. Signed-off-by: Michel Dänzer --- amdgpu/amdgpu_bo.c | 14 +++--- amdgpu/amdgpu_device.c | 30 ++ amdgpu/amdgpu_internal.h | 2 --

[PATCH mesa 9/9] winsys/amdgpu: Use amdgpu_bo_handle_type_kms_user for API KMS handles

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer Gallium API callers expect the returned handles to be valid for the DRM file descriptor passed to the driver during initialization, which may not be the case with amdgpu_bo_handle_type_kms. Bugzilla: https://bugs.freedesktop.org/110903 Signed-off-by: Michel Dänzer --- src/g

[PATCH libdrm 2/9] amdgpu: Add BO handle to table in amdgpu_bo_create

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer Simplifies its callers. dev->bo_table_mutex is now always held when amdgpu_bo_create is called (this was already the case in amdgpu_bo_import). Signed-off-by: Michel Dänzer --- amdgpu/amdgpu_bo.c | 32 1 file changed, 12 insertions(+), 20 d

[PATCH libdrm 1/9] amdgpu: Pass file descriptor directly to amdgpu_close_kms_handle

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer And propagate drmIoctl's return value. This allows replacing all remaining open-coded DRM_IOCTL_GEM_CLOSE ioctl calls with amdgpu_close_kms_handle calls. Signed-off-by: Michel Dänzer --- amdgpu/amdgpu_bo.c | 35 +++ 1 file changed, 15 insert

[PATCH libdrm 0/9] amdgpu:

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer The motivation for these patches is https://bugs.freedesktop.org/110903 . Patches 1-3 are preparatory. Patches 4 & 5 are the core patches allowing the issues discussed in the bug report to be fixed. Patches 6-8 are further optimizations / cleanups. Patch 9 is the Mesa patc

[PATCH libdrm 7/9] amdgpu: Use normal integers for device / core BO reference counting

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer The dev_mutex / dev->bo_table_mutex is always locked when accessing the reference counts, so no need for atomic operations. Signed-off-by: Michel Dänzer --- amdgpu/amdgpu_bo.c | 6 +++--- amdgpu/amdgpu_device.c | 18 ++ amdgpu/amdgpu_internal.h | 6

[PATCH libdrm 6/9] amdgpu: Re-use an existing amdgpu_device when possible

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer It's possible if amdgpu_device's user_fd references the same file description as the fd passed to amdgpu_device_initialize. Signed-off-by: Michel Dänzer --- amdgpu/amdgpu_device.c | 76 +--- amdgpu/amdgpu_internal.h | 3 +- 2 files cha

[PATCH libdrm 5/9] amdgpu: Add amdgpu_bo_handle_type_kms_user

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer amdgpu_bo_handle_type_kms returns the handle valid for the DRM file descriptor (fd) used for CS submission etc. This is also valid for the fd passed to amdgpu_device_initialize the first time for a specific GPU, but in general not for fds passed to amdgpu_device_initialize lat

[PATCH libdrm 4/9] amdgpu: Add struct amdgpu_core_device and amdgpu_core_bo

2019-06-24 Thread Michel Dänzer
From: Michel Dänzer They can be referenced by any number of struct amdgpu_device/bo, which are used for amdgpu_device/bo_handle in the public API. This allows keeping track of the DRM file descriptor passed to amdgpu_device_initialize and the one used for CS submission etc. separately. The core

Re: [PATCH libdrm 0/2] amdgpu: Minor cleanups

2019-06-24 Thread Christian König
Reviewed-by: Christian König for the series. Am 24.06.19 um 17:45 schrieb Michel Dänzer: From: Michel Dänzer I stumbled over these while working on bigger changes. Michel Dänzer (2): amdgpu: Move union declaration to top of amdgpu_cs_ctx_override_priority amdgpu: Update amdgpu_bo_

Re: [PATCH libdrm 0/9] amdgpu:

2019-06-24 Thread Christian König
Patches #1 - #3 look good to me, but I'm not sure if the rest is such a good idea. Basically you not only want to use the same FD for CS, but also for basically all buffer functions and as far as I can see we break that here. I would rather add a new function to export the KMS handle for a ce

Re: [PATCH v18 15/15] selftests, arm64: add a selftest for passing tagged pointers to kernel

2019-06-24 Thread Catalin Marinas
On Mon, Jun 24, 2019 at 04:33:00PM +0200, Andrey Konovalov wrote: > --- /dev/null > +++ b/tools/testing/selftests/arm64/tags_test.c > @@ -0,0 +1,29 @@ > +// SPDX-License-Identifier: GPL-2.0 > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define SHIFT_TAG(ta

Re: [PATCH v18 11/15] IB/mlx4: untag user pointers in mlx4_get_umem_mr

2019-06-24 Thread Catalin Marinas
On Mon, Jun 24, 2019 at 04:32:56PM +0200, Andrey Konovalov wrote: > This patch is a part of a series that extends kernel ABI to allow to pass > tagged user pointers (with the top byte set to something else other than > 0x00) as syscall arguments. > > mlx4_get_umem_mr() uses provided user pointers

RE: [PATCH -next v4] drm/amdgpu: return 'ret' immediately if failed in amdgpu_pmu_init

2019-06-24 Thread Kim, Jonathan
Immediate return should be ok since perf registration isn't dependent on gpu hw. Reviewed-by: Jonathan Kim -Original Message- From: Mao Wenan Sent: Monday, June 24, 2019 7:23 AM To: airl...@linux.ie; dan...@ffwll.ch; Deucher, Alexander ; Koenig, Christian ; Zhou, David(ChunMing) ; da

Re: [PATCH 6/6] drm/amd/amdgpu: sdma_v4_0_start: initialize r

2019-06-24 Thread Alex Deucher
Applied the series. Thanks! Alex On Mon, Jun 24, 2019 at 11:16 AM Ernst Sjöstrand wrote: > > Reported by smatch: > drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1167 sdma_v4_0_start() error: > uninitialized symbol 'r'. > > Signed-off-by: Ernst Sjöstrand > --- > drivers/gpu/drm/amd/amdgpu/sdma_v4_0.

Re: [PATCH v18 07/15] fs/namespace: untag user pointers in copy_mount_options

2019-06-24 Thread Catalin Marinas
On Mon, Jun 24, 2019 at 04:32:52PM +0200, Andrey Konovalov wrote: > This patch is a part of a series that extends kernel ABI to allow to pass > tagged user pointers (with the top byte set to something else other than > 0x00) as syscall arguments. > > In copy_mount_options a user address is being s

Re: [PATCH v18 08/15] userfaultfd: untag user pointers

2019-06-24 Thread Catalin Marinas
On Mon, Jun 24, 2019 at 04:32:53PM +0200, Andrey Konovalov wrote: > This patch is a part of a series that extends kernel ABI to allow to pass > tagged user pointers (with the top byte set to something else other than > 0x00) as syscall arguments. > > userfaultfd code use provided user pointers for

[PATCH] drm/amd/display: update infoframe after dig fe is turned on (v2)

2019-06-24 Thread Nicholas Kazlauskas
[Why] The AVI infoframe is incorrectly programmed on DCN1/2 when enabling a stream - causing the wrong pixel encoding to be used for display. This is because the AVI infoframe is programmed before the DIG BE is connected to the FE and turned on, so enabling the AFMT block doesn't actually work and

[PATCH v2] drm/amd/display: update infoframe after dig fe is turned on (v2)

2019-06-24 Thread Nicholas Kazlauskas
[Why] The AVI infoframe is incorrectly programmed on DCN1/2 when enabling a stream - causing the wrong pixel encoding to be used for display. This is because the AVI infoframe is programmed before the DIG BE is connected to the FE and turned on, so enabling the AFMT block doesn't actually work and

Re: [PATCH v2] drm/amd/display: update infoframe after dig fe is turned on (v2)

2019-06-24 Thread Deucher, Alexander
Acked-by: Alex Deucher From: amd-gfx on behalf of Nicholas Kazlauskas Sent: Monday, June 24, 2019 1:58 PM To: amd-gfx@lists.freedesktop.org Cc: Li, Sun peng (Leo); Wentland, Harry; Kazlauskas, Nicholas; Li, Roman Subject: [PATCH v2] drm/amd/display: update info

RE: [bug report] drm/amdkfd: Add procfs-style information for KFD processes

2019-06-24 Thread Russell, Kent
HI Dan, I'll comment inline with [KR] for the most part. Most of these come from the fact that "failure" here is not critical. If we can't make the procfs, we just comment about it in dmesg and carry on. If we fail to make the procfs structure here, we just report and carry on. The rest of the

Re: [amd-staging-drm-next] broken after Navi merge

2019-06-24 Thread Dieter Nützel
Hello Hawking, hello all, up and running. I saw that Alex sent it in for 5.3 already. Thank you very much! BTW This isn't needed for pre Navi? CONFIG_DRM_AMD_DC_DCN2_0=y CONFIG_DRM_AMD_DC_DSC_SUPPORT=y But do not harm? glmark2 seems to be somewhat faster, again ;-) Dieter Am 24.06.2019 15:53

Re: [PATCH v2] drm/amd/display: update infoframe after dig fe is turned on (v2)

2019-06-24 Thread Lakha, Bhawanpreet
Reviewed-by: Bhawanpreet Lakha On 2019-06-24 2:00 p.m., Deucher, Alexander wrote: Acked-by: Alex Deucher From: amd-gfx on behalf of Nicholas

[PATCH v4 hmm 10/12] mm/hmm: Poison hmm_range during unregister

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe Trying to misuse a range outside its lifetime is a kernel bug. Use poison bytes to help detect this condition. Double unregister will reliably crash. Signed-off-by: Jason Gunthorpe Reviewed-by: Jérôme Glisse Reviewed-by: John Hubbard Acked-by: Souptick Joarder Reviewed-

[PATCH v4 hmm 00/12]

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe This patch series arised out of discussions with Jerome when looking at the ODP changes, particularly informed by use after free races we have already found and fixed in the ODP code (thanks to syzkaller) working with mmu notifiers, and the discussion with Ralph on how to re

[PATCH v4 hmm 03/12] mm/hmm: Hold a mmgrab from hmm to mm

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe So long as a struct hmm pointer exists, so should the struct mm it is linked too. Hold the mmgrab() as soon as a hmm is created, and mmdrop() it once the hmm refcount goes to zero. Since mmdrop() (ie a 0 kref on struct mm) is now impossible with a !NULL mm->hmm delete the h

[PATCH v4 hmm 11/12] mm/hmm: Remove confusing comment and logic from hmm_release

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe hmm_release() is called exactly once per hmm. ops->release() cannot accidentally trigger any action that would recurse back onto hmm->mirrors_sem. This fixes a use after-free race of the form: CPU0 CPU1

[PATCH v4 hmm 07/12] mm/hmm: Hold on to the mmget for the lifetime of the range

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe Range functions like hmm_range_snapshot() and hmm_range_fault() call find_vma, which requires hodling the mmget() and the mmap_sem for the mm. Make this simpler for the callers by holding the mmget() inside the range for the lifetime of the range. Other functions that accep

[PATCH v4 hmm 01/12] mm/hmm: fix use after free with struct hmm in the mmu notifiers

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe mmu_notifier_unregister_no_release() is not a fence and the mmu_notifier system will continue to reference hmm->mn until the srcu grace period expires. Resulting in use after free races like this: CPU0 CPU1

  1   2   >