Re: [PATCH AUTOSEL 5.10 13/22] drm/amdgpu: install stub fence into potential unused fence pointers

2023-08-31 Thread Chia-I Wu
On Thu, Aug 31, 2023 at 7:01 AM Greg KH wrote: > > On Thu, Aug 31, 2023 at 03:26:28PM +0200, Christian König wrote: > > Am 31.08.23 um 12:56 schrieb Greg KH: > > > On Thu, Aug 31, 2023 at 12:27:27PM +0200, Christian König wrote: > > > > Am 30.08.23 um 20:53 sc

Re: [PATCH AUTOSEL 5.10 13/22] drm/amdgpu: install stub fence into potential unused fence pointers

2023-08-30 Thread Chia-I Wu
On Sun, Jul 23, 2023 at 6:24 PM Sasha Levin wrote: > > From: Lang Yu > > [ Upstream commit 187916e6ed9d0c3b3abc27429f7a5f8c936bd1f0 ] > > When using cpu to update page tables, vm update fences are unused. > Install stub fence into these fence pointers instead of NULL > to avoid NULL dereference

Re: [PATCH] drm/amdgpu: fix xclk freq on CHIP_STONEY

2023-06-02 Thread Chia-I Wu
On Fri, Jun 2, 2023 at 11:50 AM Alex Deucher wrote: > > Nevermind, missing your Signed-off-by. Please add and I'll apply. Sorry that I keep forgetting... This patch is Signed-off-by: Chia-I Wu I can send v2 if necessary. > > Alex >

[PATCH v3] amdgpu: validate offset_in_bo of drm_amdgpu_gem_va

2023-06-01 Thread Chia-I Wu
y use the VM map parameters") Signed-off-by: Chia-I Wu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 22f9a65ca0fc7..76d

[PATCH] drm/amdgpu: fix xclk freq on CHIP_STONEY

2023-06-01 Thread Chia-I Wu
According to Alex, most APUs from that time seem to have the same issue (vbios says 48Mhz, actual is 100Mhz). I only have a CHIP_STONEY so I limit the fixup to CHIP_STONEY --- drivers/gpu/drm/amd/amdgpu/vi.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git

[PATCH v2] amdgpu: validate drm_amdgpu_gem_va addrs

2023-05-23 Thread Chia-I Wu
offset_in_bo+map_size overflows. Userspace (radeonsi and radv) seems fine as well. v2: keep the validations in amdgpu_vm_bo_map Fixes: 9f7eb5367d00 ("drm/amdgpu: actually use the VM map parameters") Signed-off-by: Chia-I Wu --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 15 +++ d

Re: [PATCH 1/2] amdgpu: validate drm_amdgpu_gem_va addrs for all ops

2023-05-23 Thread Chia-I Wu
On Mon, May 22, 2023 at 12:12 PM Christian König wrote: > > Am 21.05.23 um 20:49 schrieb Chia-I Wu: > > On Thu, May 18, 2023 at 1:12 PM Alex Deucher wrote: > >> On Wed, May 17, 2023 at 5:27 PM Chia-I Wu wrote: > >>> On Tue, May 9, 2023 at 11:33 AM Chia-I Wu

Re: [PATCH 1/2] amdgpu: validate drm_amdgpu_gem_va addrs for all ops

2023-05-21 Thread Chia-I Wu
On Thu, May 18, 2023 at 1:12 PM Alex Deucher wrote: > > On Wed, May 17, 2023 at 5:27 PM Chia-I Wu wrote: > > > > On Tue, May 9, 2023 at 11:33 AM Chia-I Wu wrote: > > > > > > Extend the address and size validations to AMDGPU_VA_OP_UNMAP and > > >

Re: [PATCH 1/2] amdgpu: validate drm_amdgpu_gem_va addrs for all ops

2023-05-17 Thread Chia-I Wu
On Tue, May 9, 2023 at 11:33 AM Chia-I Wu wrote: > > Extend the address and size validations to AMDGPU_VA_OP_UNMAP and > AMDGPU_VA_OP_CLEAR by moving the validations to amdgpu_gem_va_ioctl. > > Internal users of amdgpu_vm_bo_map are no longer validated but they > should be f

[PATCH 2/2] amdgpu: validate drm_amdgpu_gem_va against overflows

2023-05-09 Thread Chia-I Wu
The existing validations are incorrect and insufficient. This is motivated by OOB access in amdgpu_vm_update_range when offset_in_bo+map_size overflows. Fixes: 9f7eb5367d00 ("drm/amdgpu: actually use the VM map parameters") --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 7 +--

[PATCH 1/2] amdgpu: validate drm_amdgpu_gem_va addrs for all ops

2023-05-09 Thread Chia-I Wu
Extend the address and size validations to AMDGPU_VA_OP_UNMAP and AMDGPU_VA_OP_CLEAR by moving the validations to amdgpu_gem_va_ioctl. Internal users of amdgpu_vm_bo_map are no longer validated but they should be fine. Userspace (radeonsi and radv) seems fine as well. ---

Re: [PATCH v2] drm/amdgpu: add a missing lock for AMDGPU_SCHED

2023-04-26 Thread Chia-I Wu
On Wed, Apr 26, 2023 at 4:05 AM Christian König wrote: > > Am 26.04.23 um 08:17 schrieb Chia-I Wu: > > mgr->ctx_handles should be protected by mgr->lock. > > > > v2: improve commit message > > > > Signed-off-by: Chia-I Wu > > Cc: sta...@

[PATCH v3] drm/amdgpu: add a missing lock for AMDGPU_SCHED

2023-04-26 Thread Chia-I Wu
mgr->ctx_handles should be protected by mgr->lock. v2: improve commit message v3: add a Fixes tag Signed-off-by: Chia-I Wu Reviewed-by: Christian König Fixes: 52c6a62c64fac ("drm/amdgpu: add interface for editing a foreign process's priority v3") --- drivers/gpu/drm/amd/amdgp

Re: [PATCH] drm/amdgpu: add a missing lock for AMDGPU_SCHED

2023-04-26 Thread Chia-I Wu
On Tue, Apr 25, 2023 at 9:58 PM Greg KH wrote: > > On Tue, Apr 25, 2023 at 05:48:27PM -0700, Chia-I Wu wrote: > > Signed-off-by: Chia-I Wu > > Cc: sta...@vger.kernel.org > > I know I can not take patches without any changelog text at all, maybe > the DRM develo

[PATCH v2] drm/amdgpu: add a missing lock for AMDGPU_SCHED

2023-04-26 Thread Chia-I Wu
mgr->ctx_handles should be protected by mgr->lock. v2: improve commit message Signed-off-by: Chia-I Wu Cc: sta...@vger.kernel.org --- drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sche

Re: [PATCH] drm/amdgpu: add a missing lock for AMDGPU_SCHED

2023-04-25 Thread Chia-I Wu
- > > From: amd-gfx On Behalf Of Chia- > > I Wu > > Sent: Wednesday, April 26, 2023 8:48 AM > > To: dri-devel@lists.freedesktop.org > > Cc: Pan, Xinhui ; linux-ker...@vger.kernel.org; > > sta...@vger.kernel.org; amd-...@lists.freedesktop.org; Daniel Vett

[PATCH] drm/amdgpu: add a missing lock for AMDGPU_SCHED

2023-04-25 Thread Chia-I Wu
Signed-off-by: Chia-I Wu Cc: sta...@vger.kernel.org --- drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c index e9b45089a28a6..863b2a34b2d64

[PATCH] drm/amdkfd: fix potential kgd_mem UAFs

2023-03-08 Thread Chia-I Wu
kgd_mem should be accessed with p->mutex locked, or it could have been freed by kfd_ioctl_free_memory_of_gpu. Signed-off-by: Chia-I Wu --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amd

[PATCH] drm/amdkfd: fix a potential double free in pqm_create_queue

2023-03-07 Thread Chia-I Wu
Set *q to NULL on errors, otherwise pqm_create_queue would free it again. Signed-off-by: Chia-I Wu --- drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers

Re: [PATCH v2 0/3] drm/msm/gpu: Devfreq fixes+tuning

2023-01-13 Thread Chia-I Wu
Series is Reviewed-by: Chia-I Wu On Tue, Jan 10, 2023 at 3:14 PM Rob Clark wrote: > > From: Rob Clark > > Rob Clark (3): > drm/msm/gpu: Add devfreq tuning debugfs > drm/msm/gpu: Bypass PM QoS constraint for idle clamp > drm/msm/gpu: Add default devfreq thresholds

Re: [PATCH] drm/panfrost: Fix GEM handle creation UAF

2022-12-16 Thread Chia-I Wu
On Fri, Dec 16, 2022 at 4:20 PM Rob Clark wrote: > > On Fri, Dec 16, 2022 at 3:59 PM Chia-I Wu wrote: > > > > On Fri, Dec 16, 2022 at 3:34 PM Rob Clark wrote: > > > > > > From: Rob Clark > > > > > > Relying on an unreturned handle

Re: [PATCH] drm/panfrost: Fix GEM handle creation UAF

2022-12-16 Thread Chia-I Wu
On Fri, Dec 16, 2022 at 3:34 PM Rob Clark wrote: > > From: Rob Clark > > Relying on an unreturned handle to hold a reference to an object we > dereference is not safe. Userspace can guess the handle and race us > by closing the handle from another thread. The _create_with_handle() > that

Re: [PATCH] drm/virtio: Fix GEM handle creation UAF

2022-12-16 Thread Chia-I Wu
t reason, dropping > the handle's reference must be done *after* we are done dereferencing > the object. > > Signed-off-by: Rob Clark Reviewed-by: Chia-I Wu

Re: [PATCH] drm/msm: Enable clamp_to_idle for 7c3

2022-11-15 Thread Chia-I Wu
adreno/a6xx_gpu.c | 14 +++--- > > 1 file changed, 7 insertions(+), 7 deletions(-) > > Reviewed-by: Douglas Anderson Reviewed-by: Chia-I Wu

Re: [PATCH v3 2/2] drm/msm: Hangcheck progress detection

2022-11-09 Thread Chia-I Wu
truct msm_fence_context *fctx; > > + /** > +* hangcheck_progress_retries: > +* > +* The number of extra hangcheck duration cycles that we have given > +* due to it appearing that the GPU is making forward progress. > +

Re: [Freedreno] [PATCH 0/3] drm/msm/a6xx: devcore dump fixes

2022-10-13 Thread Chia-I Wu
On Thu, Oct 13, 2022 at 3:55 PM Rob Clark wrote: > > From: Rob Clark > > First patch fixes a recently introduced memory corruption, the remaining > two are cleanups. Series is Reviewed-by: Chia-I Wu > Rob Clark (3): > drm/msm/a6xx: Fix kvzalloc vs state_kcalloc usage &

Re: [Freedreno] [PATCH] drm/msm/gem: Unpin objects slightly later

2022-09-29 Thread Chia-I Wu
inker to evict an > obj queued up in gpu scheduler.) > > Fixes: f371bcc0c2ac ("drm/msm/gem: Unpin buffers earlier") > Fixes: 025d27239a2f ("drm/msm/gem: Evict active GEM objects when necessary") > Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/19 > Sign

Re: [PATCH v2] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()

2022-09-19 Thread Chia-I Wu
hould '(1 << ring_idx)' be a 64 bit type? > > Fixes: cd7f5ca33585 ("drm/virtio: implement context init: add > virtio_gpu_fence_event") > Signed-off-by: Dan Carpenter > --- > v2: Style change. Use BIT_ULL(). Reviewed-by: Chia-I Wu > > drivers/gpu/drm/virtio/virtgpu

Re: [PATCH] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()

2022-09-15 Thread Chia-I Wu
On Thu, Sep 15, 2022 at 4:14 AM Dan Carpenter wrote: > > The ->ring_idx_mask variable is a u64 so static checkers, Smatch in > this case, complain if the BIT() is not also a u64. > > drivers/gpu/drm/virtio/virtgpu_ioctl.c:50 virtio_gpu_fence_event_create() > warn: should '(1 << ring_idx)' be a 64

[PATCH] drm/virtio: set fb_modifiers_not_supported

2022-08-31 Thread Chia-I Wu
_supported flag in mode_config") Suggested-by: Shao-Chuan Lee Signed-off-by: Chia-I Wu --- drivers/gpu/drm/virtio/virtgpu_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index 5c7f198c0712..9ea7611a9e0f

Re: [PATCH v2] drm/virtio: Fix NULL vs IS_ERR checking in virtio_gpu_object_shmem_init

2022-06-11 Thread Chia-I Wu
("drm/virtio: move virtio_gpu_mem_entry initialization to > new function") > Signed-off-by: Miaoqian Lin > --- > changes in v2: > - Update Fixes tag. > - rebase the working tree. > v1 Link: > https://lore.kernel.org/all/20211222072649.18169-1-linmq...@gmail.com/ Reviewed-by: Chia-I Wu

Re: [PATCH v2] drm/msm/adreno: Allow larger address space size

2022-06-11 Thread Chia-I Wu
ces. > > Also, add a modparam override for debugging and igt. > > v2: Send the right version of the patch (ie. the one that actually > compiles) > > Signed-off-by: Rob Clark Reviewed-by: Chia-I Wu

Re: [PATCH v2] drm/msm: add trace_dma_fence_emit to msm_gpu_submit

2022-04-27 Thread Chia-I Wu
On Wed, Apr 27, 2022 at 9:07 AM Rob Clark wrote: > > On Tue, Apr 26, 2022 at 11:20 PM Christian König > wrote: > > > > Am 26.04.22 um 20:50 schrieb Chia-I Wu: > > > On Tue, Apr 26, 2022 at 11:02 AM Christian König > > > wrote: > > >> Am

Re: [PATCH v2 1/2] drm/sched: use DECLARE_EVENT_CLASS

2022-04-26 Thread Chia-I Wu
That would be great. I don't have push permission. On Tue, Apr 26, 2022 at 11:25 AM Andrey Grodzovsky wrote: > > It's ok to land but it wasn't, do you have push permissions to > drm-misc-next ? If not, I will do it for you. > > Andrey > > On 2022-04-26 12:29, Chia-I Wu wrot

Re: [PATCH v2] drm/msm: add trace_dma_fence_emit to msm_gpu_submit

2022-04-26 Thread Chia-I Wu
On Tue, Apr 26, 2022 at 11:02 AM Christian König wrote: > > Am 26.04.22 um 19:40 schrieb Chia-I Wu: > > [SNIP] > >>>> Well I just send a patch to completely remove the trace point. > >>>> > >>>> As I said it absolutely doesn't mak

Re: [PATCH v2] drm/msm: add trace_dma_fence_emit to msm_gpu_submit

2022-04-26 Thread Chia-I Wu
König > >>> wrote: > >>>> Am 26.04.22 um 18:32 schrieb Chia-I Wu: > >>>>> On Tue, Apr 12, 2022 at 2:26 PM Chia-I Wu wrote: > >>>>>> In practice, trace_dma_fence_init called from dma_fence_init is good > >>>

Re: [PATCH v2] drm/msm: add trace_dma_fence_emit to msm_gpu_submit

2022-04-26 Thread Chia-I Wu
On Tue, Apr 12, 2022 at 2:26 PM Chia-I Wu wrote: > > In practice, trace_dma_fence_init called from dma_fence_init is good > enough and almost no driver calls trace_dma_fence_emit. But drm_sched > and virtio both have cases where trace_dma_fence_init and > trace_dma_fence_em

Re: [PATCH v2 1/2] drm/sched: use DECLARE_EVENT_CLASS

2022-04-26 Thread Chia-I Wu
On Tue, Apr 12, 2022 at 1:48 PM Chia-I Wu wrote: > > drm_sched_job and drm_run_job have the same prototype. > > v2: rename the class from drm_sched_job_entity to drm_sched_job (Andrey) > > Signed-off-by: Chia-I Wu > Cc: Rob Clark > Reviewed-by: Andrey Grodzovsky This

Re: [PATCH 3/3] drm/msm: return the average load over the polling period

2022-04-15 Thread Chia-I Wu
On Fri, Apr 15, 2022 at 5:33 PM Chia-I Wu wrote: > > simple_ondemand interacts poorly with clamp_to_idle. It only looks at > the load since the last get_dev_status call, while it should really look > at the load over polling_ms. When clamp_to_idle true, it almost always > p

[PATCH 3/3] drm/msm: return the average load over the polling period

2022-04-15 Thread Chia-I Wu
msm_devfreq_idle/msm_devfreq_active. This logic could potentially be moved into devfreq core. Fixes: 7c0ffcd40b16 ("drm/msm/gpu: Respect PM QoS constraints") Signed-off-by: Chia-I Wu Cc: Rob Clark --- drivers/gpu/drm/msm/msm_gpu.h | 3 ++ drivers/gpu/drm/msm/msm_gpu_devf

[PATCH 2/3] drm/msm: simplify gpu_busy callback

2022-04-15 Thread Chia-I Wu
Move tracking and busy time calculation to msm_devfreq_get_dev_status. Signed-off-by: Chia-I Wu Cc: Rob Clark --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 19 ++-- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 15 + drivers/gpu/drm/msm/msm_gpu.h | 9 +++- drivers

[PATCH 1/3] drm/msm: remove explicit devfreq status reset

2022-04-15 Thread Chia-I Wu
It is redundant since commit 7c0ffcd40b16 ("drm/msm/gpu: Respect PM QoS constraints") because dev_pm_qos_update_request triggers get_dev_status. Signed-off-by: Chia-I Wu Cc: Rob Clark --- drivers/gpu/drm/msm/msm_gpu_devfreq.c | 7 --- 1 file changed, 7 deletions(-) diff --git

[PATCH v2] drm/msm: add trace_dma_fence_emit to msm_gpu_submit

2022-04-12 Thread Chia-I Wu
correct trace_dma_fence_emit when visualizing fence timelines. v2: improve commit message (Dmitry) Signed-off-by: Chia-I Wu Cc: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_gpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers

[PATCH v2 2/2] drm/sched: use __string in tracepoints

2022-04-12 Thread Chia-I Wu
Otherwise, ring names are marked [UNSAFE-MEMORY]. Signed-off-by: Chia-I Wu Cc: Rob Clark Reviewed-by: Andrey Grodzovsky --- drivers/gpu/drm/scheduler/gpu_scheduler_trace.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/scheduler

[PATCH v2 1/2] drm/sched: use DECLARE_EVENT_CLASS

2022-04-12 Thread Chia-I Wu
drm_sched_job and drm_run_job have the same prototype. v2: rename the class from drm_sched_job_entity to drm_sched_job (Andrey) Signed-off-by: Chia-I Wu Cc: Rob Clark Reviewed-by: Andrey Grodzovsky --- .../gpu/drm/scheduler/gpu_scheduler_trace.h | 31 +-- 1 file changed, 7

Re: [PATCH] drm/msm: add trace_dma_fence_emit to msm_gpu_submit

2022-04-09 Thread Chia-I Wu
On Sat, Apr 9, 2022 at 7:33 AM Christian König wrote: > > Am 08.04.22 um 23:12 schrieb Chia-I Wu: > > In practice, trace_dma_fence_init is good enough and almost no driver > > calls trace_dma_fence_emit. But this is still more correct in theory. > > Well, the reason

[PATCH] drm/msm: add trace_dma_fence_emit to msm_gpu_submit

2022-04-08 Thread Chia-I Wu
In practice, trace_dma_fence_init is good enough and almost no driver calls trace_dma_fence_emit. But this is still more correct in theory. Signed-off-by: Chia-I Wu Cc: Rob Clark --- drivers/gpu/drm/msm/msm_gpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/msm

[PATCH 2/2] drm/sched: use __string in tracepoints

2022-04-08 Thread Chia-I Wu
Otherwise, ring names are marked [UNSAFE-MEMORY]. Signed-off-by: Chia-I Wu Cc: Rob Clark --- drivers/gpu/drm/scheduler/gpu_scheduler_trace.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h b/drivers/gpu/drm

[PATCH 1/2] drm/sched: use DECLARE_EVENT_CLASS

2022-04-08 Thread Chia-I Wu
drm_sched_job and drm_run_job have the same prototype. Signed-off-by: Chia-I Wu Cc: Rob Clark --- .../gpu/drm/scheduler/gpu_scheduler_trace.h | 31 +-- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h b/drivers

Re: [PATCH] drm/virtio: Add execbuf flag to request no fence-event

2022-04-05 Thread Chia-I Wu
-by: Rob Clark Reviewed-by: Chia-I Wu Might want to wait for Gurchetan to chime in as he added the mechanism. > --- > drivers/gpu/drm/virtio/virtgpu_ioctl.c | 8 +--- > include/uapi/drm/virtgpu_drm.h | 2 ++ > 2 files changed, 7 insertions(+), 3 deletions(-) >

Re: [PATCH] virtio-gpu: fix a missing check to avoid NULL dereference

2022-03-28 Thread Chia-I Wu
("virtio-gpu: add 3d/virgl support") > Signed-off-by: Xiaomeng Tong Reviewed-by: Chia-I Wu > --- > drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c > b/drivers

Re: [PATCH] drm/virtio: fix NULL pointer dereference in virtio_gpu_conn_get_modes

2022-03-24 Thread Chia-I Wu
On Wed, Mar 23, 2022 at 4:01 AM Liu Zixian wrote: > diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c > b/drivers/gpu/drm/virtio/virtgpu_display.c > index 5b00310ac..f73352e7b 100644 > --- a/drivers/gpu/drm/virtio/virtgpu_display.c > +++ b/drivers/gpu/drm/virtio/virtgpu_display.c > @@ -179,6

Re: [PATCH] drm/virtio: Add USE_INTERNAL blob flag

2022-02-22 Thread Chia-I Wu
On Fri, Feb 18, 2022 at 9:51 AM Rob Clark wrote: > > On Fri, Feb 18, 2022 at 8:42 AM Chia-I Wu wrote: > > > > On Fri, Feb 18, 2022 at 7:57 AM Rob Clark wrote: > > > > > > From: Rob Clark > > > > > > With native userspace drivers in guest

Re: [PATCH] drm/virtio: Remove restriction of non-zero blob_flags

2022-02-22 Thread Chia-I Wu
st VMM. > > Signed-off-by: Rob Clark Reviewed-by: Chia-I Wu

Re: [PATCH] drm/virtio: Add USE_INTERNAL blob flag

2022-02-18 Thread Chia-I Wu
On Fri, Feb 18, 2022 at 7:57 AM Rob Clark wrote: > > From: Rob Clark > > With native userspace drivers in guest, a lot of GEM objects need to be > neither shared nor mappable. And in fact making everything mappable > and/or sharable results in unreasonably high fd usage in host VMM. > >

Re: [PATCH v2 0/2] drm/gem-shmem: Various improvements

2022-02-10 Thread Chia-I Wu
c | 1 + > include/drm/drm_gem_shmem_helper.h | 2 ++ > 6 files changed, 10 insertions(+), 3 deletions(-) Reviewed-by: Chia-I Wu > > -- > 2.34.1 >

Re: [PATCH v2] drm/virtio: Fix an NULL vs IS_ERR() bug in virtio_gpu_object_shmem_init()

2021-11-23 Thread Chia-I Wu
gt; --- > v2: I originally sent this patch on 19 Jun 2020 but it was somehow > not applied. As I review it now, I see that the bug is actually > older than I originally thought and so I have updated the Fixes > tag. Reviewed-by: Chia-I Wu

Re: [PATCH] drm/virtio: delay pinning the pages till first use

2021-11-02 Thread Chia-I Wu
On Tue, Nov 2, 2021 at 6:07 AM Gerd Hoffmann wrote: > > On Tue, Nov 02, 2021 at 12:31:39PM +0100, Maksym Wezdecki wrote: > > From: mwezdeck > > > > The idea behind the commit: > > 1. not pin the pages during resource_create ioctl > > 2. pin the pages on the first use during: > > -

[PATCH] MAINTAINERS: add reviewers for virtio-gpu

2021-10-28 Thread Chia-I Wu
Add Gurchetan Singh and me as reviewers for virtio-gpu. Signed-off-by: Chia-I Wu Acked-by: Gurchetan Singh Cc: David Airlie Cc: Gerd Hoffmann --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3b79fd441dde..5474a0a708a8 100644

Re: drm/virtio: not pin pages on demand

2021-10-28 Thread Chia-I Wu
col while maintaining backward compatibility. > > > What do you think about that? > > I still think that switching to blob resources would be the better > solution. Yes, it's alot of work and not something which helps > short-term. But adding a new API as interim solution isn't grea

Re: drm/virtio: not pin pages on demand

2021-10-21 Thread Chia-I Wu
On Thu, Oct 21, 2021 at 4:52 AM Gerd Hoffmann wrote: > > On Thu, Oct 21, 2021 at 11:55:47AM +0200, Maksym Wezdecki wrote: > > I get your point. However, we need to make resource_create ioctl, > > in order to create corresponding resource on the host. > > That used to be the case but isn't true

Re: [virtio-dev] [PATCH v1 09/12] drm/virtio: implement context init: allocate an array of fence contexts

2021-09-15 Thread Chia-I Wu
i On Tue, Sep 14, 2021 at 6:26 PM Gurchetan Singh wrote: > > > > On Tue, Sep 14, 2021 at 10:53 AM Chia-I Wu wrote: >> >> ,On Mon, Sep 13, 2021 at 6:57 PM Gurchetan Singh >> wrote: >> > >> > >> > >> > >> > On Mon, Sep 1

Re: [virtio-dev] [PATCH v1 09/12] drm/virtio: implement context init: allocate an array of fence contexts

2021-09-14 Thread Chia-I Wu
,On Mon, Sep 13, 2021 at 6:57 PM Gurchetan Singh wrote: > > > > > On Mon, Sep 13, 2021 at 11:52 AM Chia-I Wu wrote: >> >> . >> >> On Mon, Sep 13, 2021 at 10:48 AM Gurchetan Singh >> wrote: >> > >> > >> > >> > O

Re: [virtio-dev] [PATCH v1 09/12] drm/virtio: implement context init: allocate an array of fence contexts

2021-09-13 Thread Chia-I Wu
. On Mon, Sep 13, 2021 at 10:48 AM Gurchetan Singh wrote: > > > > On Fri, Sep 10, 2021 at 12:33 PM Chia-I Wu wrote: >> >> On Wed, Sep 8, 2021 at 6:37 PM Gurchetan Singh >> wrote: >> > >> > We don't want fences from different 3D contexts (virgl, g

Re: [virtio-dev] [PATCH v1 09/12] drm/virtio: implement context init: allocate an array of fence contexts

2021-09-10 Thread Chia-I Wu
On Wed, Sep 8, 2021 at 6:37 PM Gurchetan Singh wrote: > > We don't want fences from different 3D contexts (virgl, gfxstream, > venus) to be on the same timeline. With explicit context creation, > we can specify the number of ring each context wants. > > Execbuffer can specify which ring to use.

Re: [PATCH 0/7] dma-buf: Add an API for exporting sync files (v11)

2021-06-10 Thread Chia-I Wu
On Tue, May 25, 2021 at 2:18 PM Jason Ekstrand wrote: > Modern userspace APIs like Vulkan are built on an explicit > synchronization model. This doesn't always play nicely with the > implicit synchronization used in the kernel and assumed by X11 and > Wayland. The client -> compositor half of

[PATCH] drm/virtio: fix prime export for vram objects

2021-01-07 Thread Chia-I Wu
Gurchetan Singh Cc: Thomas Zimmermann Cc: Gerd Hoffmann Signed-off-by: Chia-I Wu --- drivers/gpu/drm/virtio/virtgpu_vram.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_vram.c b/drivers/gpu/drm/virtio/virtgpu_vram.c index d6f215c4ff8d..5cc34e7330fa 100644 -

[PATCH] drm/virtio: make sure context is created in gem open

2021-01-07 Thread Chia-I Wu
The context might still be missing when DRM_IOCTL_PRIME_FD_TO_HANDLE is the first ioctl on the drm_file. Fixes: 72b48ae800da ("drm/virtio: enqueue virtio_gpu_create_context after the first 3D ioctl") Cc: Gurchetan Singh Cc: Gerd Hoffmann Signed-off-by: Chia-I Wu --- drivers/gpu/

[PATCH] drm/virtio: align blob resources to page sizes

2020-12-18 Thread Chia-I Wu
They trigger the BUG_ON() in drm_gem_private_object_init otherwise. Signed-off-by: Chia-I Wu Cc: Gurchetan Singh Cc: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vram.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_vram.c b/drivers/gpu/drm/virtio

Re: [PATCH v2 22/23] drm/virtio: implement blob resources: resource create blob ioctl

2020-09-03 Thread Chia-I Wu
On Wed, Sep 2, 2020 at 2:09 PM Gurchetan Singh wrote: > > From: Gerd Hoffmann > > Implement resource create blob as specified. > > Signed-off-by: Gerd Hoffmann > Co-developed-by: Gurchetan Singh > Signed-off-by: Gurchetan Singh > Acked-by: Tomeu Vizoso > --- >

Re: pages pinned for BO lifetime and security

2020-07-22 Thread Chia-I Wu
> >> Currently, the user seems to amdgpu for P2P dma-buf and it seems to > > >> plumb ttm (*move_notify) callback to dma-buf. We're not sure if it's a > > >> security issue occurring across DRM drivers, or one more specific to the > > >> new amdgpu

pages pinned for BO lifetime and security

2020-07-21 Thread Chia-I Wu
Hi list, virtio-gpu is moving in the direction where BO pages are pinned for the lifetime for simplicity. I am wondering if that is considered a security issue in general, especially after running into the description of the new DMABUF_MOVE_NOTIFY config option. Most drivers do not have a

Re: [PATCH] drm/virtio: delete notify in virtio_gpu_object_create

2020-03-25 Thread Chia-I Wu
On Thu, Mar 26, 2020 at 7:10 AM Gurchetan Singh wrote: > > For 3D buffers, virtio_gpu_gem_object_open notifies. > We can have the same behavior for dumb buffer. > > v2: virtio_gpu_gem_object_open always notifies > v3: avoid boolean variable Series is Reviewed-by: Chia-I W

Re: [PATCH] drm/virtio: delete notify in virtio_gpu_object_create

2020-03-25 Thread Chia-I Wu
On Wed, Mar 25, 2020 at 8:41 AM Gurchetan Singh wrote: > > For 3D buffers, virtio_gpu_gem_object_open notifies. > We can have the same behavior for dumb buffer. We just > need to make sure the first open notifies the host for > dumb buffers. virtio_gpu_notify is cheap and does not kick unless

Re: [PATCH 3/3] drm/virtio: delete notify in virtio_gpu_object_create

2020-03-24 Thread Chia-I Wu
On Wed, Mar 25, 2020 at 12:44 AM Gurchetan Singh wrote: > > - For dumb buffers, virtio_gpu_gem_create can notify. > - For 3D buffers, virtio_gpu_gem_object_open can notify. Hmm, I feel this is a bit complex. virtio_gpu_gem_object_open may not notify, and the caller needs to know about it. Can

Re: [RFC PATCH 0/8] *** Per context fencing ***

2020-03-17 Thread Chia-I Wu
On Mon, Mar 16, 2020 at 3:44 PM Gerd Hoffmann wrote: > > Hi, > > > >> At virtio level it is pretty simple: The host completes the SUBMIT_3D > > >> virtio command when it finished rendering, period. > > >> > > >> > > >> On the guest side we don't need the fence_id. The completion callback > >

Re: [RFC PATCH 0/8] *** Per context fencing ***

2020-03-13 Thread Chia-I Wu
On Thu, Mar 12, 2020 at 4:08 PM Gurchetan Singh wrote: > > > > On Thu, Mar 12, 2020 at 2:29 AM Gerd Hoffmann wrote: >> >> On Wed, Mar 11, 2020 at 04:36:16PM -0700, Gurchetan Singh wrote: >> > On Wed, Mar 11, 2020 at 3:36 AM Gerd Hoffmann wrote: >> > >> > > Hi, >> > > >> > > > I should've been

Re: [RFC PATCH 0/8] *** Per context fencing ***

2020-03-11 Thread Chia-I Wu
On Wed, Mar 11, 2020 at 4:36 PM Gurchetan Singh wrote: > > > > On Wed, Mar 11, 2020 at 3:36 AM Gerd Hoffmann wrote: >> >> Hi, >> >> > I should've been more clear -- this is an internal cleanup/preparation and >> > the per-context changes are invisible to host userspace. >> >> Ok, it wasn't

Re: [RFC PATCH 0/8] *** Per context fencing ***

2020-03-11 Thread Chia-I Wu
On Wed, Mar 11, 2020 at 3:36 AM Gerd Hoffmann wrote: > > Hi, > > > I should've been more clear -- this is an internal cleanup/preparation and > > the per-context changes are invisible to host userspace. > > Ok, it wasn't clear that you don't flip the switch yet. In general the > commit

Re: [PATCH 2/2] [RFC] drm/virtgpu: modify uapi with stride/layer_stride fix

2020-02-28 Thread Chia-I Wu
On Wed, Oct 2, 2019 at 5:18 PM Gurchetan Singh wrote: > > On Wed, Oct 2, 2019 at 1:49 AM Gerd Hoffmann wrote: > > > > On Tue, Oct 01, 2019 at 06:49:35PM -0700, Gurchetan Singh wrote: > > > This doesn't really break userspace, since it always passes down > > > 0 for stride/layer_stride currently.

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-26 Thread Chia-I Wu
On Wed, Feb 26, 2020 at 10:25 AM Thomas Hellström (VMware) wrote: > > Hi, Gerd, > > While looking at this patchset I came across some stuff that seems > strange but that was merged in a previous patchset. > > (please refer to >

Re: [PATCH 4/4 v6] drm/virtio: enqueue virtio_gpu_create_context after the first 3D ioctl

2020-02-24 Thread Chia-I Wu
On Mon, Feb 24, 2020 at 5:24 AM Emil Velikov wrote: > > On Mon, 24 Feb 2020 at 11:06, Gerd Hoffmann wrote: > > > > On Fri, Feb 21, 2020 at 04:54:02PM -0800, Gurchetan Singh wrote: > > > On Fri, Feb 21, 2020 at 3:06 PM Chia-I Wu wrote: > > > > > >

Re: [PATCH 4/4 v6] drm/virtio: enqueue virtio_gpu_create_context after the first 3D ioctl

2020-02-21 Thread Chia-I Wu
rkaround or something? > > Reviewed-by: Chia-I Wu > Reviewed-by: Emil Velikov > Signed-off-by: Gurchetan Singh > --- > drivers/gpu/drm/virtio/virtgpu_drv.h | 2 -- > drivers/gpu/drm/virtio/virtgpu_ioctl.c | 32 +++--- > drivers/gpu/drm/virtio/vir

Re: [Bug] virtio-gpu broken with qemu/kvm on arm64 on kernel 5.5+

2020-02-21 Thread Chia-I Wu
On Fri, Feb 21, 2020 at 2:06 AM Guillaume Gardet wrote: > > Hi, > > > -Original Message- > > From: Chia-I Wu > > Sent: 20 February 2020 19:41 > > To: Guillaume Gardet > > Cc: dri-devel@lists.freedesktop.org; Gerd Hoffmann ; > > Daniel Vette

Re: [PATCH v2] drm/virtio: fix resource id creation race

2020-02-21 Thread Chia-I Wu
; Fixes: 16065fcdd19d ("drm/virtio: do NOT reuse resource ids") > Signed-off-by: John Bates Reviewed-by: Chia-I Wu > --- > drivers/gpu/drm/virtio/virtgpu_object.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/vi

Re: [RFC PATCH 0/3] KVM: x86: honor guest memory type

2020-02-21 Thread Chia-I Wu
On Fri, Feb 21, 2020 at 7:59 AM Sean Christopherson wrote: > > On Thu, Feb 20, 2020 at 09:39:05PM -0800, Tian, Kevin wrote: > > > From: Chia-I Wu > > > Sent: Friday, February 21, 2020 12:51 PM > > > If you think it is the best for KVM to inspect hva to determin

Re: [RFC PATCH 0/3] KVM: x86: honor guest memory type

2020-02-20 Thread Chia-I Wu
(resend because gmail did not format to plain text...) On Thu, Feb 20, 2020 at 8:45 PM Chia-I Wu wrote: > > > > On Thu, Feb 20, 2020 at 4:23 PM Tian, Kevin wrote: >> >> > From: Chia-I Wu >> > Sent: Friday, February 21, 2020 6:24 AM >> > >> &

Re: [RFC PATCH 0/3] KVM: x86: honor guest memory type

2020-02-20 Thread Chia-I Wu
On Thu, Feb 20, 2020 at 4:23 PM Tian, Kevin wrote: > > From: Chia-I Wu > > Sent: Friday, February 21, 2020 6:24 AM > > > > On Wed, Feb 19, 2020 at 6:38 PM Tian, Kevin > wrote: > > > > > > > From: Tian, Kevin > > > > Sent: Thursday,

Re: [RFC PATCH 0/3] KVM: x86: honor guest memory type

2020-02-20 Thread Chia-I Wu
On Wed, Feb 19, 2020 at 6:13 PM Tian, Kevin wrote: > > > Curious... How is such slot exposed to the guest? A reserved memory > > > region? Is it static or might be dynamically added? > > The plan is for virtio-gpu device to reserve a huge memory region in > > the guest. Memslots may be added

Re: [RFC PATCH 0/3] KVM: x86: honor guest memory type

2020-02-20 Thread Chia-I Wu
On Wed, Feb 19, 2020 at 6:38 PM Tian, Kevin wrote: > > > From: Tian, Kevin > > Sent: Thursday, February 20, 2020 10:05 AM > > > > > From: Chia-I Wu > > > Sent: Thursday, February 20, 2020 3:37 AM > > > > > > On Wed, Feb 19, 2020 at

Re: [Bug] virtio-gpu broken with qemu/kvm on arm64 on kernel 5.5+

2020-02-20 Thread Chia-I Wu
most part just removing the ttm code. > > v4: fix drm_gem_object_funcs name. > > Signed-off-by: Gerd Hoffmann > Acked-by: Daniel Vetter > Reviewed-by: Chia-I Wu > Link: > http://patchwork.freedesktop.org/patch/msgid/20190829103301.3539-15-kra...@redhat.com >

Re: [PATCH] drm/virtio: fix virtio-gpu resource id creation race

2020-02-20 Thread Chia-I Wu
On Thu, Feb 20, 2020 at 5:30 AM Emil Velikov wrote: > > Hi John, > > On Thu, 20 Feb 2020 at 08:45, John Bates wrote: > > > > The previous code was not thread safe and caused > > undefined behavior from spurious duplicate resource IDs. > > In this patch, an atomic_t is used instead. We no longer

Re: [RFC PATCH 0/3] KVM: x86: honor guest memory type

2020-02-19 Thread Chia-I Wu
On Wed, Feb 19, 2020 at 1:52 AM Tian, Kevin wrote: > > > From: Paolo Bonzini > > Sent: Wednesday, February 19, 2020 12:29 AM > > > > On 14/02/20 23:03, Sean Christopherson wrote: > > >> On Fri, Feb 14, 2020 at 1:47 PM Chia-I Wu wrote: > > >>

Re: [RFC PATCH 0/3] KVM: x86: honor guest memory type

2020-02-19 Thread Chia-I Wu
On Wed, Feb 19, 2020 at 2:00 AM Tian, Kevin wrote: > > > From: Chia-I Wu > > Sent: Saturday, February 15, 2020 5:15 AM > > > > On Fri, Feb 14, 2020 at 2:26 AM Paolo Bonzini wrote: > > > > > > On 13/02/20 23:18, Chia-I Wu wrote: > > >

Re: [PATCH 3/5 v5] drm/virtio: track whether or not a context has been initiated

2020-02-19 Thread Chia-I Wu
Patch 1-4 are Reviewed-by: Chia-I Wu I think we can drop patch 5 for now. On Wed, Feb 19, 2020 at 9:56 AM Gurchetan Singh wrote: > > Use an atomic variable to track whether a context has been > initiated. > > v5: Fix possible race and sleep via mutex (@olv) > > Signed-of

Re: [PATCH 3/5] drm/virtio: track whether or not a context has been initiated

2020-02-14 Thread Chia-I Wu
On Fri, Feb 14, 2020 at 6:29 PM Gurchetan Singh wrote: > > On Fri, Feb 14, 2020 at 11:27 AM Chia-I Wu wrote: > > > > On Thu, Feb 13, 2020 at 3:18 PM Gurchetan Singh > > wrote: > > > > > > Use an atomic variable to track whether a context has been >

Re: [RFC PATCH 0/3] KVM: x86: honor guest memory type

2020-02-14 Thread Chia-I Wu
On Fri, Feb 14, 2020 at 11:52 AM Sean Christopherson wrote: > > On Fri, Feb 14, 2020 at 11:26:06AM +0100, Paolo Bonzini wrote: > > On 13/02/20 23:18, Chia-I Wu wrote: > > > > > > The bug you mentioned was probably this one > > > > > > ht

Re: [RFC PATCH 0/3] KVM: x86: honor guest memory type

2020-02-14 Thread Chia-I Wu
On Fri, Feb 14, 2020 at 2:26 AM Paolo Bonzini wrote: > > On 13/02/20 23:18, Chia-I Wu wrote: > > > > The bug you mentioned was probably this one > > > > https://bugzilla.kernel.org/show_bug.cgi?id=104091 > > Yes, indeed. > > > From what I can tell, t

Re: [PATCH v4 0/6] drm/virtio: rework batching

2020-02-14 Thread Chia-I Wu
Series is Reviewed-by: Chia-I Wu Thanks! On Fri, Feb 14, 2020 at 4:55 AM Gerd Hoffmann wrote: > > v4: > - add patches #2 + #6. > v3: > - split into multiple patches. > > Gerd Hoffmann (6): > drm/virtio: rework notification for better batching > drm/virtio: no

Re: [PATCH 3/5] drm/virtio: track whether or not a context has been initiated

2020-02-14 Thread Chia-I Wu
On Thu, Feb 13, 2020 at 3:18 PM Gurchetan Singh wrote: > > Use an atomic variable to track whether a context has been > initiated. > > v2: Fix possible race (@olv) > > Signed-off-by: Gurchetan Singh > --- > drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + > drivers/gpu/drm/virtio/virtgpu_ioctl.c |

  1   2   3   >