Re: [PATCH 08/24] drm/amd/display: add audio related regs

2019-06-24 Thread Dave Airlie
On Fri, 7 Jun 2019 at 06:55, Bhawanpreet Lakha wrote: > > From: Charlene Liu > > Signed-off-by: Charlene Liu > Reviewed-by: Chris Park > Acked-by: Bhawanpreet Lakha > --- > drivers/gpu/drm/amd/display/dc/dce/dce_audio.c | 4 +--- > drivers/gpu/drm/amd/display/dc/dce/dce_audio.h | 7 +++ >

Re: arm32 build failure after abe882a39a9c ("drm/amd/display: fix issue with eDP not detected on driver load")

2019-06-24 Thread Dave Airlie
Hi Alex, please resolve this ASAP, I cannot pull your tree without this fixed as it breaks my arm builds here. an 8 second delay there seems pointless and arbitary, an 8 sec delay there without a comment, seems like a lack of review. Dave. On Tue, 18 Jun 2019 at 11:12, Nathan Chancellor wrote:

[PATCH v4 hmm 06/12] mm/hmm: Do not use list*_rcu() for hmm->ranges

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe This list is always read and written while holding hmm->lock so there is no need for the confusing _rcu annotations. Signed-off-by: Jason Gunthorpe Reviewed-by: Jérôme Glisse Reviewed-by: John Hubbard Acked-by: Souptick Joarder Reviewed-by: Ralph Campbell Reviewed-by:

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

2019-06-24 Thread Dan Carpenter
On Mon, Jun 24, 2019 at 06:06:36PM +, Russell, Kent wrote: > 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

[PATCH v4 hmm 05/12] mm/hmm: Remove duplicate condition test before wait_event_timeout

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe The wait_event_timeout macro already tests the condition as its first action, so there is no reason to open code another version of this, all that does is skip the might_sleep() debugging in common cases, which is not helpful. Further, based on prior patches, we can now sim

[PATCH v4 hmm 08/12] mm/hmm: Use lockdep instead of comments

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe So we can check locking at runtime. Signed-off-by: Jason Gunthorpe Reviewed-by: Jérôme Glisse Reviewed-by: John Hubbard Reviewed-by: Ralph Campbell Acked-by: Souptick Joarder Reviewed-by: Christoph Hellwig Tested-by: Philip Yang --- v2 - Fix missing & in lockdeps (Ja

[PATCH v4 hmm 12/12] mm/hmm: Fix error flows in hmm_invalidate_range_start

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe If the trylock on the hmm->mirrors_sem fails the function will return without decrementing the notifiers that were previously incremented. Since the caller will not call invalidate_range_end() on EAGAIN this will result in notifiers becoming permanently incremented and deadl

[PATCH v4 hmm 02/12] mm/hmm: Use hmm_mirror not mm as an argument for hmm_range_register

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe Ralph observes that hmm_range_register() can only be called by a driver while a mirror is registered. Make this clear in the API by passing in the mirror structure as a parameter. This also simplifies understanding the lifetime model for struct hmm, as the hmm pointer must

[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

[PATCH v4 hmm 04/12] mm/hmm: Simplify hmm_get_or_create and make it reliable

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe As coded this function can false-fail in various racy situations. Make it reliable and simpler by running under the write side of the mmap_sem and avoiding the false-failing compare/exchange pattern. Due to the mmap_sem this no longer has to avoid racing with a 2nd parallel

[PATCH v4 hmm 09/12] mm/hmm: Remove racy protection against double-unregistration

2019-06-24 Thread Jason Gunthorpe
From: Jason Gunthorpe No other register/unregister kernel API attempts to provide this kind of protection as it is inherently racy, so just drop it. Callers should provide their own protection, and it appears nouveau already does. Signed-off-by: Jason Gunthorpe Reviewed-by: Jérôme Glisse Revi

[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 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

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

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: [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: [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

[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

[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

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

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 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 -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 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 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 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 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_

[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

[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 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 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 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

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 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] 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] 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

[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 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 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 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

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

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 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 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 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 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

[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: [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

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

[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

[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 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 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 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 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 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 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 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 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 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 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 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.

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 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/

[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 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 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

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

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: [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: [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: [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

[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

[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

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

[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: 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: 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

[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/

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 -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

[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/

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

  1   2   >