All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: Mark __se_sys_* functions __used
@ 2024-03-26 15:37 ` Sami Tolvanen
  0 siblings, 0 replies; 14+ messages in thread
From: Sami Tolvanen @ 2024-03-26 15:37 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: Kees Cook, linux-riscv, llvm, linux-kernel, Sami Tolvanen,
	Linux Kernel Functional Testing

Clang doesn't think ___se_sys_* functions used even though they are
aliased to __se_sys_*, resulting in -Wunused-function warnings when
building rv32. For example:

   mm/oom_kill.c:1195:1: warning: unused function '___se_sys_process_mrelease' [-Wunused-function]
    1195 | SYSCALL_DEFINE2(process_mrelease, int, pidfd, unsigned int, flags)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:221:36: note: expanded from macro 'SYSCALL_DEFINE2'
     221 | #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
         |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:231:2: note: expanded from macro 'SYSCALL_DEFINEx'
     231 |         __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/syscall_wrapper.h:81:2: note: expanded from macro '__SYSCALL_DEFINEx'
      81 |         __SYSCALL_SE_DEFINEx(x, sys, name, __VA_ARGS__)                         \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/syscall_wrapper.h:40:14: note: expanded from macro '__SYSCALL_SE_DEFINEx'
      40 |         static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
         |                     ^~~~~~~~~~~~~~~~~~~~
   <scratch space>:30:1: note: expanded from here
      30 | ___se_sys_process_mrelease
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.

Mark the functions __used explicitly to fix the Clang warnings.

Fixes: a9ad73295cc1 ("riscv: Fix syscall wrapper for >word-size arguments")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
---
 arch/riscv/include/asm/syscall_wrapper.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/include/asm/syscall_wrapper.h b/arch/riscv/include/asm/syscall_wrapper.h
index 980094c2e976..ac80216549ff 100644
--- a/arch/riscv/include/asm/syscall_wrapper.h
+++ b/arch/riscv/include/asm/syscall_wrapper.h
@@ -36,7 +36,8 @@ asmlinkage long __riscv_sys_ni_syscall(const struct pt_regs *);
 					ulong)						\
 			__attribute__((alias(__stringify(___se_##prefix##name))));	\
 	__diag_pop();									\
-	static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__));	\
+	static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))	\
+			__used;								\
 	static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
 
 #define SC_RISCV_REGS_TO_ARGS(x, ...) \

base-commit: 4cece764965020c22cff7665b18a012006359095
-- 
2.44.0.396.g6e790dbe36-goog


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] riscv: Mark __se_sys_* functions __used
@ 2024-03-26 15:37 ` Sami Tolvanen
  0 siblings, 0 replies; 14+ messages in thread
From: Sami Tolvanen @ 2024-03-26 15:37 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: Kees Cook, linux-riscv, llvm, linux-kernel, Sami Tolvanen,
	Linux Kernel Functional Testing

Clang doesn't think ___se_sys_* functions used even though they are
aliased to __se_sys_*, resulting in -Wunused-function warnings when
building rv32. For example:

   mm/oom_kill.c:1195:1: warning: unused function '___se_sys_process_mrelease' [-Wunused-function]
    1195 | SYSCALL_DEFINE2(process_mrelease, int, pidfd, unsigned int, flags)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:221:36: note: expanded from macro 'SYSCALL_DEFINE2'
     221 | #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
         |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:231:2: note: expanded from macro 'SYSCALL_DEFINEx'
     231 |         __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/syscall_wrapper.h:81:2: note: expanded from macro '__SYSCALL_DEFINEx'
      81 |         __SYSCALL_SE_DEFINEx(x, sys, name, __VA_ARGS__)                         \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/syscall_wrapper.h:40:14: note: expanded from macro '__SYSCALL_SE_DEFINEx'
      40 |         static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
         |                     ^~~~~~~~~~~~~~~~~~~~
   <scratch space>:30:1: note: expanded from here
      30 | ___se_sys_process_mrelease
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.

Mark the functions __used explicitly to fix the Clang warnings.

Fixes: a9ad73295cc1 ("riscv: Fix syscall wrapper for >word-size arguments")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
---
 arch/riscv/include/asm/syscall_wrapper.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/include/asm/syscall_wrapper.h b/arch/riscv/include/asm/syscall_wrapper.h
index 980094c2e976..ac80216549ff 100644
--- a/arch/riscv/include/asm/syscall_wrapper.h
+++ b/arch/riscv/include/asm/syscall_wrapper.h
@@ -36,7 +36,8 @@ asmlinkage long __riscv_sys_ni_syscall(const struct pt_regs *);
 					ulong)						\
 			__attribute__((alias(__stringify(___se_##prefix##name))));	\
 	__diag_pop();									\
-	static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__));	\
+	static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))	\
+			__used;								\
 	static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
 
 #define SC_RISCV_REGS_TO_ARGS(x, ...) \

base-commit: 4cece764965020c22cff7665b18a012006359095
-- 
2.44.0.396.g6e790dbe36-goog


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] riscv: Mark __se_sys_* functions __used
  2024-03-26 15:37 ` Sami Tolvanen
@ 2024-03-26 18:43   ` Alexandre Ghiti
  -1 siblings, 0 replies; 14+ messages in thread
From: Alexandre Ghiti @ 2024-03-26 18:43 UTC (permalink / raw)
  To: Sami Tolvanen, Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: Kees Cook, linux-riscv, llvm, linux-kernel,
	Linux Kernel Functional Testing

Hi Sami,

On 26/03/2024 16:37, Sami Tolvanen wrote:
> Clang doesn't think ___se_sys_* functions used even though they are
> aliased to __se_sys_*, resulting in -Wunused-function warnings when
> building rv32. For example:
>
>     mm/oom_kill.c:1195:1: warning: unused function '___se_sys_process_mrelease' [-Wunused-function]
>      1195 | SYSCALL_DEFINE2(process_mrelease, int, pidfd, unsigned int, flags)
>           | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     include/linux/syscalls.h:221:36: note: expanded from macro 'SYSCALL_DEFINE2'
>       221 | #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
>           |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     include/linux/syscalls.h:231:2: note: expanded from macro 'SYSCALL_DEFINEx'
>       231 |         __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     arch/riscv/include/asm/syscall_wrapper.h:81:2: note: expanded from macro '__SYSCALL_DEFINEx'
>        81 |         __SYSCALL_SE_DEFINEx(x, sys, name, __VA_ARGS__)                         \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     arch/riscv/include/asm/syscall_wrapper.h:40:14: note: expanded from macro '__SYSCALL_SE_DEFINEx'
>        40 |         static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
>           |                     ^~~~~~~~~~~~~~~~~~~~
>     <scratch space>:30:1: note: expanded from here
>        30 | ___se_sys_process_mrelease
>           | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>     1 warning generated.
>
> Mark the functions __used explicitly to fix the Clang warnings.
>
> Fixes: a9ad73295cc1 ("riscv: Fix syscall wrapper for >word-size arguments")
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>


Do you have the link of the report? So we can add a Closes tag.


> Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
> ---
>   arch/riscv/include/asm/syscall_wrapper.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/include/asm/syscall_wrapper.h b/arch/riscv/include/asm/syscall_wrapper.h
> index 980094c2e976..ac80216549ff 100644
> --- a/arch/riscv/include/asm/syscall_wrapper.h
> +++ b/arch/riscv/include/asm/syscall_wrapper.h
> @@ -36,7 +36,8 @@ asmlinkage long __riscv_sys_ni_syscall(const struct pt_regs *);
>   					ulong)						\
>   			__attribute__((alias(__stringify(___se_##prefix##name))));	\
>   	__diag_pop();									\
> -	static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__));	\
> +	static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))	\
> +			__used;								\
>   	static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
>   
>   #define SC_RISCV_REGS_TO_ARGS(x, ...) \
>
> base-commit: 4cece764965020c22cff7665b18a012006359095


You can add:

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

As the commit fixed here was merged in 6.9, this should go into fixes.

Thanks,

Alex


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] riscv: Mark __se_sys_* functions __used
@ 2024-03-26 18:43   ` Alexandre Ghiti
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Ghiti @ 2024-03-26 18:43 UTC (permalink / raw)
  To: Sami Tolvanen, Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: Kees Cook, linux-riscv, llvm, linux-kernel,
	Linux Kernel Functional Testing

Hi Sami,

On 26/03/2024 16:37, Sami Tolvanen wrote:
> Clang doesn't think ___se_sys_* functions used even though they are
> aliased to __se_sys_*, resulting in -Wunused-function warnings when
> building rv32. For example:
>
>     mm/oom_kill.c:1195:1: warning: unused function '___se_sys_process_mrelease' [-Wunused-function]
>      1195 | SYSCALL_DEFINE2(process_mrelease, int, pidfd, unsigned int, flags)
>           | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     include/linux/syscalls.h:221:36: note: expanded from macro 'SYSCALL_DEFINE2'
>       221 | #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
>           |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     include/linux/syscalls.h:231:2: note: expanded from macro 'SYSCALL_DEFINEx'
>       231 |         __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     arch/riscv/include/asm/syscall_wrapper.h:81:2: note: expanded from macro '__SYSCALL_DEFINEx'
>        81 |         __SYSCALL_SE_DEFINEx(x, sys, name, __VA_ARGS__)                         \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     arch/riscv/include/asm/syscall_wrapper.h:40:14: note: expanded from macro '__SYSCALL_SE_DEFINEx'
>        40 |         static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
>           |                     ^~~~~~~~~~~~~~~~~~~~
>     <scratch space>:30:1: note: expanded from here
>        30 | ___se_sys_process_mrelease
>           | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>     1 warning generated.
>
> Mark the functions __used explicitly to fix the Clang warnings.
>
> Fixes: a9ad73295cc1 ("riscv: Fix syscall wrapper for >word-size arguments")
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>


Do you have the link of the report? So we can add a Closes tag.


> Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
> ---
>   arch/riscv/include/asm/syscall_wrapper.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/include/asm/syscall_wrapper.h b/arch/riscv/include/asm/syscall_wrapper.h
> index 980094c2e976..ac80216549ff 100644
> --- a/arch/riscv/include/asm/syscall_wrapper.h
> +++ b/arch/riscv/include/asm/syscall_wrapper.h
> @@ -36,7 +36,8 @@ asmlinkage long __riscv_sys_ni_syscall(const struct pt_regs *);
>   					ulong)						\
>   			__attribute__((alias(__stringify(___se_##prefix##name))));	\
>   	__diag_pop();									\
> -	static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__));	\
> +	static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))	\
> +			__used;								\
>   	static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
>   
>   #define SC_RISCV_REGS_TO_ARGS(x, ...) \
>
> base-commit: 4cece764965020c22cff7665b18a012006359095


You can add:

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

As the commit fixed here was merged in 6.9, this should go into fixes.

Thanks,

Alex


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] riscv: Mark __se_sys_* functions __used
  2024-03-26 15:37 ` Sami Tolvanen
@ 2024-03-26 18:49   ` Conor Dooley
  -1 siblings, 0 replies; 14+ messages in thread
From: Conor Dooley @ 2024-03-26 18:49 UTC (permalink / raw)
  To: Sami Tolvanen
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Kees Cook, linux-riscv,
	llvm, linux-kernel, Linux Kernel Functional Testing

[-- Attachment #1: Type: text/plain, Size: 3284 bytes --]

On Tue, Mar 26, 2024 at 03:37:13PM +0000, Sami Tolvanen wrote:
> Clang doesn't think ___se_sys_* functions used even though they are
> aliased to __se_sys_*, resulting in -Wunused-function warnings when
> building rv32. For example:
> 
>    mm/oom_kill.c:1195:1: warning: unused function '___se_sys_process_mrelease' [-Wunused-function]
>     1195 | SYSCALL_DEFINE2(process_mrelease, int, pidfd, unsigned int, flags)
>          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/syscalls.h:221:36: note: expanded from macro 'SYSCALL_DEFINE2'
>      221 | #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
>          |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/syscalls.h:231:2: note: expanded from macro 'SYSCALL_DEFINEx'
>      231 |         __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/syscall_wrapper.h:81:2: note: expanded from macro '__SYSCALL_DEFINEx'
>       81 |         __SYSCALL_SE_DEFINEx(x, sys, name, __VA_ARGS__)                         \
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/syscall_wrapper.h:40:14: note: expanded from macro '__SYSCALL_SE_DEFINEx'
>       40 |         static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
>          |                     ^~~~~~~~~~~~~~~~~~~~
>    <scratch space>:30:1: note: expanded from here
>       30 | ___se_sys_process_mrelease
>          | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>    1 warning generated.
> 
> Mark the functions __used explicitly to fix the Clang warnings.
> 
> Fixes: a9ad73295cc1 ("riscv: Fix syscall wrapper for >word-size arguments")
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>

Oh neat, thanks. This was generating a shed load of noise in CI :)
Tested-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
>  arch/riscv/include/asm/syscall_wrapper.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/include/asm/syscall_wrapper.h b/arch/riscv/include/asm/syscall_wrapper.h
> index 980094c2e976..ac80216549ff 100644
> --- a/arch/riscv/include/asm/syscall_wrapper.h
> +++ b/arch/riscv/include/asm/syscall_wrapper.h
> @@ -36,7 +36,8 @@ asmlinkage long __riscv_sys_ni_syscall(const struct pt_regs *);
>  					ulong)						\
>  			__attribute__((alias(__stringify(___se_##prefix##name))));	\
>  	__diag_pop();									\
> -	static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__));	\
> +	static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))	\
> +			__used;								\
>  	static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
>  
>  #define SC_RISCV_REGS_TO_ARGS(x, ...) \
> 
> base-commit: 4cece764965020c22cff7665b18a012006359095
> -- 
> 2.44.0.396.g6e790dbe36-goog
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] riscv: Mark __se_sys_* functions __used
@ 2024-03-26 18:49   ` Conor Dooley
  0 siblings, 0 replies; 14+ messages in thread
From: Conor Dooley @ 2024-03-26 18:49 UTC (permalink / raw)
  To: Sami Tolvanen
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Kees Cook, linux-riscv,
	llvm, linux-kernel, Linux Kernel Functional Testing


[-- Attachment #1.1: Type: text/plain, Size: 3284 bytes --]

On Tue, Mar 26, 2024 at 03:37:13PM +0000, Sami Tolvanen wrote:
> Clang doesn't think ___se_sys_* functions used even though they are
> aliased to __se_sys_*, resulting in -Wunused-function warnings when
> building rv32. For example:
> 
>    mm/oom_kill.c:1195:1: warning: unused function '___se_sys_process_mrelease' [-Wunused-function]
>     1195 | SYSCALL_DEFINE2(process_mrelease, int, pidfd, unsigned int, flags)
>          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/syscalls.h:221:36: note: expanded from macro 'SYSCALL_DEFINE2'
>      221 | #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
>          |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/syscalls.h:231:2: note: expanded from macro 'SYSCALL_DEFINEx'
>      231 |         __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/syscall_wrapper.h:81:2: note: expanded from macro '__SYSCALL_DEFINEx'
>       81 |         __SYSCALL_SE_DEFINEx(x, sys, name, __VA_ARGS__)                         \
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/syscall_wrapper.h:40:14: note: expanded from macro '__SYSCALL_SE_DEFINEx'
>       40 |         static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
>          |                     ^~~~~~~~~~~~~~~~~~~~
>    <scratch space>:30:1: note: expanded from here
>       30 | ___se_sys_process_mrelease
>          | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>    1 warning generated.
> 
> Mark the functions __used explicitly to fix the Clang warnings.
> 
> Fixes: a9ad73295cc1 ("riscv: Fix syscall wrapper for >word-size arguments")
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>

Oh neat, thanks. This was generating a shed load of noise in CI :)
Tested-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
>  arch/riscv/include/asm/syscall_wrapper.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/include/asm/syscall_wrapper.h b/arch/riscv/include/asm/syscall_wrapper.h
> index 980094c2e976..ac80216549ff 100644
> --- a/arch/riscv/include/asm/syscall_wrapper.h
> +++ b/arch/riscv/include/asm/syscall_wrapper.h
> @@ -36,7 +36,8 @@ asmlinkage long __riscv_sys_ni_syscall(const struct pt_regs *);
>  					ulong)						\
>  			__attribute__((alias(__stringify(___se_##prefix##name))));	\
>  	__diag_pop();									\
> -	static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__));	\
> +	static long noinline ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))	\
> +			__used;								\
>  	static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
>  
>  #define SC_RISCV_REGS_TO_ARGS(x, ...) \
> 
> base-commit: 4cece764965020c22cff7665b18a012006359095
> -- 
> 2.44.0.396.g6e790dbe36-goog
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] riscv: Mark __se_sys_* functions __used
  2024-03-26 18:43   ` Alexandre Ghiti
@ 2024-03-26 18:55     ` Sami Tolvanen
  -1 siblings, 0 replies; 14+ messages in thread
From: Sami Tolvanen @ 2024-03-26 18:55 UTC (permalink / raw)
  To: Alexandre Ghiti
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Kees Cook, linux-riscv,
	llvm, linux-kernel, Linux Kernel Functional Testing

On Tue, Mar 26, 2024 at 6:43 PM Alexandre Ghiti <alex@ghiti.fr> wrote:
>
> Do you have the link of the report? So we can add a Closes tag.

Sure, this was reported here:

https://lore.kernel.org/lkml/56d3285a-ed22-44bd-8c22-ce51ad159a81@linaro.org/

Sami

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] riscv: Mark __se_sys_* functions __used
@ 2024-03-26 18:55     ` Sami Tolvanen
  0 siblings, 0 replies; 14+ messages in thread
From: Sami Tolvanen @ 2024-03-26 18:55 UTC (permalink / raw)
  To: Alexandre Ghiti
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Kees Cook, linux-riscv,
	llvm, linux-kernel, Linux Kernel Functional Testing

On Tue, Mar 26, 2024 at 6:43 PM Alexandre Ghiti <alex@ghiti.fr> wrote:
>
> Do you have the link of the report? So we can add a Closes tag.

Sure, this was reported here:

https://lore.kernel.org/lkml/56d3285a-ed22-44bd-8c22-ce51ad159a81@linaro.org/

Sami

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] riscv: Mark __se_sys_* functions __used
  2024-03-26 18:55     ` Sami Tolvanen
@ 2024-03-26 19:56       ` Alexandre Ghiti
  -1 siblings, 0 replies; 14+ messages in thread
From: Alexandre Ghiti @ 2024-03-26 19:56 UTC (permalink / raw)
  To: Sami Tolvanen, Daniel Díaz
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Kees Cook, linux-riscv,
	llvm, linux-kernel, Linux Kernel Functional Testing

On 26/03/2024 19:55, Sami Tolvanen wrote:
> On Tue, Mar 26, 2024 at 6:43 PM Alexandre Ghiti <alex@ghiti.fr> wrote:
>> Do you have the link of the report? So we can add a Closes tag.
> Sure, this was reported here:
>
> https://lore.kernel.org/lkml/56d3285a-ed22-44bd-8c22-ce51ad159a81@linaro.org/


For b4:

Closes: 
https://lore.kernel.org/lkml/56d3285a-ed22-44bd-8c22-ce51ad159a81@linaro.org/

I was expecting the "direct" lkft link though, @Daniel do you have any?

Thanks,

Alex


>
> Sami
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] riscv: Mark __se_sys_* functions __used
@ 2024-03-26 19:56       ` Alexandre Ghiti
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Ghiti @ 2024-03-26 19:56 UTC (permalink / raw)
  To: Sami Tolvanen, Daniel Díaz
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Kees Cook, linux-riscv,
	llvm, linux-kernel, Linux Kernel Functional Testing

On 26/03/2024 19:55, Sami Tolvanen wrote:
> On Tue, Mar 26, 2024 at 6:43 PM Alexandre Ghiti <alex@ghiti.fr> wrote:
>> Do you have the link of the report? So we can add a Closes tag.
> Sure, this was reported here:
>
> https://lore.kernel.org/lkml/56d3285a-ed22-44bd-8c22-ce51ad159a81@linaro.org/


For b4:

Closes: 
https://lore.kernel.org/lkml/56d3285a-ed22-44bd-8c22-ce51ad159a81@linaro.org/

I was expecting the "direct" lkft link though, @Daniel do you have any?

Thanks,

Alex


>
> Sami
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] riscv: Mark __se_sys_* functions __used
  2024-03-26 19:56       ` Alexandre Ghiti
@ 2024-03-27 12:52         ` Daniel Díaz
  -1 siblings, 0 replies; 14+ messages in thread
From: Daniel Díaz @ 2024-03-27 12:52 UTC (permalink / raw)
  To: Alexandre Ghiti
  Cc: Sami Tolvanen, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Kees Cook, linux-riscv, llvm, linux-kernel,
	Linux Kernel Functional Testing

Hello!

On Tue, 26 Mar 2024 at 13:56, Alexandre Ghiti <alex@ghiti.fr> wrote:
> On 26/03/2024 19:55, Sami Tolvanen wrote:
> > On Tue, Mar 26, 2024 at 6:43 PM Alexandre Ghiti <alex@ghiti.fr> wrote:
> >> Do you have the link of the report? So we can add a Closes tag.
> > Sure, this was reported here:
> >
> > https://lore.kernel.org/lkml/56d3285a-ed22-44bd-8c22-ce51ad159a81@linaro.org/
>
> For b4:
>
> Closes:
> https://lore.kernel.org/lkml/56d3285a-ed22-44bd-8c22-ce51ad159a81@linaro.org/
>
> I was expecting the "direct" lkft link though, @Daniel do you have any?

No, that's the extent of that report.

Greetings!

Daniel Díaz
daniel.diaz@linaro.org

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] riscv: Mark __se_sys_* functions __used
@ 2024-03-27 12:52         ` Daniel Díaz
  0 siblings, 0 replies; 14+ messages in thread
From: Daniel Díaz @ 2024-03-27 12:52 UTC (permalink / raw)
  To: Alexandre Ghiti
  Cc: Sami Tolvanen, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Kees Cook, linux-riscv, llvm, linux-kernel,
	Linux Kernel Functional Testing

Hello!

On Tue, 26 Mar 2024 at 13:56, Alexandre Ghiti <alex@ghiti.fr> wrote:
> On 26/03/2024 19:55, Sami Tolvanen wrote:
> > On Tue, Mar 26, 2024 at 6:43 PM Alexandre Ghiti <alex@ghiti.fr> wrote:
> >> Do you have the link of the report? So we can add a Closes tag.
> > Sure, this was reported here:
> >
> > https://lore.kernel.org/lkml/56d3285a-ed22-44bd-8c22-ce51ad159a81@linaro.org/
>
> For b4:
>
> Closes:
> https://lore.kernel.org/lkml/56d3285a-ed22-44bd-8c22-ce51ad159a81@linaro.org/
>
> I was expecting the "direct" lkft link though, @Daniel do you have any?

No, that's the extent of that report.

Greetings!

Daniel Díaz
daniel.diaz@linaro.org

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] riscv: Mark __se_sys_* functions __used
  2024-03-26 15:37 ` Sami Tolvanen
@ 2024-03-27 14:00   ` patchwork-bot+linux-riscv
  -1 siblings, 0 replies; 14+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-03-27 14:00 UTC (permalink / raw)
  To: Sami Tolvanen
  Cc: linux-riscv, paul.walmsley, palmer, aou, keescook, llvm,
	linux-kernel, lkft

Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Tue, 26 Mar 2024 15:37:13 +0000 you wrote:
> Clang doesn't think ___se_sys_* functions used even though they are
> aliased to __se_sys_*, resulting in -Wunused-function warnings when
> building rv32. For example:
> 
>    mm/oom_kill.c:1195:1: warning: unused function '___se_sys_process_mrelease' [-Wunused-function]
>     1195 | SYSCALL_DEFINE2(process_mrelease, int, pidfd, unsigned int, flags)
>          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/syscalls.h:221:36: note: expanded from macro 'SYSCALL_DEFINE2'
>      221 | #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
>          |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/syscalls.h:231:2: note: expanded from macro 'SYSCALL_DEFINEx'
>      231 |         __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/syscall_wrapper.h:81:2: note: expanded from macro '__SYSCALL_DEFINEx'
>       81 |         __SYSCALL_SE_DEFINEx(x, sys, name, __VA_ARGS__)                         \
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/syscall_wrapper.h:40:14: note: expanded from macro '__SYSCALL_SE_DEFINEx'
>       40 |         static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
>          |                     ^~~~~~~~~~~~~~~~~~~~
>    <scratch space>:30:1: note: expanded from here
>       30 | ___se_sys_process_mrelease
>          | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>    1 warning generated.
> 
> [...]

Here is the summary with links:
  - riscv: Mark __se_sys_* functions __used
    https://git.kernel.org/riscv/c/653650c468be

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] riscv: Mark __se_sys_* functions __used
@ 2024-03-27 14:00   ` patchwork-bot+linux-riscv
  0 siblings, 0 replies; 14+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-03-27 14:00 UTC (permalink / raw)
  To: Sami Tolvanen
  Cc: linux-riscv, paul.walmsley, palmer, aou, keescook, llvm,
	linux-kernel, lkft

Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Tue, 26 Mar 2024 15:37:13 +0000 you wrote:
> Clang doesn't think ___se_sys_* functions used even though they are
> aliased to __se_sys_*, resulting in -Wunused-function warnings when
> building rv32. For example:
> 
>    mm/oom_kill.c:1195:1: warning: unused function '___se_sys_process_mrelease' [-Wunused-function]
>     1195 | SYSCALL_DEFINE2(process_mrelease, int, pidfd, unsigned int, flags)
>          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/syscalls.h:221:36: note: expanded from macro 'SYSCALL_DEFINE2'
>      221 | #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
>          |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/syscalls.h:231:2: note: expanded from macro 'SYSCALL_DEFINEx'
>      231 |         __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/syscall_wrapper.h:81:2: note: expanded from macro '__SYSCALL_DEFINEx'
>       81 |         __SYSCALL_SE_DEFINEx(x, sys, name, __VA_ARGS__)                         \
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/riscv/include/asm/syscall_wrapper.h:40:14: note: expanded from macro '__SYSCALL_SE_DEFINEx'
>       40 |         static long ___se_##prefix##name(__MAP(x,__SC_LONG,__VA_ARGS__))
>          |                     ^~~~~~~~~~~~~~~~~~~~
>    <scratch space>:30:1: note: expanded from here
>       30 | ___se_sys_process_mrelease
>          | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>    1 warning generated.
> 
> [...]

Here is the summary with links:
  - riscv: Mark __se_sys_* functions __used
    https://git.kernel.org/riscv/c/653650c468be

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-03-27 14:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-26 15:37 [PATCH] riscv: Mark __se_sys_* functions __used Sami Tolvanen
2024-03-26 15:37 ` Sami Tolvanen
2024-03-26 18:43 ` Alexandre Ghiti
2024-03-26 18:43   ` Alexandre Ghiti
2024-03-26 18:55   ` Sami Tolvanen
2024-03-26 18:55     ` Sami Tolvanen
2024-03-26 19:56     ` Alexandre Ghiti
2024-03-26 19:56       ` Alexandre Ghiti
2024-03-27 12:52       ` Daniel Díaz
2024-03-27 12:52         ` Daniel Díaz
2024-03-26 18:49 ` Conor Dooley
2024-03-26 18:49   ` Conor Dooley
2024-03-27 14:00 ` patchwork-bot+linux-riscv
2024-03-27 14:00   ` patchwork-bot+linux-riscv

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.