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: <6b0d2b2f-5ccc-4337-aeaf-d18ed6e6097f@ghiti.fr>
Date: Mon, 14 Apr 2025 15:05:41 +0200
From: Alexandre Ghiti <alex@...ti.fr>
To: Andrew Jones <ajones@...tanamicro.com>, linux-riscv@...ts.infradead.org,
 linux-kernel@...r.kernel.org
Cc: paul.walmsley@...ive.com, palmer@...belt.com, conor.dooley@...rochip.com,
 oe-kbuild-all@...ts.linux.dev, charlie@...osinc.com,
 samuel.holland@...ive.com, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] riscv: Provide all alternative macros all the time

Hi Drew,

On 14/04/2025 14:09, Andrew Jones wrote:
> We need to provide all six forms of the alternative macros
> (ALTERNATIVE, ALTERNATIVE_2, _ALTERNATIVE_CFG, _ALTERNATIVE_CFG_2,
> __ALTERNATIVE_CFG, __ALTERNATIVE_CFG_2) for all four cases derived
> from the two ifdefs (RISCV_ALTERNATIVE, __ASSEMBLY__) in order to
> ensure all configs can compile. Define this missing ones and ensure
> all are defined to consume all parameters passed.
>
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202504130710.3IKz6Ibs-lkp@intel.com/
> Signed-off-by: Andrew Jones <ajones@...tanamicro.com>
> ---
>   arch/riscv/include/asm/alternative-macros.h | 19 +++++++------------
>   1 file changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h
> index 721ec275ce57..231d777d936c 100644
> --- a/arch/riscv/include/asm/alternative-macros.h
> +++ b/arch/riscv/include/asm/alternative-macros.h
> @@ -115,24 +115,19 @@
>   	\old_c
>   .endm
>   
> -#define _ALTERNATIVE_CFG(old_c, ...)	\
> -	ALTERNATIVE_CFG old_c
> -
> -#define _ALTERNATIVE_CFG_2(old_c, ...)	\
> -	ALTERNATIVE_CFG old_c
> +#define __ALTERNATIVE_CFG(old_c, ...)		ALTERNATIVE_CFG old_c
> +#define __ALTERNATIVE_CFG_2(old_c, ...)		ALTERNATIVE_CFG old_c
>   
>   #else /* !__ASSEMBLY__ */
>   
> -#define __ALTERNATIVE_CFG(old_c)	\
> -	old_c "\n"
> +#define __ALTERNATIVE_CFG(old_c, ...)		old_c "\n"
> +#define __ALTERNATIVE_CFG_2(old_c, ...)		old_c "\n"
>   
> -#define _ALTERNATIVE_CFG(old_c, ...)	\
> -	__ALTERNATIVE_CFG(old_c)
> +#endif /* __ASSEMBLY__ */
>   
> -#define _ALTERNATIVE_CFG_2(old_c, ...)	\
> -	__ALTERNATIVE_CFG(old_c)
> +#define _ALTERNATIVE_CFG(old_c, ...)		__ALTERNATIVE_CFG(old_c)
> +#define _ALTERNATIVE_CFG_2(old_c, ...)		__ALTERNATIVE_CFG_2(old_c)
>   
> -#endif /* __ASSEMBLY__ */
>   #endif /* CONFIG_RISCV_ALTERNATIVE */
>   
>   /*


I could not find the right Fixes tag, so unless you have one, I'll add 
the commit pointed at by kernel test robot.

You can add:

Tested-by: Alexandre Ghiti <alexghiti@...osinc.com>

Reviewed-by: Alexandre Ghiti <alexghiti@...osinc.com>

Thanks for looking into this!

Alex


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ