Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Nicolas Schier" <nsc@kernel.org>,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Nick Desaulniers" <nick.desaulniers+lkml@gmail.com>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	linux-kbuild@vger.kernel.org, llvm@lists.linux.dev,
	patches@lists.linux.dev
Subject: Re: [PATCH] kbuild: uapi: Avoid testing certain headers on ARCH=arm with CC=clang
Date: Mon, 12 Jan 2026 15:53:07 -0700	[thread overview]
Message-ID: <20260112225307.GA2241363@ax162> (raw)
In-Reply-To: <29b2e736-d462-45b7-a0a9-85f8d8a3de56@app.fastmail.com>

On Sun, Jan 11, 2026 at 11:29:31AM +0100, Arnd Bergmann wrote:
> On Sun, Jan 11, 2026, at 01:52, Nathan Chancellor wrote:
> >
> > To keep the build working while the root cause of the warnings is
> > investigated and resolved, disable testing these header files for
> > ARCH=arm when building with clang. 
> 
> I think we can just safely mark the internal unions as __packed as
> well. The (untested) change below would annotate all of them
> as being potentially misaligned so they can be stored at an
> odd start offset, and correctly produce warnings when someone
> takes the address of a member.

Yeah, this diff appears to avoid those warnings in my testing. Would you
want to send these changes as formal patches so we can get formal acks
from the maintainers of these files to take them via the kbuild tree
with Thomas's UAPI testing changes?

> diff --git a/include/uapi/linux/hyperv.h b/include/uapi/linux/hyperv.h
> index aaa502a7bff4..02ea5f2e43d4 100644
> --- a/include/uapi/linux/hyperv.h
> +++ b/include/uapi/linux/hyperv.h
> @@ -362,7 +362,7 @@ struct hv_kvp_exchg_msg_value {
>                 __u8 value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE];
>                 __u32 value_u32;
>                 __u64 value_u64;
> -       };
> +       } __packed;
>  } __attribute__((packed));
>  
>  struct hv_kvp_msg_enumerate {
> diff --git a/include/uapi/linux/vbox_vmmdev_types.h b/include/uapi/linux/vbox_vmmdev_types.h
> index 6073858d52a2..15ccfb5d624c 100644
> --- a/include/uapi/linux/vbox_vmmdev_types.h
> +++ b/include/uapi/linux/vbox_vmmdev_types.h
> @@ -229,14 +229,14 @@ struct vmmdev_hgcm_function_parameter32 {
>                                 __u32 phys_addr;
>                                 __u32 linear_addr;
>                         } u;
> -               } pointer;
> +               } __packed pointer;
>                 struct {
>                         /** Size of the buffer described by the page list. */
>                         __u32 size;
>                         /** Relative to the request header. */
>                         __u32 offset;
> -               } page_list;
> -       } u;
> +               } __packed page_list;
> +       } __packed u;
>  } __packed;
>  VMMDEV_ASSERT_SIZE(vmmdev_hgcm_function_parameter32, 4 + 8);
>  
> @@ -251,14 +251,14 @@ struct vmmdev_hgcm_function_parameter64 {
>                         union {
>                                 __u64 phys_addr;
>                                 __u64 linear_addr;
> -                       } u;
> +                       } __packed u;
>                 } __packed pointer;
>                 struct {
>                         /** Size of the buffer described by the page list. */
>                         __u32 size;
>                         /** Relative to the request header. */
>                         __u32 offset;
> -               } page_list;
> +               } __packed page_list;
>         } __packed u;
>  } __packed;
>  VMMDEV_ASSERT_SIZE(vmmdev_hgcm_function_parameter64, 4 + 12);

      reply	other threads:[~2026-01-12 22:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-11  0:52 [PATCH] kbuild: uapi: Avoid testing certain headers on ARCH=arm with CC=clang Nathan Chancellor
2026-01-11 10:29 ` Arnd Bergmann
2026-01-12 22:53   ` Nathan Chancellor [this message]

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=20260112225307.GA2241363@ax162 \
    --to=nathan@kernel.org \
    --cc=arnd@arndb.de \
    --cc=justinstitt@google.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=nsc@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=thomas.weissschuh@linutronix.de \
    /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