arm64: wire up cachestat for arm64

Message ID 20230511092843.3896327-1-nphamcs@gmail.com
State New
Headers
Series arm64: wire up cachestat for arm64 |

Commit Message

Nhat Pham May 11, 2023, 9:28 a.m. UTC
  cachestat is a new syscall that was previously wired in for most
architectures:

https://lore.kernel.org/lkml/20230503013608.2431726-1-nphamcs@gmail.com/
https://lore.kernel.org/linux-mm/20230510195806.2902878-1-nphamcs@gmail.com/

However, those patches miss arm64, which has its own syscall table in arch/arm64.
This patch wires cachestat in for arm64.

Signed-off-by: Nhat Pham <nphamcs@gmail.com>
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm64/include/asm/unistd.h   | 2 +-
 arch/arm64/include/asm/unistd32.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
  

Comments

Arnd Bergmann May 11, 2023, 10:29 a.m. UTC | #1
On Thu, May 11, 2023, at 11:28, Nhat Pham wrote:
> cachestat is a new syscall that was previously wired in for most
> architectures:
>
> https://lore.kernel.org/lkml/20230503013608.2431726-1-nphamcs@gmail.com/
> https://lore.kernel.org/linux-mm/20230510195806.2902878-1-nphamcs@gmail.com/
>
> However, those patches miss arm64, which has its own syscall table in 
> arch/arm64.
> This patch wires cachestat in for arm64.
>
> Signed-off-by: Nhat Pham <nphamcs@gmail.com>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Suggested-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
  
Catalin Marinas May 12, 2023, 10:42 a.m. UTC | #2
On Thu, May 11, 2023 at 02:28:43AM -0700, Nhat Pham wrote:
> cachestat is a new syscall that was previously wired in for most
> architectures:
> 
> https://lore.kernel.org/lkml/20230503013608.2431726-1-nphamcs@gmail.com/
> https://lore.kernel.org/linux-mm/20230510195806.2902878-1-nphamcs@gmail.com/
> 
> However, those patches miss arm64, which has its own syscall table in arch/arm64.
> This patch wires cachestat in for arm64.

You may want to clarify that this is for compat support on arm64,
otherwise native support uses the generic syscall numbers already.

> 
> Signed-off-by: Nhat Pham <nphamcs@gmail.com>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Suggested-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
  
Andrew Morton May 12, 2023, 9:15 p.m. UTC | #3
On Fri, 12 May 2023 11:42:26 +0100 Catalin Marinas <catalin.marinas@arm.com> wrote:

> On Thu, May 11, 2023 at 02:28:43AM -0700, Nhat Pham wrote:
> > cachestat is a new syscall that was previously wired in for most
> > architectures:
> > 
> > https://lore.kernel.org/lkml/20230503013608.2431726-1-nphamcs@gmail.com/
> > https://lore.kernel.org/linux-mm/20230510195806.2902878-1-nphamcs@gmail.com/
> > 
> > However, those patches miss arm64, which has its own syscall table in arch/arm64.
> > This patch wires cachestat in for arm64.
> 
> You may want to clarify that this is for compat support on arm64,
> otherwise native support uses the generic syscall numbers already.

Thanks, I updated the changelog thusly.  Note that this patch is
transitory - it will be squashed into "cachestat: wire up cachestat for
other architectures".
  
Nhat Pham May 12, 2023, 9:47 p.m. UTC | #4
On Fri, May 12, 2023 at 2:15 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Fri, 12 May 2023 11:42:26 +0100 Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> > On Thu, May 11, 2023 at 02:28:43AM -0700, Nhat Pham wrote:
> > > cachestat is a new syscall that was previously wired in for most
> > > architectures:
> > >
> > > https://lore.kernel.org/lkml/20230503013608.2431726-1-nphamcs@gmail.com/
> > > https://lore.kernel.org/linux-mm/20230510195806.2902878-1-nphamcs@gmail.com/
> > >
> > > However, those patches miss arm64, which has its own syscall table in arch/arm64.
> > > This patch wires cachestat in for arm64.
> >
> > You may want to clarify that this is for compat support on arm64,
> > otherwise native support uses the generic syscall numbers already.
>
> Thanks, I updated the changelog thusly.  Note that this patch is
> transitory - it will be squashed into "cachestat: wire up cachestat for
> other architectures".

It's my expectation too - it makes sense to squash it to the other patch.
Thanks, Andrew!
  

Patch

diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 037feba03a51..64a514f90131 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -39,7 +39,7 @@ 
 #define __ARM_NR_compat_set_tls		(__ARM_NR_COMPAT_BASE + 5)
 #define __ARM_NR_COMPAT_END		(__ARM_NR_COMPAT_BASE + 0x800)
 
-#define __NR_compat_syscalls		451
+#define __NR_compat_syscalls		452
 #endif
 
 #define __ARCH_WANT_SYS_CLONE
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h
index 604a2053d006..d952a28463e0 100644
--- a/arch/arm64/include/asm/unistd32.h
+++ b/arch/arm64/include/asm/unistd32.h
@@ -907,6 +907,8 @@  __SYSCALL(__NR_process_mrelease, sys_process_mrelease)
 __SYSCALL(__NR_futex_waitv, sys_futex_waitv)
 #define __NR_set_mempolicy_home_node 450
 __SYSCALL(__NR_set_mempolicy_home_node, sys_set_mempolicy_home_node)
+#define __NR_cachestat 451
+__SYSCALL(__NR_cachestat, sys_cachestat)
 
 /*
  * Please add new compat syscalls above this comment and update