* [Intel-gfx] [PATCH][next] drm/i915/guc: Replace zero-length arrays with flexible-array members
@ 2023-01-10 16:44 Gustavo A. R. Silva
2023-01-10 19:28 ` Rodrigo Vivi
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2023-01-10 16:44 UTC (permalink / raw)
To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
David Airlie, Daniel Vetter
Cc: intel-gfx, linux-hardening, linux-kernel, dri-devel,
Gustavo A. R. Silva
Zero-length arrays are deprecated[1] and we are moving towards
adopting C99 flexible-array members, instead. So, replace zero-length
arrays in a couple of structures (three, actually) with flex-array
members.
This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
routines on memcpy() and help us make progress towards globally
enabling -fstrict-flex-arrays=3 [2].
Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays [1]
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [2]
Link: https://github.com/KSPP/linux/issues/78
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
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..9d589c28f40f 100644
--- a/drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h
+++ b/drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h
@@ -73,7 +73,7 @@ struct guc_debug_capture_list_header {
struct guc_debug_capture_list {
struct guc_debug_capture_list_header header;
- struct guc_mmio_reg regs[0];
+ struct guc_mmio_reg regs[];
} __packed;
/**
@@ -125,7 +125,7 @@ struct guc_state_capture_header_t {
struct guc_state_capture_t {
struct guc_state_capture_header_t header;
- struct guc_mmio_reg mmio_entries[0];
+ struct guc_mmio_reg mmio_entries[];
} __packed;
enum guc_capture_group_types {
@@ -145,7 +145,7 @@ struct guc_state_capture_group_header_t {
/* this is the top level structure where an error-capture dump starts */
struct guc_state_capture_group_t {
struct guc_state_capture_group_header_t grp_header;
- struct guc_state_capture_t capture_entries[0];
+ struct guc_state_capture_t capture_entries[];
} __packed;
/**
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Intel-gfx] [PATCH][next] drm/i915/guc: Replace zero-length arrays with flexible-array members
2023-01-10 16:44 [Intel-gfx] [PATCH][next] drm/i915/guc: Replace zero-length arrays with flexible-array members Gustavo A. R. Silva
@ 2023-01-10 19:28 ` Rodrigo Vivi
2023-01-10 19:42 ` Gustavo A. R. Silva
2023-01-10 20:10 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-01-11 4:57 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2 siblings, 1 reply; 6+ messages in thread
From: Rodrigo Vivi @ 2023-01-10 19:28 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: dri-devel, intel-gfx, linux-kernel, linux-hardening,
Daniel Vetter, David Airlie
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-length
> arrays in a couple of structures (three, actually) with flex-array
> members.
>
> This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
> routines on memcpy() and help us make progress towards globally
> enabling -fstrict-flex-arrays=3 [2].
>
> Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays [1]
> Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [2]
> Link: https://github.com/KSPP/linux/issues/78
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
> 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..9d589c28f40f 100644
> --- a/drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h
> +++ b/drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h
> @@ -73,7 +73,7 @@ struct guc_debug_capture_list_header {
>
> struct guc_debug_capture_list {
> struct guc_debug_capture_list_header header;
> - struct guc_mmio_reg regs[0];
> + struct guc_mmio_reg regs[];
> } __packed;
>
> /**
> @@ -125,7 +125,7 @@ struct guc_state_capture_header_t {
>
> struct guc_state_capture_t {
> struct guc_state_capture_header_t header;
> - struct guc_mmio_reg mmio_entries[0];
> + struct guc_mmio_reg mmio_entries[];
> } __packed;
>
> enum guc_capture_group_types {
> @@ -145,7 +145,7 @@ struct guc_state_capture_group_header_t {
> /* this is the top level structure where an error-capture dump starts */
> struct guc_state_capture_group_t {
> struct guc_state_capture_group_header_t grp_header;
> - struct guc_state_capture_t capture_entries[0];
> + struct guc_state_capture_t capture_entries[];
Please notice we are currently using sizeof(struct ...).
Along with your proposed changes, shouldn't we also start using
the struct_size() which already take the flexible array into account?
> } __packed;
>
> /**
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Intel-gfx] [PATCH][next] drm/i915/guc: Replace zero-length arrays with flexible-array members
2023-01-10 19:28 ` Rodrigo Vivi
@ 2023-01-10 19:42 ` Gustavo A. R. Silva
2023-01-11 9:16 ` Rodrigo Vivi
0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2023-01-10 19:42 UTC (permalink / raw)
To: Rodrigo Vivi
Cc: dri-devel, intel-gfx, linux-kernel, linux-hardening,
Daniel Vetter, David Airlie
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-length
> > arrays in a couple of structures (three, actually) with flex-array
> > members.
> >
> > This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
> > routines on memcpy() and help us make progress towards globally
> > enabling -fstrict-flex-arrays=3 [2].
> >
> > Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays [1]
> > Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [2]
> > Link: https://github.com/KSPP/linux/issues/78
> > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>
> > ---
> > 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..9d589c28f40f 100644
> > --- a/drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h
> > +++ b/drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h
> > @@ -73,7 +73,7 @@ struct guc_debug_capture_list_header {
> >
> > struct guc_debug_capture_list {
> > struct guc_debug_capture_list_header header;
> > - struct guc_mmio_reg regs[0];
> > + struct guc_mmio_reg regs[];
> > } __packed;
> >
> > /**
> > @@ -125,7 +125,7 @@ struct guc_state_capture_header_t {
> >
> > struct guc_state_capture_t {
> > struct guc_state_capture_header_t header;
> > - struct guc_mmio_reg mmio_entries[0];
> > + struct guc_mmio_reg mmio_entries[];
> > } __packed;
> >
> > enum guc_capture_group_types {
> > @@ -145,7 +145,7 @@ struct guc_state_capture_group_header_t {
> > /* this is the top level structure where an error-capture dump starts */
> > struct guc_state_capture_group_t {
> > struct guc_state_capture_group_header_t grp_header;
> > - struct guc_state_capture_t capture_entries[0];
> > + struct guc_state_capture_t capture_entries[];
>
> Please notice we are currently using sizeof(struct ...).
Yep; I noticed that. :)
> Along with your proposed changes, shouldn't we also start using
> the struct_size() which already take the flexible array into account?
Not necessarily. In recent times, we don't include the struct_size
changes in the same patch as the flex-array transformation. That's
usually a follow-up patch.
--
Gustavo
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/guc: Replace zero-length arrays with flexible-array members
2023-01-10 16:44 [Intel-gfx] [PATCH][next] drm/i915/guc: Replace zero-length arrays with flexible-array members Gustavo A. R. Silva
2023-01-10 19:28 ` Rodrigo Vivi
@ 2023-01-10 20:10 ` Patchwork
2023-01-11 4:57 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2023-01-10 20:10 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: intel-gfx
[-- Attachment #1: Type: text/plain, Size: 6352 bytes --]
== Series Details ==
Series: drm/i915/guc: Replace zero-length arrays with flexible-array members
URL : https://patchwork.freedesktop.org/series/112621/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_12569 -> Patchwork_112621v1
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/index.html
Participating hosts (41 -> 40)
------------------------------
Additional (1): fi-rkl-11600
Missing (2): fi-kbl-soraka fi-snb-2520m
Known issues
------------
Here are the changes found in Patchwork_112621v1 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@debugfs_test@basic-hwmon:
- fi-rkl-11600: NOTRUN -> [SKIP][1] ([i915#7456])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@debugfs_test@basic-hwmon.html
* igt@gem_huc_copy@huc-copy:
- fi-rkl-11600: NOTRUN -> [SKIP][2] ([i915#2190])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@gem_huc_copy@huc-copy.html
* igt@gem_lmem_swapping@basic:
- fi-rkl-11600: NOTRUN -> [SKIP][3] ([i915#4613]) +3 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@gem_lmem_swapping@basic.html
* igt@gem_tiled_pread_basic:
- fi-rkl-11600: NOTRUN -> [SKIP][4] ([i915#3282])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@gem_tiled_pread_basic.html
* igt@i915_pm_backlight@basic-brightness:
- fi-rkl-11600: NOTRUN -> [SKIP][5] ([i915#7561])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@i915_pm_backlight@basic-brightness.html
* igt@i915_suspend@basic-s3-without-i915:
- fi-rkl-11600: NOTRUN -> [INCOMPLETE][6] ([i915#4817])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@i915_suspend@basic-s3-without-i915.html
* igt@kms_chamelium_hpd@dp-hpd-fast:
- fi-rkl-11600: NOTRUN -> [SKIP][7] ([i915#7828]) +7 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@kms_chamelium_hpd@dp-hpd-fast.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor:
- fi-rkl-11600: NOTRUN -> [SKIP][8] ([i915#4103])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@kms_cursor_legacy@basic-busy-flip-before-cursor.html
* igt@kms_force_connector_basic@force-load-detect:
- fi-rkl-11600: NOTRUN -> [SKIP][9] ([fdo#109285] / [i915#4098])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@kms_force_connector_basic@force-load-detect.html
* igt@kms_psr@primary_page_flip:
- fi-rkl-11600: NOTRUN -> [SKIP][10] ([i915#1072]) +3 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@kms_psr@primary_page_flip.html
* igt@kms_setmode@basic-clone-single-crtc:
- fi-rkl-11600: NOTRUN -> [SKIP][11] ([i915#3555] / [i915#4098])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@kms_setmode@basic-clone-single-crtc.html
* igt@prime_vgem@basic-read:
- fi-rkl-11600: NOTRUN -> [SKIP][12] ([fdo#109295] / [i915#3291] / [i915#3708]) +2 similar issues
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@prime_vgem@basic-read.html
* igt@prime_vgem@basic-userptr:
- fi-rkl-11600: NOTRUN -> [SKIP][13] ([fdo#109295] / [i915#3301] / [i915#3708])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/fi-rkl-11600/igt@prime_vgem@basic-userptr.html
#### Possible fixes ####
* igt@i915_selftest@live@gt_lrc:
- {bat-adlp-9}: [INCOMPLETE][14] ([i915#4983]) -> [PASS][15]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/bat-adlp-9/igt@i915_selftest@live@gt_lrc.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/bat-adlp-9/igt@i915_selftest@live@gt_lrc.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4817]: https://gitlab.freedesktop.org/drm/intel/issues/4817
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
[i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
[i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
Build changes
-------------
* Linux: CI_DRM_12569 -> Patchwork_112621v1
CI-20190529: 20190529
CI_DRM_12569: 739b2ee4e76d9cd64e5fbe834b682e550e496cf4 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7115: c162d70b00c6f4cf6a0ba1ca7a7e2ad8f7190646 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_112621v1: 739b2ee4e76d9cd64e5fbe834b682e550e496cf4 @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
4611f7fed82a drm/i915/guc: Replace zero-length arrays with flexible-array members
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/index.html
[-- Attachment #2: Type: text/html, Size: 7232 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/guc: Replace zero-length arrays with flexible-array members
2023-01-10 16:44 [Intel-gfx] [PATCH][next] drm/i915/guc: Replace zero-length arrays with flexible-array members Gustavo A. R. Silva
2023-01-10 19:28 ` Rodrigo Vivi
2023-01-10 20:10 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
@ 2023-01-11 4:57 ` Patchwork
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2023-01-11 4:57 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: intel-gfx
[-- Attachment #1: Type: text/plain, Size: 11792 bytes --]
== Series Details ==
Series: drm/i915/guc: Replace zero-length arrays with flexible-array members
URL : https://patchwork.freedesktop.org/series/112621/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_12569_full -> Patchwork_112621v1_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/index.html
Participating hosts (14 -> 11)
------------------------------
Missing (3): pig-skl-6260u pig-kbl-iris pig-glk-j5005
Known issues
------------
Here are the changes found in Patchwork_112621v1_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-glk: [PASS][1] -> [FAIL][2] ([i915#2842]) +1 similar issue
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-glk7/igt@gem_exec_fair@basic-pace-share@rcs0.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/shard-glk1/igt@gem_exec_fair@basic-pace-share@rcs0.html
* igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-180-async-flip:
- shard-glk: [PASS][3] -> [DMESG-WARN][4] ([i915#2017])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-glk1/igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-180-async-flip.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/shard-glk5/igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-180-async-flip.html
#### Possible fixes ####
* igt@drm_fdinfo@idle@rcs0:
- {shard-rkl}: [FAIL][5] ([i915#7742]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-1/igt@drm_fdinfo@idle@rcs0.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/shard-rkl-2/igt@drm_fdinfo@idle@rcs0.html
* igt@gem_ctx_isolation@preservation-s3@bcs0:
- {shard-rkl}: [FAIL][7] ([fdo#103375]) -> [PASS][8] +3 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-3/igt@gem_ctx_isolation@preservation-s3@bcs0.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/shard-rkl-5/igt@gem_ctx_isolation@preservation-s3@bcs0.html
* igt@gem_exec_fair@basic-none-share@rcs0:
- {shard-rkl}: [FAIL][9] ([i915#2842]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-3/igt@gem_exec_fair@basic-none-share@rcs0.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/shard-rkl-5/igt@gem_exec_fair@basic-none-share@rcs0.html
* igt@gem_exec_reloc@basic-wc-read-noreloc:
- {shard-rkl}: [SKIP][11] ([i915#3281]) -> [PASS][12] +7 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-1/igt@gem_exec_reloc@basic-wc-read-noreloc.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/shard-rkl-5/igt@gem_exec_reloc@basic-wc-read-noreloc.html
* igt@gem_partial_pwrite_pread@write:
- {shard-rkl}: [SKIP][13] ([i915#3282]) -> [PASS][14] +1 similar issue
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-3/igt@gem_partial_pwrite_pread@write.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/shard-rkl-5/igt@gem_partial_pwrite_pread@write.html
* igt@gen9_exec_parse@valid-registers:
- {shard-rkl}: [SKIP][15] ([i915#2527]) -> [PASS][16] +3 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-2/igt@gen9_exec_parse@valid-registers.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/shard-rkl-5/igt@gen9_exec_parse@valid-registers.html
* igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-hdmi-a:
- {shard-dg1}: [SKIP][17] ([i915#1937]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-dg1-18/igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-hdmi-a.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/shard-dg1-14/igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-hdmi-a.html
* igt@i915_pm_sseu@full-enable:
- {shard-rkl}: [SKIP][19] ([i915#4387]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12569/shard-rkl-2/igt@i915_pm_sseu@full-enable.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/shard-rkl-5/igt@i915_pm_sseu@full-enable.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109279]: https://bugs.freedesktop.org/show_bug.cgi?id=109279
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[fdo#109303]: https://bugs.freedesktop.org/show_bug.cgi?id=109303
[fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
[fdo#109313]: https://bugs.freedesktop.org/show_bug.cgi?id=109313
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#110542]: https://bugs.freedesktop.org/show_bug.cgi?id=110542
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
[i915#1902]: https://gitlab.freedesktop.org/drm/intel/issues/1902
[i915#1937]: https://gitlab.freedesktop.org/drm/intel/issues/1937
[i915#2017]: https://gitlab.freedesktop.org/drm/intel/issues/2017
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
[i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
[i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
[i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
[i915#315]: https://gitlab.freedesktop.org/drm/intel/issues/315
[i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
[i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3469]: https://gitlab.freedesktop.org/drm/intel/issues/3469
[i915#3528]: https://gitlab.freedesktop.org/drm/intel/issues/3528
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
[i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
[i915#3804]: https://gitlab.freedesktop.org/drm/intel/issues/3804
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#3966]: https://gitlab.freedesktop.org/drm/intel/issues/3966
[i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#426]: https://gitlab.freedesktop.org/drm/intel/issues/426
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
[i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
[i915#5327]: https://gitlab.freedesktop.org/drm/intel/issues/5327
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[i915#5461]: https://gitlab.freedesktop.org/drm/intel/issues/5461
[i915#5723]: https://gitlab.freedesktop.org/drm/intel/issues/5723
[i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6248]: https://gitlab.freedesktop.org/drm/intel/issues/6248
[i915#6252]: https://gitlab.freedesktop.org/drm/intel/issues/6252
[i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
[i915#6334]: https://gitlab.freedesktop.org/drm/intel/issues/6334
[i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
[i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
[i915#6944]: https://gitlab.freedesktop.org/drm/intel/issues/6944
[i915#6946]: https://gitlab.freedesktop.org/drm/intel/issues/6946
[i915#6953]: https://gitlab.freedesktop.org/drm/intel/issues/6953
[i915#7052]: https://gitlab.freedesktop.org/drm/intel/issues/7052
[i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
[i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
[i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
[i915#7651]: https://gitlab.freedesktop.org/drm/intel/issues/7651
[i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
[i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
Build changes
-------------
* Linux: CI_DRM_12569 -> Patchwork_112621v1
* Piglit: piglit_4509 -> None
CI-20190529: 20190529
CI_DRM_12569: 739b2ee4e76d9cd64e5fbe834b682e550e496cf4 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7115: c162d70b00c6f4cf6a0ba1ca7a7e2ad8f7190646 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_112621v1: 739b2ee4e76d9cd64e5fbe834b682e550e496cf4 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112621v1/index.html
[-- Attachment #2: Type: text/html, Size: 6749 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Intel-gfx] [PATCH][next] drm/i915/guc: Replace zero-length arrays with flexible-array members
2023-01-10 19:42 ` Gustavo A. R. Silva
@ 2023-01-11 9:16 ` Rodrigo Vivi
0 siblings, 0 replies; 6+ messages in thread
From: Rodrigo Vivi @ 2023-01-11 9:16 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: intel-gfx, linux-kernel, dri-devel, linux-hardening,
Daniel Vetter, David Airlie
On Tue, Jan 10, 2023 at 01:42:57PM -0600, Gustavo A. R. Silva wrote:
> 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-length
> > > arrays in a couple of structures (three, actually) with flex-array
> > > members.
> > >
> > > This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
> > > routines on memcpy() and help us make progress towards globally
> > > enabling -fstrict-flex-arrays=3 [2].
> > >
> > > Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays [1]
> > > Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [2]
> > > Link: https://github.com/KSPP/linux/issues/78
> > > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> >
> > > ---
> > > 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..9d589c28f40f 100644
> > > --- a/drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h
> > > +++ b/drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h
> > > @@ -73,7 +73,7 @@ struct guc_debug_capture_list_header {
> > >
> > > struct guc_debug_capture_list {
> > > struct guc_debug_capture_list_header header;
> > > - struct guc_mmio_reg regs[0];
> > > + struct guc_mmio_reg regs[];
> > > } __packed;
> > >
> > > /**
> > > @@ -125,7 +125,7 @@ struct guc_state_capture_header_t {
> > >
> > > struct guc_state_capture_t {
> > > struct guc_state_capture_header_t header;
> > > - struct guc_mmio_reg mmio_entries[0];
> > > + struct guc_mmio_reg mmio_entries[];
> > > } __packed;
> > >
> > > enum guc_capture_group_types {
> > > @@ -145,7 +145,7 @@ struct guc_state_capture_group_header_t {
> > > /* this is the top level structure where an error-capture dump starts */
> > > struct guc_state_capture_group_t {
> > > struct guc_state_capture_group_header_t grp_header;
> > > - struct guc_state_capture_t capture_entries[0];
> > > + struct guc_state_capture_t capture_entries[];
> >
> > Please notice we are currently using sizeof(struct ...).
>
> Yep; I noticed that. :)
>
> > Along with your proposed changes, shouldn't we also start using
> > the struct_size() which already take the flexible array into account?
>
> Not necessarily. In recent times, we don't include the struct_size
> changes in the same patch as the flex-array transformation. That's
> usually a follow-up patch.
okay, if that's not a problem, let's go with this for now and wait
for the follow ups.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(and pushing it right now. Thanks for the patch)
>
> --
> Gustavo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-01-11 9:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-10 16:44 [Intel-gfx] [PATCH][next] drm/i915/guc: Replace zero-length arrays with flexible-array members Gustavo A. R. Silva
2023-01-10 19:28 ` Rodrigo Vivi
2023-01-10 19:42 ` Gustavo A. R. Silva
2023-01-11 9:16 ` Rodrigo Vivi
2023-01-10 20:10 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-01-11 4:57 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox