Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v1 1/3] Move struct cpu_feature to <linux/cpufeature.h>
Date: Mon, 21 Sep 2026 14:28:50 +0000	[thread overview]
Message-ID: <20260921142851.551C81F00893@smtp.kernel.org> (raw)
In-Reply-To: <ef103a4b9e1cd7477fa52ee347c4ec301354fba9.1789988540.git.u.kleine-koenig@baylibre.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] build: cross-compilation failure due to unguarded <linux/types.h>
--

commit eeaf7eac97be82ddec1f82f3064dbaed8a04364f
Author: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>

Move struct cpu_feature to <linux/cpufeature.h>

This commit moves the definition of struct cpu_feature from
<linux/mod_devicetable.h> to <linux/cpufeature.h>. It also adds explicit
includes of <linux/cpufeature.h> in devicetable-offsets.c and file2alias.c
to satisfy modpost requirements.

> diff --git a/include/linux/cpufeature.h b/include/linux/cpufeature.h
> index 6aff540ee9e57..93c1da38aaf69 100644
> --- a/include/linux/cpufeature.h
> +++ b/include/linux/cpufeature.h
> @@ -6,10 +6,20 @@
>  #ifndef __LINUX_CPUFEATURE_H
>  #define __LINUX_CPUFEATURE_H
>  
> +#include <linux/types.h>

[Severity: Low]
Does this unguarded include cause a cross-compilation failure?

Because scripts/mod/file2alias.c is compiled using the host compiler (HOSTCC),
this unguarded include in include/linux/cpufeature.h causes the host compiler
to pull in the host system's <linux/types.h> when compiling file2alias.c.

On non-Linux systems (like macOS or FreeBSD), this header does not exist,
leading to a missing header error. On Linux hosts, it pulls in
/usr/include/linux/types.h, which risks compiler redefinition errors
against the explicit __u16 typedefs in file2alias.c.

Could this be wrapped in an #ifdef __KERNEL__ guard?

[ ... ]

> diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> index 8d36c74dec2d5..88bff32072775 100644
> --- a/scripts/mod/file2alias.c
> +++ b/scripts/mod/file2alias.c
> @@ -121,6 +121,7 @@ typedef struct {
>  /* Big exception to the "don't include kernel headers into userspace, which
>   * even potentially has different endianness and word sizes, since
>   * we handle those differences explicitly below */
> +#include "../../include/linux/cpufeature.h"

[Severity: Low]
Does this host-compiled inclusion of the kernel header implicitly pull in
the host's linux/types.h due to the new include in cpufeature.h?

This is the inclusion path in scripts/mod/file2alias.c that triggers the
cross-compilation failure mentioned above.

>  #include "../../include/linux/mod_devicetable.h"
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1789988540.git.u.kleine-koenig@baylibre.com?part=1

  reply	other threads:[~2026-09-21 14:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 14:18 [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 1/3] Move struct cpu_feature to <linux/cpufeature.h> Uwe Kleine-König (The Capable Hub)
2026-09-21 14:28   ` sashiko-bot [this message]
2026-09-22 19:43 ` [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Armin Wolf
2026-10-05 15:23 ` Nathan Chancellor
2026-10-06  8:54   ` Nathan Chancellor
2026-10-06 22:39   ` Uwe Kleine-König (The Capable Hub)

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=20260921142851.551C81F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=u.kleine-koenig@baylibre.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