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] [thread-next>] [day] [month] [year] [list]
Message-ID: <aUCDq_hDrQHjMAn5@antec>
Date: Mon, 15 Dec 2025 21:54:51 +0000
From: Stafford Horne <shorne@...il.com>
To: Lyude Paul <lyude@...hat.com>
Cc: rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
	Thomas Gleixner <tglx@...utronix.de>,
	Boqun Feng <boqun.feng@...il.com>,
	Daniel Almeida <daniel.almeida@...labora.com>,
	Miguel Ojeda <ojeda@...nel.org>,
	Alex Gaynor <alex.gaynor@...il.com>, Gary Guo <gary@...yguo.net>,
	Björn Roy Baron <bjorn3_gh@...tonmail.com>,
	Benno Lossin <lossin@...nel.org>,
	Andreas Hindborg <a.hindborg@...nel.org>,
	Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
	Danilo Krummrich <dakr@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
	Waiman Long <longman@...hat.com>
Subject: Re: [PATCH v16 04/17] openrisc: Include <linux/cpumask.h> in smp.h

On Mon, Dec 15, 2025 at 12:57:51PM -0500, Lyude Paul wrote:
> While OpenRISC currently doesn't fail to build upstream, it appears that
> include <asm/smp.h> in the right headers is enough to break that -
> primarily because OpenRISC's asm/smp.h header doesn't actually provide any
> definition for struct cpumask. Which means the only reason we aren't
> failing to build kernel is because we've been lucky enough that every spot
> including asm/smp.h already has definitions for struct cpumask pulled in.
> 
> This became evident when trying to work on a patch series for adding
> ref-counted interrupt enable/disables to the kernel, where introducing a
> new interrupt_rc.h header suddenly introduced a build error on OpenRISC:
> 
>      In file included from include/linux/interrupt_rc.h:17,
>                       from include/linux/spinlock.h:60,
>                       from include/linux/mmzone.h:8,
>                       from include/linux/gfp.h:7,
>                       from include/linux/mm.h:7,
>                       from arch/openrisc/include/asm/pgalloc.h:20,
>                       from arch/openrisc/include/asm/io.h:18,
>                       from include/linux/io.h:12,
>                       from drivers/irqchip/irq-ompic.c:61:
>      arch/openrisc/include/asm/smp.h:21:59: warning: 'struct cpumask'
>      declared inside parameter list will not be visible outside of this
>      definition or declaration
>         21 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
>            |                                                           ^~~~~~~
>      arch/openrisc/include/asm/smp.h:23:54: warning: 'struct cpumask'
>      declared inside parameter list will not be visible outside of this
>      definition or declaration
>         23 | extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));
>            |                                                      ^~~~~~~
>      drivers/irqchip/irq-ompic.c: In function 'ompic_of_init':
>   >> drivers/irqchip/irq-ompic.c:191:28: error: passing argument 1 of
>      'set_smp_cross_call' from incompatible pointer type
>      [-Werror=incompatible-pointer-types]
>        191 |         set_smp_cross_call(ompic_raise_softirq);
>            |                            ^~~~~~~~~~~~~~~~~~~
>            |                            |
>            |                            void (*)(const struct cpumask *, unsigned int)
>      arch/openrisc/include/asm/smp.h:23:32: note: expected 'void (*)(const
>      struct cpumask *, unsigned int)' but argument is of type 'void
>      (*)(const struct cpumask *, unsigned int)'
>         23 | extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));
> 
> To fix this, let's take an example from the smp.h headers of other
> architectures (x86, hexagon, arm64, probably more): just include
> linux/cpumask.h at the top.
> 
> Signed-off-by: Lyude Paul <lyude@...hat.com>
> ---
>  arch/openrisc/include/asm/smp.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/openrisc/include/asm/smp.h b/arch/openrisc/include/asm/smp.h
> index e21d2f12b5b67..0327d8cdae2d0 100644
> --- a/arch/openrisc/include/asm/smp.h
> +++ b/arch/openrisc/include/asm/smp.h
> @@ -9,6 +9,8 @@
>  #ifndef __ASM_OPENRISC_SMP_H
>  #define __ASM_OPENRISC_SMP_H
>  
> +#include <linux/cpumask.h>
> +
>  #include <asm/spr.h>
>  #include <asm/spr_defs.h>

This looks good to me.

Acked-by: Stafford Horne <shorne@...il.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ