lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <rskjz3ylzfvccujrm7mxsg6adcbjdtziuxedw44sukeny3msm5@2pcsyz3g2dsm>
Date: Fri, 29 Aug 2025 08:25:09 -0500
From: Lucas De Marchi <lucas.demarchi@...el.com>
To: "Gustavo A. R. Silva" <gustavoars@...nel.org>
CC: Thomas Hellström <thomas.hellstrom@...ux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@...el.com>, David Airlie <airlied@...il.com>,
	Simona Vetter <simona@...ll.ch>, <intel-xe@...ts.freedesktop.org>,
	<dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>,
	<linux-hardening@...r.kernel.org>
Subject: Re: [PATCH][next] drm/xe: Avoid dozens of
 -Wflex-array-member-not-at-end warnings

On Fri, Aug 29, 2025 at 12:28:45PM +0200, Gustavo A. R. Silva wrote:
>-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
>getting ready to enable it, globally.
>
>Move the conflicting declaration to the end of the corresponding
>structure. Notice that `struct dev_pagemap` is a flexible structure,
>this is a structure that contains a flexible-array member.
>
>Fix 56 of the following type of warnings:
>drivers/gpu/drm/xe/xe_vram_types.h:69:28: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

should this patch be together with actually enabling the warning (at
least locally in xe) so we don't re-introduce it? From the user side
it's not obvious that dev_pagemap itself contains an array so it can
only be embedded at the end.

Lucas De Marchi

>
>Signed-off-by: Gustavo A. R. Silva <gustavoars@...nel.org>
>---
> drivers/gpu/drm/xe/xe_vram_types.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_vram_types.h b/drivers/gpu/drm/xe/xe_vram_types.h
>index 83772dcbf1af..183d358da741 100644
>--- a/drivers/gpu/drm/xe/xe_vram_types.h
>+++ b/drivers/gpu/drm/xe/xe_vram_types.h
>@@ -66,8 +66,6 @@ struct xe_vram_region {
> #if IS_ENABLED(CONFIG_DRM_XE_PAGEMAP)
> 	/** @migrate: Back pointer to migrate */
> 	struct xe_migrate *migrate;
>-	/** @pagemap: Used to remap device memory as ZONE_DEVICE */
>-	struct dev_pagemap pagemap;
> 	/**
> 	 * @dpagemap: The struct drm_pagemap of the ZONE_DEVICE memory
> 	 * pages of this tile.
>@@ -79,6 +77,8 @@ struct xe_vram_region {
> 	 * This is generated when remap device memory as ZONE_DEVICE
> 	 */
> 	resource_size_t hpa_base;
>+	/** @pagemap: Used to remap device memory as ZONE_DEVICE */
>+	struct dev_pagemap pagemap;
> #endif
> };
>
>-- 
>2.43.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ