From: "Dmitry V. Levin" <ldv@altlinux.org> To: Palmer Dabbelt <palmer@sifive.com> Cc: Elvira Khabirova <lineprinter@altlinux.org>, Eugene Syromyatnikov <esyr@redhat.com>, Oleg Nesterov <oleg@redhat.com>, Andy Lutomirski <luto@kernel.org>, Albert Ou <aou@eecs.berkeley.edu>, Paul Moore <paul@paul-moore.com>, Eric Paris <eparis@redhat.com>, linux-riscv@lists.infradead.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH v5 17/25] riscv: define syscall_get_arch() Date: Mon, 10 Dec 2018 07:30:31 +0300 [thread overview] Message-ID: <20181210043031.GQ6131@altlinux.org> (raw) In-Reply-To: 20181210042352.GA6092@altlinux.org syscall_get_arch() is required to be implemented on all architectures in addition to already implemented syscall_get_nr(), syscall_get_arguments(), syscall_get_error(), and syscall_get_return_value() functions in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Based-on-patch-by: David Abdurachmanov <david.abdurachmanov@gmail.com> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Cc: Elvira Khabirova <lineprinter@altlinux.org> Cc: Eugene Syromyatnikov <esyr@redhat.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Paul Moore <paul@paul-moore.com> Cc: Eric Paris <eparis@redhat.com> Cc: linux-riscv@lists.infradead.org Cc: linux-audit@redhat.com Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> --- Notes: v5: added Cc v2: added Reviewed-by arch/riscv/include/asm/syscall.h | 10 ++++++++++ include/uapi/linux/audit.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/arch/riscv/include/asm/syscall.h b/arch/riscv/include/asm/syscall.h index 8d25f8904c00..bba3da6ef157 100644 --- a/arch/riscv/include/asm/syscall.h +++ b/arch/riscv/include/asm/syscall.h @@ -18,6 +18,7 @@ #ifndef _ASM_RISCV_SYSCALL_H #define _ASM_RISCV_SYSCALL_H +#include <uapi/linux/audit.h> #include <linux/sched.h> #include <linux/err.h> @@ -99,4 +100,13 @@ static inline void syscall_set_arguments(struct task_struct *task, memcpy(®s->a1 + i * sizeof(regs->a1), args, n * sizeof(regs->a0)); } +static inline int syscall_get_arch(void) +{ +#ifdef CONFIG_64BIT + return AUDIT_ARCH_RISCV64; +#else + return AUDIT_ARCH_RISCV32; +#endif +} + #endif /* _ASM_RISCV_SYSCALL_H */ diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index 883c5f56be9c..1e9808f3a240 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h @@ -411,6 +411,8 @@ enum { /* do not define AUDIT_ARCH_PPCLE since it is not supported by audit */ #define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT) #define AUDIT_ARCH_PPC64LE (EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) +#define AUDIT_ARCH_RISCV32 (EM_RISCV|__AUDIT_ARCH_LE) +#define AUDIT_ARCH_RISCV64 (EM_RISCV|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) #define AUDIT_ARCH_S390 (EM_S390) #define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT) #define AUDIT_ARCH_SH (EM_SH) -- ldv
WARNING: multiple messages have this Message-ID (diff)
From: "Dmitry V. Levin" <ldv@altlinux.org> To: Palmer Dabbelt <palmer@sifive.com> Cc: Albert Ou <aou@eecs.berkeley.edu>, Paul Moore <paul@paul-moore.com>, linux-kernel@vger.kernel.org, Eugene Syromyatnikov <esyr@redhat.com>, Eric Paris <eparis@redhat.com>, Oleg Nesterov <oleg@redhat.com>, Elvira Khabirova <lineprinter@altlinux.org>, Andy Lutomirski <luto@kernel.org>, linux-audit@redhat.com, linux-riscv@lists.infradead.org Subject: [PATCH v5 17/25] riscv: define syscall_get_arch() Date: Mon, 10 Dec 2018 07:30:31 +0300 [thread overview] Message-ID: <20181210043031.GQ6131@altlinux.org> (raw) In-Reply-To: 20181210042352.GA6092@altlinux.org syscall_get_arch() is required to be implemented on all architectures in addition to already implemented syscall_get_nr(), syscall_get_arguments(), syscall_get_error(), and syscall_get_return_value() functions in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Based-on-patch-by: David Abdurachmanov <david.abdurachmanov@gmail.com> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Cc: Elvira Khabirova <lineprinter@altlinux.org> Cc: Eugene Syromyatnikov <esyr@redhat.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Paul Moore <paul@paul-moore.com> Cc: Eric Paris <eparis@redhat.com> Cc: linux-riscv@lists.infradead.org Cc: linux-audit@redhat.com Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> --- Notes: v5: added Cc v2: added Reviewed-by arch/riscv/include/asm/syscall.h | 10 ++++++++++ include/uapi/linux/audit.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/arch/riscv/include/asm/syscall.h b/arch/riscv/include/asm/syscall.h index 8d25f8904c00..bba3da6ef157 100644 --- a/arch/riscv/include/asm/syscall.h +++ b/arch/riscv/include/asm/syscall.h @@ -18,6 +18,7 @@ #ifndef _ASM_RISCV_SYSCALL_H #define _ASM_RISCV_SYSCALL_H +#include <uapi/linux/audit.h> #include <linux/sched.h> #include <linux/err.h> @@ -99,4 +100,13 @@ static inline void syscall_set_arguments(struct task_struct *task, memcpy(®s->a1 + i * sizeof(regs->a1), args, n * sizeof(regs->a0)); } +static inline int syscall_get_arch(void) +{ +#ifdef CONFIG_64BIT + return AUDIT_ARCH_RISCV64; +#else + return AUDIT_ARCH_RISCV32; +#endif +} + #endif /* _ASM_RISCV_SYSCALL_H */ diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index 883c5f56be9c..1e9808f3a240 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h @@ -411,6 +411,8 @@ enum { /* do not define AUDIT_ARCH_PPCLE since it is not supported by audit */ #define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT) #define AUDIT_ARCH_PPC64LE (EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) +#define AUDIT_ARCH_RISCV32 (EM_RISCV|__AUDIT_ARCH_LE) +#define AUDIT_ARCH_RISCV64 (EM_RISCV|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) #define AUDIT_ARCH_S390 (EM_S390) #define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT) #define AUDIT_ARCH_SH (EM_SH) -- ldv _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2018-12-10 4:30 UTC|newest] Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-12-10 4:23 [PATCH v5 00/25] ptrace: add PTRACE_GET_SYSCALL_INFO request Dmitry V. Levin 2018-12-10 4:23 ` Dmitry V. Levin 2018-12-10 4:23 ` Dmitry V. Levin 2018-12-10 4:23 ` [OpenRISC] " Dmitry V. Levin 2018-12-10 4:23 ` Dmitry V. Levin 2018-12-10 4:23 ` Dmitry V. Levin 2018-12-10 4:23 ` Dmitry V. Levin 2018-12-10 4:27 ` [PATCH v5 01/25] alpha: define remaining syscall_get_* functions Dmitry V. Levin 2018-12-10 4:28 ` [PATCH v5 02/25] Move EM_ARCOMPACT and EM_ARCV2 to uapi/linux/elf-em.h Dmitry V. Levin 2018-12-10 4:28 ` Dmitry V. Levin 2018-12-10 4:29 ` [PATCH v5 03/25] arc: define syscall_get_arch() Dmitry V. Levin 2018-12-10 4:29 ` Dmitry V. Levin 2018-12-10 4:29 ` [PATCH v5 04/25] c6x: " Dmitry V. Levin 2018-12-11 22:40 ` Mark Salter 2018-12-10 4:29 ` [PATCH v5 05/25] elf-em.h: add EM_CSKY Dmitry V. Levin 2018-12-10 4:29 ` [PATCH v5 06/25] csky: define syscall_get_arch() Dmitry V. Levin 2018-12-10 4:29 ` [PATCH v5 07/25] h8300: define remaining syscall_get_* functions Dmitry V. Levin 2018-12-10 4:29 ` [PATCH v5 08/25] Move EM_HEXAGON to uapi/linux/elf-em.h Dmitry V. Levin 2018-12-10 4:29 ` [PATCH v5 09/25] hexagon: define remaining syscall_get_* functions Dmitry V. Levin 2018-12-10 4:29 ` [PATCH v5 10/25] Move EM_NDS32 to uapi/linux/elf-em.h Dmitry V. Levin 2018-12-10 4:29 ` [PATCH v5 11/25] nds32: define syscall_get_arch() Dmitry V. Levin 2018-12-10 4:30 ` [PATCH v5 12/25] nios2: " Dmitry V. Levin 2018-12-10 4:30 ` [PATCH v5 13/25] m68k: add asm/syscall.h Dmitry V. Levin 2018-12-10 8:45 ` Geert Uytterhoeven 2018-12-10 12:40 ` Dmitry V. Levin 2018-12-10 13:06 ` Geert Uytterhoeven 2018-12-10 13:30 ` Dmitry V. Levin 2018-12-12 8:55 ` Dmitry V. Levin 2018-12-12 9:01 ` Geert Uytterhoeven 2018-12-12 9:27 ` Dmitry V. Levin 2018-12-12 9:43 ` Geert Uytterhoeven 2018-12-12 12:04 ` Dmitry V. Levin 2018-12-12 12:27 ` Geert Uytterhoeven 2018-12-12 12:37 ` Dmitry V. Levin 2018-12-12 12:54 ` Geert Uytterhoeven 2018-12-12 13:07 ` Dmitry V. Levin 2018-12-12 23:12 ` Dmitry V. Levin 2019-03-29 22:04 ` Dmitry V. Levin 2019-03-30 20:57 ` Geert Uytterhoeven 2018-12-10 4:30 ` [PATCH v5 14/25] mips: define syscall_get_error() Dmitry V. Levin 2018-12-10 4:30 ` [PATCH v5 15/25] parisc: " Dmitry V. Levin 2018-12-10 4:30 ` [PATCH v5 16/25] powerpc: " Dmitry V. Levin 2018-12-10 4:30 ` Dmitry V. Levin 2018-12-10 4:30 ` Dmitry V. Levin [this message] 2018-12-10 4:30 ` [PATCH v5 17/25] riscv: define syscall_get_arch() Dmitry V. Levin 2018-12-10 4:30 ` [PATCH v5 18/25] Move EM_XTENSA to uapi/linux/elf-em.h Dmitry V. Levin 2018-12-10 4:30 ` [PATCH v5 19/25] xtensa: define syscall_get_* functions Dmitry V. Levin 2018-12-10 5:02 ` Max Filippov 2018-12-10 12:53 ` Dmitry V. Levin 2018-12-10 20:14 ` Max Filippov 2018-12-10 20:24 ` Dmitry V. Levin 2018-12-10 20:30 ` Dmitry V. Levin 2018-12-10 21:29 ` Max Filippov 2018-12-12 10:45 ` kbuild test robot 2018-12-19 5:58 ` kbuild test robot 2018-12-10 4:30 ` [PATCH v5 20/25] Move EM_UNICORE to uapi/linux/elf-em.h Dmitry V. Levin 2018-12-10 4:30 ` [PATCH v5 21/25] unicore32: add asm/syscall.h Dmitry V. Levin 2018-12-10 4:31 ` [PATCH v5 22/25] syscall_get_arch: add "struct task_struct *" argument Dmitry V. Levin 2018-12-10 4:31 ` [OpenRISC] " Dmitry V. Levin 2018-12-10 4:31 ` Dmitry V. Levin 2018-12-10 4:31 ` Dmitry V. Levin 2018-12-10 4:31 ` Dmitry V. Levin 2018-12-10 4:31 ` Dmitry V. Levin 2018-12-10 4:31 ` Dmitry V. Levin 2018-12-10 17:29 ` Kees Cook 2018-12-11 22:44 ` Mark Salter 2018-12-10 4:31 ` [PATCH v5 23/25] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call Dmitry V. Levin 2018-12-10 4:31 ` Dmitry V. Levin 2018-12-10 4:31 ` [PATCH v5 24/25] ptrace: add PTRACE_GET_SYSCALL_INFO request Dmitry V. Levin 2018-12-10 4:31 ` Dmitry V. Levin 2018-12-10 14:11 ` Oleg Nesterov 2018-12-10 16:21 ` Dmitry V. Levin 2018-12-10 16:21 ` Dmitry V. Levin 2018-12-11 15:29 ` Oleg Nesterov 2018-12-11 16:23 ` Dmitry V. Levin 2018-12-11 16:23 ` Dmitry V. Levin 2018-12-11 20:27 ` Dmitry V. Levin 2018-12-12 18:00 ` Oleg Nesterov 2018-12-10 14:26 ` kbuild test robot 2018-12-10 16:09 ` Dmitry V. Levin 2018-12-10 16:09 ` Dmitry V. Levin 2018-12-10 18:04 ` Paul Burton 2018-12-10 21:04 ` Palmer Dabbelt 2018-12-10 19:38 ` Andy Lutomirski 2018-12-10 19:38 ` Andy Lutomirski 2018-12-10 17:44 ` Kees Cook 2018-12-12 9:28 ` kbuild test robot 2018-12-10 4:31 ` [PATCH v5 25/25] selftests/ptrace: add a test case for PTRACE_GET_SYSCALL_INFO Dmitry V. Levin 2018-12-10 4:31 ` Dmitry V. Levin 2018-12-10 4:31 ` ldv
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=20181210043031.GQ6131@altlinux.org \ --to=ldv@altlinux.org \ --cc=aou@eecs.berkeley.edu \ --cc=eparis@redhat.com \ --cc=esyr@redhat.com \ --cc=lineprinter@altlinux.org \ --cc=linux-audit@redhat.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-riscv@lists.infradead.org \ --cc=luto@kernel.org \ --cc=oleg@redhat.com \ --cc=palmer@sifive.com \ --cc=paul@paul-moore.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.