From: guoren@kernel.org
To: guoren@kernel.org, palmer@dabbelt.com, arnd@arndb.de,
gregkh@linuxfoundation.org, hch@lst.de, nathan@kernel.org,
naresh.kamboju@linaro.org
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org,
sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-parisc@vger.kernel.org, linux-mips@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, x86@kernel.org,
heiko@sntech.de, Guo Ren <guoren@linux.alibaba.com>,
Helge Deller <deller@gmx.de>
Subject: [PATCH V12 05/20] fs: stat: compat: Add __ARCH_WANT_COMPAT_STAT
Date: Tue, 5 Apr 2022 15:12:59 +0800 [thread overview]
Message-ID: <20220405071314.3225832-6-guoren@kernel.org> (raw)
In-Reply-To: <20220405071314.3225832-1-guoren@kernel.org>
From: Guo Ren <guoren@linux.alibaba.com>
RISC-V doesn't neeed compat_stat, so using __ARCH_WANT_COMPAT_STAT
to exclude unnecessary SYSCALL functions.
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Helge Deller <deller@gmx.de> # parisc
Cc: Palmer Dabbelt <palmer@dabbelt.com>
---
arch/arm64/include/asm/unistd.h | 1 +
arch/mips/include/asm/unistd.h | 2 ++
arch/parisc/include/asm/unistd.h | 1 +
arch/powerpc/include/asm/unistd.h | 1 +
arch/s390/include/asm/unistd.h | 1 +
arch/sparc/include/asm/unistd.h | 1 +
arch/x86/include/asm/unistd.h | 1 +
fs/stat.c | 2 +-
8 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 4e65da3445c7..037feba03a51 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -3,6 +3,7 @@
* Copyright (C) 2012 ARM Ltd.
*/
#ifdef CONFIG_COMPAT
+#define __ARCH_WANT_COMPAT_STAT
#define __ARCH_WANT_COMPAT_STAT64
#define __ARCH_WANT_SYS_GETHOSTNAME
#define __ARCH_WANT_SYS_PAUSE
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h
index c2196b1b6604..25a5253db7f4 100644
--- a/arch/mips/include/asm/unistd.h
+++ b/arch/mips/include/asm/unistd.h
@@ -50,6 +50,8 @@
# ifdef CONFIG_32BIT
# define __ARCH_WANT_STAT64
# define __ARCH_WANT_SYS_TIME32
+# else
+# define __ARCH_WANT_COMPAT_STAT
# endif
# ifdef CONFIG_MIPS32_O32
# define __ARCH_WANT_SYS_TIME32
diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h
index 7708a5806f09..81cbad73b517 100644
--- a/arch/parisc/include/asm/unistd.h
+++ b/arch/parisc/include/asm/unistd.h
@@ -164,6 +164,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_CLONE3
#define __ARCH_WANT_COMPAT_SYS_SENDFILE
+#define __ARCH_WANT_COMPAT_STAT
#ifdef CONFIG_64BIT
#define __ARCH_WANT_SYS_TIME
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h
index 5eb462af6766..b1129b4ef57d 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -44,6 +44,7 @@
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_SYS_NEWFSTATAT
+#define __ARCH_WANT_COMPAT_STAT
#define __ARCH_WANT_COMPAT_SYS_SENDFILE
#endif
#define __ARCH_WANT_SYS_FORK
diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h
index 9e9f75ef046a..4260bc5ce7f8 100644
--- a/arch/s390/include/asm/unistd.h
+++ b/arch/s390/include/asm/unistd.h
@@ -28,6 +28,7 @@
#define __ARCH_WANT_SYS_SIGPENDING
#define __ARCH_WANT_SYS_SIGPROCMASK
# ifdef CONFIG_COMPAT
+# define __ARCH_WANT_COMPAT_STAT
# define __ARCH_WANT_SYS_TIME32
# define __ARCH_WANT_SYS_UTIME32
# endif
diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h
index 1e66278ba4a5..d6bc76706a7a 100644
--- a/arch/sparc/include/asm/unistd.h
+++ b/arch/sparc/include/asm/unistd.h
@@ -46,6 +46,7 @@
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_COMPAT_SYS_SENDFILE
+#define __ARCH_WANT_COMPAT_STAT
#endif
#ifdef __32bit_syscall_numbers__
diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h
index 80e9d5206a71..761173ccc33c 100644
--- a/arch/x86/include/asm/unistd.h
+++ b/arch/x86/include/asm/unistd.h
@@ -22,6 +22,7 @@
# include <asm/unistd_32_ia32.h>
# define __ARCH_WANT_SYS_TIME
# define __ARCH_WANT_SYS_UTIME
+# define __ARCH_WANT_COMPAT_STAT
# define __ARCH_WANT_COMPAT_SYS_PREADV64
# define __ARCH_WANT_COMPAT_SYS_PWRITEV64
# define __ARCH_WANT_COMPAT_SYS_PREADV64V2
diff --git a/fs/stat.c b/fs/stat.c
index 7f734be0e57e..5d8f723c1e0b 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -660,7 +660,7 @@ SYSCALL_DEFINE5(statx,
return ret;
}
-#ifdef CONFIG_COMPAT
+#if defined(CONFIG_COMPAT) && defined(__ARCH_WANT_COMPAT_STAT)
static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
{
struct compat_stat tmp;
--
2.25.1
next prev parent reply other threads:[~2022-04-05 7:15 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-05 7:12 [PATCH V12 00/20] riscv: Add COMPAT mode support for 64BIT guoren
2022-04-05 7:12 ` [PATCH V12 01/20] uapi: simplify __ARCH_FLOCK{,64}_PAD a little guoren
2022-07-15 3:13 ` Florian Fainelli
2022-04-05 7:12 ` [PATCH V12 02/20] uapi: always define F_GETLK64/F_SETLK64/F_SETLKW64 in fcntl.h guoren
2022-06-08 9:41 ` Eugene Syromiatnikov
2022-06-13 1:15 ` Guo Ren
2022-04-05 7:12 ` [PATCH V12 03/20] compat: consolidate the compat_flock{,64} definition guoren
2022-04-05 7:12 ` [PATCH V12 04/20] arch: Add SYSVIPC_COMPAT for all architectures guoren
2022-04-05 7:12 ` guoren [this message]
2022-04-05 7:13 ` [PATCH V12 06/20] asm-generic: compat: Cleanup duplicate definitions guoren
2022-04-05 7:13 ` [PATCH V12 07/20] syscalls: compat: Fix the missing part for __SYSCALL_COMPAT guoren
2022-04-05 7:13 ` [PATCH V12 08/20] riscv: Fixup difference with defconfig guoren
2022-04-05 7:13 ` [PATCH V12 09/20] riscv: compat: Add basic compat data type implementation guoren
2022-04-05 7:13 ` [PATCH V12 10/20] riscv: compat: Support TASK_SIZE for compat mode guoren
2022-04-05 7:13 ` [PATCH V12 11/20] riscv: compat: syscall: Add compat_sys_call_table implementation guoren
2022-04-05 7:13 ` [PATCH V12 12/20] riscv: compat: syscall: Add entry.S implementation guoren
2022-04-05 7:13 ` [PATCH V12 13/20] riscv: compat: process: Add UXL_32 support in start_thread guoren
2022-04-05 7:13 ` [PATCH V12 14/20] riscv: compat: Add elf.h implementation guoren
2022-04-05 7:13 ` [PATCH V12 15/20] riscv: compat: Add hw capability check for elf guoren
2022-04-05 7:13 ` [PATCH V12 16/20] riscv: compat: vdso: Add COMPAT_VDSO base code implementation guoren
2022-04-05 7:13 ` [PATCH V12 17/20] riscv: compat: vdso: Add setup additional pages implementation guoren
2022-04-05 7:13 ` [PATCH V12 18/20] riscv: compat: signal: Add rt_frame implementation guoren
2022-04-05 7:13 ` [PATCH V12 19/20] riscv: compat: ptrace: Add compat_arch_ptrace implement guoren
2022-04-05 7:13 ` [PATCH V12 20/20] riscv: compat: Add COMPAT Kbuild skeletal support guoren
2022-04-28 12:25 ` [PATCH V12 00/20] riscv: Add COMPAT mode support for 64BIT Guo Ren
2022-04-28 18:22 ` Palmer Dabbelt
2022-04-30 5:43 ` Guo Ren
2022-05-19 17:50 ` Palmer Dabbelt
2022-05-20 18:18 ` Guo Ren
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=20220405071314.3225832-6-guoren@kernel.org \
--to=guoren@kernel.org \
--cc=arnd@arndb.de \
--cc=deller@gmx.de \
--cc=gregkh@linuxfoundation.org \
--cc=guoren@linux.alibaba.com \
--cc=hch@lst.de \
--cc=heiko@sntech.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=naresh.kamboju@linaro.org \
--cc=nathan@kernel.org \
--cc=palmer@dabbelt.com \
--cc=sparclinux@vger.kernel.org \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).