Re: [PATCH] drm/i915: Add flex arrays to struct i915_syncmap

2024-02-08 Thread Gustavo A. R. Silva
deprecated.html#zero-length-and-one-element-arrays [1] Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments [2] Signed-off-by: Erick Archer Nice transformation! LGTM: Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/g

Re: [Intel-gfx] [PATCH] drm/i915/guc: Annotate struct ct_incoming_msg with __counted_by

2023-10-06 Thread Gustavo A. R. Silva
(for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ct_incoming_msg. Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: David Airlie Cc: Daniel Vetter Cc: "Gustavo A. R. Silva" Cc: John Harrison Cc: Matthew

Re: [Intel-gfx] [PATCH 5/9] drm/nouveau/pm: Annotate struct nvkm_perfdom with __counted_by

2023-09-24 Thread Gustavo A. R. Silva
Cc: dri-de...@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/nouveau/nvkm/engine/pm/priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau

Re: [Intel-gfx] [PATCH 7/9] drm/virtio: Annotate struct virtio_gpu_object_array with __counted_by

2023-09-23 Thread Gustavo A. R. Silva
: Daniel Vetter Cc: dri-de...@lists.freedesktop.org Cc: virtualizat...@lists.linux-foundation.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

Re: [Intel-gfx] [PATCH 8/9] drm/vmwgfx: Annotate struct vmw_surface_dirty with __counted_by

2023-09-23 Thread Gustavo A. R. Silva
Cc: dri-de...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm

Re: [Intel-gfx] [PATCH 1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by

2023-09-23 Thread Gustavo A. R. Silva
Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: Xiaojian Du Cc: Huang Rui Cc: Kevin Wang Cc: amd-...@lists.freedesktop.org Cc: dri-de...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/am

Re: [Intel-gfx] [PATCH 6/9] drm/vc4: Annotate struct vc4_perfmon with __counted_by

2023-09-22 Thread Gustavo A. R. Silva
...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/vc4/vc4_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index bf66499765fb

Re: [Intel-gfx] [PATCH 4/9] drm/msm/dpu: Annotate struct dpu_hw_intr with __counted_by

2023-09-22 Thread Gustavo A. R. Silva
Cc: David Airlie Cc: Daniel Vetter Cc: Bjorn Andersson Cc: linux-arm-...@vger.kernel.org Cc: dri-de...@lists.freedesktop.org Cc: freedr...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/msm/disp/dpu1

Re: [Intel-gfx] [PATCH 3/9] drm/i915/selftests: Annotate struct perf_series with __counted_by

2023-09-22 Thread Gustavo A. R. Silva
Airlie Cc: Daniel Vetter Cc: Chris Wilson Cc: John Harrison Cc: Andi Shyti Cc: Matthew Brost Cc: intel-gfx@lists.freedesktop.org Cc: dri-de...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/i915/selftests

Re: [Intel-gfx] [PATCH 2/9] drm/amdgpu/discovery: Annotate struct ip_hw_instance with __counted_by

2023-09-22 Thread Gustavo A. R. Silva
Cc: David Airlie Cc: Daniel Vetter Cc: Hawking Zhang Cc: amd-...@lists.freedesktop.org Cc: dri-de...@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 +- 1 file changed, 1 insertion(+),

Re: [Intel-gfx] [PATCH][next] drm/i915/uapi: Replace fake flex-array with flexible-array member

2023-04-06 Thread Gustavo A. R. Silva
On 3/31/23 01:02, Jani Nikula wrote: On Thu, 30 Mar 2023, "Gustavo A. R. Silva" wrote: Friendly ping: who can take this, please? 😄 It's in drm-intel-gt-next. Awesome. :) Thank you! -- Gustavo commit 02abecdeebfcd3848b26b70778dd7f6eb0db65e1 Author: Gust

Re: [Intel-gfx] [PATCH][next] drm/i915/uapi: Replace fake flex-array with flexible-array member

2023-03-30 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? 😄 Thanks -- Gustavo On 3/17/23 12:18, Gustavo A. R. Silva wrote: Zero-length arrays as fake flexible arrays are deprecated and we are moving towards adopting C99 flexible-array members instead. Address the following warning found with GCC-13

[Intel-gfx] [PATCH][next] drm/i915/uapi: Replace fake flex-array with flexible-array member

2023-03-17 Thread Gustavo A. R. Silva
ly enabling -fstrict-flex-arrays=3 [1]. Link: https://github.com/KSPP/linux/issues/21 Link: https://github.com/KSPP/linux/issues/271 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva --- include/uapi/drm/i915_drm.h | 2 +- 1 file changed,

Re: [Intel-gfx] [PATCH][next] drm/i915/guc: Replace zero-length arrays with flexible-array members

2023-01-10 Thread Gustavo A. R. Silva
On Tue, Jan 10, 2023 at 02:28:11PM -0500, Rodrigo Vivi wrote: > > On Tue, Jan 10, 2023 at 10:44:53AM -0600, Gustavo A. R. Silva wrote: > > Zero-length arrays are deprecated[1] and we are moving towards > > adopting C99 flexible-array members, instead. So, replace zero-leng

[Intel-gfx] [PATCH][next] drm/i915/guc: Replace zero-length arrays with flexible-array members

2023-01-10 Thread Gustavo A. R. Silva
/linux/issues/78 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h b/drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h index 3624abfd22d1

[Intel-gfx] [PATCH][next] drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency()

2022-04-28 Thread Gustavo A. R. Silva
cks for that. This helps with the ongoing efforts to globally enable -Wstringop-overflow. Link: https://github.com/KSPP/linux/issues/181 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/intel_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i

Re: [Intel-gfx] [PATCH][next] treewide: Replace zero-length arrays with flexible-array members

2022-02-17 Thread Gustavo A. R. Silva
On Wed, Feb 16, 2022 at 08:05:47PM +0100, Rafael J. Wysocki wrote: > On Tue, Feb 15, 2022 at 8:24 PM Gustavo A. R. Silva > wrote: > > Can you also send the ACPI patch separately, please? > > We would like to route it through the upstream ACPICA code base. Yeah; no problem. Thanks -- Gustavo

Re: [Intel-gfx] [PATCH][next] treewide: Replace zero-length arrays with flexible-array members

2022-02-16 Thread Gustavo A. R. Silva
On Tue, Feb 15, 2022 at 09:19:29PM +0200, Leon Romanovsky wrote: > On Tue, Feb 15, 2022 at 01:21:10PM -0600, Gustavo A. R. Silva wrote: > > On Tue, Feb 15, 2022 at 10:17:40AM -0800, Kees Cook wrote: > > > On Tue, Feb 15, 2022 at 11:47:43AM -0600, Gustavo A. R. Silva wrote: >

[Intel-gfx] [PATCH][next] treewide: Replace zero-length arrays with flexible-array members

2022-02-16 Thread Gustavo A. R. Silva
off-by: Gustavo A. R. Silva --- Hi all, I'm expecting to carry this patch in my tree, so it'd be great to get some Acks. And given the size of the patch, I'm only sending this to mailing lists. Thanks! arch/alpha/include/asm/hwrpb.h| 2 +- arch/ia64

Re: [Intel-gfx] [PATCH][next] treewide: Replace zero-length arrays with flexible-array members

2022-02-16 Thread Gustavo A. R. Silva
On Tue, Feb 15, 2022 at 10:17:40AM -0800, Kees Cook wrote: > On Tue, Feb 15, 2022 at 11:47:43AM -0600, Gustavo A. R. Silva wrote: > > There is a regular need in the kernel to provide a way to declare > > having a dynamically sized set of trailing elements in a structure. > &g

[Intel-gfx] [PATCH][next] drm/i915/guc: Use struct_size() helper in kmalloc()

2022-01-25 Thread Gustavo A. R. Silva
: warning: using sizeof on a flexible structure Link: https://github.com/KSPP/linux/issues/174 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu

[Intel-gfx] [PATCH][next] drm/i915/gem: Fix fall-through warning for Clang

2021-06-07 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough; statement. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- JFYI: We had thousands of these sorts of warnings and now we are down to just 13 in

[Intel-gfx] [PATCH RESEND][next] drm/i915/gem: Fix fall-through warnings for Clang

2021-03-05 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a return statement instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gem

Re: [Intel-gfx] [PATCH 000/141] Fix fall-through warnings for Clang

2020-12-01 Thread Gustavo A. R. Silva
On Tue, Dec 01, 2020 at 12:52:27AM -0500, Martin K. Petersen wrote: > > Gustavo, > > > This series aims to fix almost all remaining fall-through warnings in > > order to enable -Wimplicit-fallthrough for Clang. > > Applied 20-22,54,120-124 to 5.11/scsi-staging, thanks. Awesome! :) Thanks, Mart

Re: [Intel-gfx] [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-24 Thread Gustavo A. R. Silva
On Mon, Nov 23, 2020 at 08:38:46PM +, Mark Brown wrote: > On Fri, 20 Nov 2020 12:21:39 -0600, Gustavo A. R. Silva wrote: > > This series aims to fix almost all remaining fall-through warnings in > > order to enable -Wimplicit-fallthrough for Clang. > > > > In prepa

Re: [Intel-gfx] [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-24 Thread Gustavo A. R. Silva
On Mon, Nov 23, 2020 at 04:03:45PM -0400, Jason Gunthorpe wrote: > On Fri, Nov 20, 2020 at 12:21:39PM -0600, Gustavo A. R. Silva wrote: > > > IB/hfi1: Fix fall-through warnings for Clang > > IB/mlx4: Fix fall-through warnings for Clang > > IB/qedr: Fix fall-th

Re: [Intel-gfx] [Intel-wired-lan] [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-23 Thread Gustavo A. R. Silva
On Sun, Nov 22, 2020 at 11:53:55AM -0800, James Bottomley wrote: > On Sun, 2020-11-22 at 11:22 -0800, Joe Perches wrote: > > On Sun, 2020-11-22 at 11:12 -0800, James Bottomley wrote: > > > On Sun, 2020-11-22 at 10:25 -0800, Joe Perches wrote: > > > > On Sun, 2020-11-22 at 10:21 -0800, James Bottoml

[Intel-gfx] [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-22 Thread Gustavo A. R. Silva
s://gcc.gnu.org/bugzilla/show_bug.cgi?id=91432 [4] https://godbolt.org/z/xgkvIh [5] commit a035d552a93b ("Makefile: Globally enable fall-through warning") [6] commit 4169e889e588 ("include: jhash/signal: Fix fall-through warnings for Clang") Thanks! Gustavo A. R. Silva (141

[Intel-gfx] [PATCH 080/141] drm/i915/gem: Fix fall-through warnings for Clang

2020-11-22 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a return statement instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gem

Re: [Intel-gfx] [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
On 11/20/20 12:28, Joe Perches wrote: > On Fri, 2020-11-20 at 12:21 -0600, Gustavo A. R. Silva wrote: >> Hi all, >> >> This series aims to fix almost all remaining fall-through warnings in >> order to enable -Wimplicit-fallthrough for Clang. >> >> In prepa

Re: [Intel-gfx] [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
Hi, On 11/20/20 12:53, Jakub Kicinski wrote: > On Fri, 20 Nov 2020 12:21:39 -0600 Gustavo A. R. Silva wrote: >> This series aims to fix almost all remaining fall-through warnings in >> order to enable -Wimplicit-fallthrough for Clang. >> >> In preparation to enable

[Intel-gfx] [PATCH][next] drm/i915/display: Use fallthrough pseudo-keyword

2020-10-08 Thread Gustavo A. R. Silva
?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/display/intel_ddi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index

Re: [Intel-gfx] [PATCH][next] drm/i915: Fix inconsistent IS_ERR and PTR_ERR

2020-09-25 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this? Thanks -- Gustavo On 9/10/20 05:21, Gustavo A. R. Silva wrote: > Fix inconsistent IS_ERR and PTR_ERR in i915_gem_object_copy_blt(). > > The proper pointer to be passed as argument to PTR_ERR() is vma[1]. > > This bug was detected w

[Intel-gfx] [PATCH][next] drm/i915: Fix inconsistent IS_ERR and PTR_ERR

2020-09-10 Thread Gustavo A. R. Silva
t;) Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gem/i915_gem_object_blt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_blt.c b/drivers/gpu/drm/i915/gem/i915_gem_object_blt.c index d93eb36160c9..aee7ad3cc3c6 100644 ---

Re: [Intel-gfx] [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-09 Thread Gustavo A. R. Silva
is break; > > Found using: > > $ grep-2.5.4 -rP --include=*.[ch] -n > "fallthrough;(\s*(case\s+\w+|default)\s*:\s*){1,7}break;" * > > Miscellanea: > > o Move or coalesce a couple label blocks above a default: block. > > Signed-off-by:

[Intel-gfx] [PATCH][next] drm/i915/query: Use struct_size() helper

2020-06-18 Thread Gustavo A. R. Silva
Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes. This code was detected with the help of Coccinelle and, audited and fixed manually. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/i915_query.c | 3 +-- 1 file

[Intel-gfx] [PATCH][next] drm/i915/selftests: Fix inconsistent IS_ERR and PTR_ERR

2020-06-16 Thread Gustavo A. R. Silva
Fix inconsistent IS_ERR and PTR_ERR in live_timeslice_nopreempt(). The proper pointer to be passed as argument to PTR_ERR() is ce. This bug was detected with the help of Coccinelle. Fixes: b72f02d78e4f ("drm/i915/gt: Prevent timeslicing into unpreemptable requests") Signed-off-by: Gu

[Intel-gfx] [PATCH] drm/i915/gt: Replace zero-length array with flexible-array

2020-05-08 Thread Gustavo A. R. Silva
lso help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-of

[Intel-gfx] [PATCH][next] drm/i915/gem: Fix inconsistent IS_ERR and PTR_ERR

2020-05-04 Thread Gustavo A. R. Silva
Fix inconsistent IS_ERR and PTR_ERR in __reloc_gpu_alloc(). The proper pointer to be passed as argument is ce. This bug was detected with the help of Coccinelle. Fixes: 6f576d6277ce ("drm/i915/gem: Try an alternate engine for relocations") Signed-off-by: Gustavo A. R. Silva --- d

[Intel-gfx] [PATCH][next] drm/i915: Replace zero-length array with flexible-array member

2020-03-03 Thread Gustavo A. R. Silva
lle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 4 ++-- drivers/gpu/drm/i915/gt/

[Intel-gfx] [PATCH][next] drm: i915_drm.h: Replace zero-length array with flexible-array member

2020-03-03 Thread Gustavo A. R. Silva
lle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva --- include/uapi/drm/i915_drm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

Re: [Intel-gfx] [PATCH][next] drm: Replace zero-length array with flexible-array member

2020-03-03 Thread Gustavo A. R. Silva
On 2/25/20 08:17, Jani Nikula wrote: > On Tue, 25 Feb 2020, "Gustavo A. R. Silva" wrote: >> The current codebase makes use of the zero-length array language >> extension to the C90 standard, but the preferred mechanism to declare >> variable-length types such as

[Intel-gfx] [PATCH][next] drm: Replace zero-length array with flexible-array member

2020-02-25 Thread Gustavo A. R. Silva
lle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/etnaviv/etnaviv_gem.h | 2 +- drivers/gpu/drm/gma500/i

[Intel-gfx] [PATCH][next] drm/i915/display: Fix inconsistent IS_ERR and PTR_ERR

2020-01-05 Thread Gustavo A. R. Silva
t;) Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/display/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index da5266e76738..a96bee699a5e 100644 --- a/drive

[Intel-gfx] [PATCH] drm/i915/gvt: Fix use-after-free in intel_vgpu_create_workload

2019-08-06 Thread Gustavo A. R. Silva
or its further use. Addresses-Coverity-ID: 1452235 ("Read from pointer after free") Fixes: 2089a76ade90 ("drm/i915/gvt: Checking workload's gma earlier") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/scheduler.c | 8 ++-- 1 file changed, 6 insertions(+

[Intel-gfx] [PATCH] drm/i915: Mark expected switch fall-throughs

2019-07-22 Thread Gustavo A. R. Silva
P: ^~~~ Also, notice that the Makefile is modified in order to stop ignoring fall-through warnings. The -Wimplicit-fallthrough option will be enabled globally in v5.3. Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. S

[Intel-gfx] [PATCH] drm/i915/kvmgt: Use struct_size() helper

2019-05-24 Thread Gustavo A. R. Silva
rse, areas, sparse->nr_areas) and so on... Also, notice that variable size is unnecessary, hence it is removed. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/kvmgt.c | 12 +--- 1 file changed, 5 insertions(+), 7 del

[Intel-gfx] [PATCH] drm/i915/dp: fix shifting by a negative number of bits

2018-09-12 Thread Gustavo A. R. Silva
915/icl: implement the tc/legacy HPD {dis,}connect flows") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/intel_dp.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 436c22d..e34b7b1 100644 --- a/d

Re: [Intel-gfx] [PATCH] drm/i915/kvmgt: Fix potential Spectre v1

2018-08-07 Thread Gustavo A. R. Silva
Hi Zhenyu, On 8/6/18 9:26 PM, Zhenyu Wang wrote: > On 2018.08.02 22:40:19 -0500, Gustavo A. R. Silva wrote: >> info.index can be indirectly controlled by user-space, hence leading >> to a potential exploitation of the Spectre variant 1 vulnerability. >> >> This issue wa

[Intel-gfx] [PATCH] drm/i915/kvmgt: Fix potential Spectre v1

2018-08-02 Thread Gustavo A. R. Silva
s://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/kvmgt.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.

[Intel-gfx] [PATCH] drm/i915/selftests: Remove redundant code

2018-07-16 Thread Gustavo A. R. Silva
err is assigned to -EIO, but this value is never actually used and *err* is updated later on. Remove such reduntant code. Addresses-Coverity-ID: 1471816 ("Unused value") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/selftests/intel_guc.c | 1 - 1 file changed, 1 deletio

Re: [Intel-gfx] [PATCH] drm/i915: Mark expected switch fall-throughs

2018-07-05 Thread Gustavo A. R. Silva
On 07/05/2018 08:43 AM, Jani Nikula wrote: > On Fri, 29 Jun 2018, Jani Nikula wrote: >> On Thu, 28 Jun 2018, "Gustavo A. R. Silva" wrote: >>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases >>> where we are expecting to fall through.

[Intel-gfx] [PATCH] drm/i915: Mark expected switch fall-throughs

2018-06-28 Thread Gustavo A. R. Silva
Addresses-Coverity-ID: 1357403 Addresses-Coverity-ID: 1357433 Addresses-Coverity-ID: 1392622 Addresses-Coverity-ID: 1415273 Addresses-Coverity-ID: 1435752 Addresses-Coverity-ID: 1441500 Addresses-Coverity-ID: 1454596 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/i915_gem.c | 1

Re: [Intel-gfx] [PATCH] drm/i915: mark expected switch fall-through

2018-06-28 Thread Gustavo A. R. Silva
> > Right. That's because we've used MISSING_CASE() also in if-ladders in > addition to the switch default case. From our POV the usage is similar. > Yep. > *shrug* > > I guess I like /* fall through */ annotations next to MISSING_CASE() > better than having two different macros depending on

Re: [Intel-gfx] [PATCH] drm/i915: mark expected switch fall-through

2018-06-26 Thread Gustavo A. R. Silva
Hi Jani, On 06/21/2018 03:03 AM, Jani Nikula wrote: > On Wed, 20 Jun 2018, "Gustavo A. R. Silva" wrote: >> On 06/20/2018 02:06 PM, Rodrigo Vivi wrote: >>> On Wed, Jun 20, 2018 at 08:31:00AM -0500, Gustavo A. R. Silva wrote: >>>> In preparation to enab

Re: [Intel-gfx] [PATCH] drm/i915: mark expected switch fall-through

2018-06-20 Thread Gustavo A. R. Silva
On 06/20/2018 02:06 PM, Rodrigo Vivi wrote: On Wed, Jun 20, 2018 at 08:31:00AM -0500, Gustavo A. R. Silva wrote: In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1470102 ("Missing break in switch")

[Intel-gfx] [PATCH] drm/i915: mark expected switch fall-through

2018-06-20 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1470102 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/intel_dpll_mgr.c | 1 + 1 file changed, 1 insertion(+)

Re: [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/selftests: Fix uninitialized variable

2018-04-24 Thread Gustavo A. R. Silva
On 04/24/2018 02:42 PM, Chris Wilson wrote: Quoting Patchwork (2018-04-24 20:02:06) == Series Details == Series: drm/i915/selftests: Fix uninitialized variable URL : https://patchwork.freedesktop.org/series/42194/ State : failure == Summary == = CI Bug Log - changes from CI_DRM_4087_full

Re: [Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable

2018-04-24 Thread Gustavo A. R. Silva
On 04/24/2018 08:22 AM, Chris Wilson wrote: Quoting Gustavo A. R. Silva (2018-04-24 14:15:45) There is a potential execution path in which variable err is returned without being properly initialized previously. Fix this by initializing variable err to 0. err is only returned along an error

[Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable

2018-04-24 Thread Gustavo A. R. Silva
egisters across resets") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/selftests/intel_workarounds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/selftests/intel_workarounds.c b/drivers/gpu/drm/i915/selftests/intel_workarounds.c index 545

[Intel-gfx] [PATCH] drm/i915/gvt/scheduler: Remove unnecessary NULL checks in sr_oa_regs

2018-03-22 Thread Gustavo A. R. Silva
The checks are misleading and not required [1]. [1] https://lkml.org/lkml/2018/3/19/1792 Addresses-Coverity-ID: 1466017 Cc: Chris Wilson Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/scheduler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu

[Intel-gfx] [PATCH] drm/i915/gvt: Mark expected switch fall-through in handle_g2v_notification

2018-03-22 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1466154 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/handlers.c | 1 + 1 file changed, 1 insertion(+) di

Re: [Intel-gfx] [PATCH] drm/i915/gvt/scheduler: fix potential NULL pointer dereference

2018-03-19 Thread Gustavo A. R. Silva
On 03/19/2018 04:23 PM, Chris Wilson wrote: Quoting Gustavo A. R. Silva (2018-03-19 20:50:12) Hi Chris, On 03/19/2018 03:38 PM, Chris Wilson wrote: Quoting Gustavo A. R. Silva (2018-03-19 19:30:53) _workload_ is being dereferenced before it is null checked, hence there is a potential null

Re: [Intel-gfx] [PATCH] drm/i915/gvt/scheduler: fix potential NULL pointer dereference

2018-03-19 Thread Gustavo A. R. Silva
Hi Chris, On 03/19/2018 03:38 PM, Chris Wilson wrote: Quoting Gustavo A. R. Silva (2018-03-19 19:30:53) _workload_ is being dereferenced before it is null checked, hence there is a potential null pointer dereference. Fix this by moving the pointer dereference after _workload_ has been null

[Intel-gfx] [PATCH] drm/i915/gvt/scheduler: fix potential NULL pointer dereference

2018-03-19 Thread Gustavo A. R. Silva
ot;drm/i915/gvt: keep oa config in shadow ctx") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/scheduler.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c index 068

Re: [Intel-gfx] [PATCH] drm/i915/selftests: fix inconsistent IS_ERR and PTR_ERR

2018-02-15 Thread Gustavo A. R. Silva
On 02/15/2018 03:13 AM, Jani Nikula wrote: On Wed, 14 Feb 2018, "Gustavo A. R. Silva" wrote: Fix inconsistent IS_ERR and PTR_ERR in shrink_boom. The proper pointer to use is _explode_ instead of _purge_. This issue was detected with the help of Coccinelle. Fixes: fe215c8bc426

[Intel-gfx] [PATCH] drm/i915/selftests: fix inconsistent IS_ERR and PTR_ERR

2018-02-15 Thread Gustavo A. R. Silva
Fix inconsistent IS_ERR and PTR_ERR in shrink_boom. The proper pointer to use is _explode_ instead of _purge_. This issue was detected with the help of Coccinelle. Fixes: fe215c8bc426 ("drm/i915/selftests: add missing gtt shrinker test") Signed-off-by: Gustavo A. R. Silva --- drive

Re: [Intel-gfx] [PATCH] drm/i915/gvt/fb_decoder: Fix out-of-bounds read

2017-12-12 Thread Gustavo A. R. Silva
Hi Zhenyu, Quoting Zhenyu Wang : On 2017.12.09 00:37:59 -0600, Gustavo A. R. Silva wrote: In case function skl_format_to_drm returns -EINVAL, fmt turns into a huge number as fmt is of type u32, hence there is an out-of-bounds read when using fmt as an index for array skl_pixel_formats at line

[Intel-gfx] [PATCH] drm/i915/gvt/fb_decoder: Fix out-of-bounds read

2017-12-08 Thread Gustavo A. R. Silva
") Fixes: 9f31d1063b43 ("drm/i915/gvt: Add framebuffer decoder support") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/fb_decoder.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/gvt/fb_decoder.c b/drivers/gpu/drm/i915/gvt/fb_decoder.c

Re: [Intel-gfx] [PATCH] drm/i915: Mark expected switch fall-throughs

2017-12-04 Thread Gustavo A. R. Silva
Hi Joonas, Quoting Joonas Lahtinen : On Mon, 2017-11-27 at 16:17 -0600, Gustavo A. R. Silva wrote: In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. I have to say I'm totally not sold on regexps matching comment contents

[Intel-gfx] [PATCH] drm/i915: Mark expected switch fall-throughs

2017-11-27 Thread Gustavo A. R. Silva
Addresses-Coverity-ID: 1357403 Addresses-Coverity-ID: 1357433 Addresses-Coverity-ID: 1392622 Addresses-Coverity-ID: 1415273 Addresses-Coverity-ID: 1435752 Addresses-Coverity-ID: 1441500 Addresses-Coverity-ID: 1454596 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/i915_gem.c | 3

[Intel-gfx] [PATCH] drm/i915/intel_sdvo: mark expected switch fall-throughs

2017-11-08 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 141432 Addresses-Coverity-ID: 141433 Addresses-Coverity-ID: 141434 Addresses-Coverity-ID: 141435 Addresses-Coverity-ID: 141436 Signed-off-by: Gustavo A. R. Silva

[Intel-gfx] [PATCH 1/2] gpu: drm: i915: remove dead code

2017-05-16 Thread Gustavo A. R. Silva
Local variable has_reduced_clock is assigned to a constant value and it is never updated again. Remove this variable and the dead code it guards. Addresses-Coverity-ID: 1362230 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/intel_display.c | 9 + 1 file changed, 1 insertion

[Intel-gfx] [PATCH 2/2] gpu: drm: i915: compress logic into one line

2017-05-16 Thread Gustavo A. R. Silva
Simplify logic to avoid unnecessary variable declaration and assignment. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/intel_display.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915