Linux ACPI
 help / color / mirror / Atom feed
From: <dan.j.williams@intel.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Kees Cook <kees@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>
Cc: <nvdimm@lists.linux.dev>, <linux-acpi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	<linux-hardening@vger.kernel.org>
Subject: Re: [PATCH v4][for-next/hardening] acpi: nfit: intel: avoid multiple -Wflex-array-member-not-at-end warnings
Date: Wed, 25 Jun 2025 17:17:44 -0700	[thread overview]
Message-ID: <685c91a8c3ed5_1608bd10024@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <aFxtOLs6Yv_uzgt4@kspp>

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.
> 
> Use the new TRAILING_OVERLAP() helper to fix a dozen instances of
> the following type of warning:
> 
> drivers/acpi/nfit/intel.c:692:35: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
> 
> Acked-by: Dan Williams <dan.j.williams@intel.com>
> Tested-by: Dan Williams <dan.j.williams@intel.com>

Looks like our mails crossed [1], but I rushed this testing, apologies.
This patch does cause a regression, and the conversion is not equivalent
according to pahole:

union pkg_nd_intel_bus_fw_activate {
        struct nd_cmd_pkg          pkg;                /*     0    64 */
        struct {
                u8                 _offset_to_fam[64]; /*     0    64 */
                /* --- cacheline 1 boundary (64 bytes) --- */
                struct nd_intel_bus_fw_activate cmd;   /*    64     5 */
        } __attribute__((__packed__));                 /*     0    69 */
};
struct pkg_nd_intel_bus_fw_activate2 {
        struct nd_cmd_pkg          pkg;                  /*     0    64 */

        /* XXX last struct has a flexible array */

        /* --- cacheline 1 boundary (64 bytes) --- */
        struct nd_intel_bus_fw_activate cmd;             /*    64     5 */

        /* size: 72, cachelines: 2, members: 2 */
        /* padding: 3 */
        /* flexible array members: end: 1 */
        /* last cacheline: 8 bytes */
};

Now, why the padding at the end matters for this test, I am still
trying to figure that out.

[1]: http://lore.kernel.org/685c772aa7cc1_23a2a10080@dwillia2-mobl4.notmuch

  reply	other threads:[~2025-06-26  0:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25 21:42 [PATCH v4][for-next/hardening] acpi: nfit: intel: avoid multiple -Wflex-array-member-not-at-end warnings Gustavo A. R. Silva
2025-06-26  0:17 ` dan.j.williams [this message]
2025-06-26  1:03 ` dan.j.williams
2025-06-27 15:52 ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=685c91a8c3ed5_1608bd10024@dwillia2-xfh.jf.intel.com.notmuch \
    --to=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=gustavoars@kernel.org \
    --cc=ira.weiny@intel.com \
    --cc=kees@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=rafael@kernel.org \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox