From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 1/6] arm64: Add HAVE_REGS_AND_STACK_ACCESS_API feature
Date: Wed, 25 Mar 2015 13:44:10 +0000 [thread overview]
Message-ID: <20150325134410.GA26903@localhost> (raw)
In-Reply-To: <1424214701-4899-2-git-send-email-dave.long@linaro.org>
On Tue, Feb 17, 2015 at 06:11:36PM -0500, David Long wrote:
> diff --git a/arch/arm64/include/uapi/asm/ptrace.h b/arch/arm64/include/uapi/asm/ptrace.h
> index 6913643..700d28b 100644
> --- a/arch/arm64/include/uapi/asm/ptrace.h
> +++ b/arch/arm64/include/uapi/asm/ptrace.h
> @@ -61,6 +61,42 @@
>
> #ifndef __ASSEMBLY__
>
> +#define ARM_cpsr pstate
There is no CPSR on AArch64, it's just called PSTATE. But more
importantly, what's the point of all these macros?
> diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
> index d882b83..adc1f39 100644
> --- a/arch/arm64/kernel/ptrace.c
> +++ b/arch/arm64/kernel/ptrace.c
> @@ -48,6 +48,122 @@
> #define CREATE_TRACE_POINTS
> #include <trace/events/syscalls.h>
>
> +struct pt_regs_offset {
> + const char *name;
> + int offset;
> +};
> +
> +#define REG_OFFSET_NAME(r) \
> + {.name = #r, .offset = offsetof(struct pt_regs, ARM_##r)}
> +#define REG_OFFSET_END {.name = NULL, .offset = 0}
> +
> +static const struct pt_regs_offset regoffset_table[] = {
> + REG_OFFSET_NAME(x0),
If it is just for defining a name, just change the REG_OFFSET_NAME macro
to take a string argument and remove all the ARM_ macros.
I'm also not sure why we need the ARM_ prefix. Do you see them used
outside the arm64 context?
--
Catalin
WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: David Long <dave.long@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
Russell King <linux@arm.linux.org.uk>,
"Jon Medhurst (Tixy)" <tixy@linaro.org>,
Steve Capper <steve.capper@linaro.org>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Sandeepa Prabhu <sandeepa.prabhu@linaro.org>,
Will Deacon <will.deacon@arm.com>,
linux-kernel@vger.kernel.org,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
William Cohen <wcohen@redhat.com>,
davem@davemloft.net
Subject: Re: [PATCH v5 1/6] arm64: Add HAVE_REGS_AND_STACK_ACCESS_API feature
Date: Wed, 25 Mar 2015 13:44:10 +0000 [thread overview]
Message-ID: <20150325134410.GA26903@localhost> (raw)
In-Reply-To: <1424214701-4899-2-git-send-email-dave.long@linaro.org>
On Tue, Feb 17, 2015 at 06:11:36PM -0500, David Long wrote:
> diff --git a/arch/arm64/include/uapi/asm/ptrace.h b/arch/arm64/include/uapi/asm/ptrace.h
> index 6913643..700d28b 100644
> --- a/arch/arm64/include/uapi/asm/ptrace.h
> +++ b/arch/arm64/include/uapi/asm/ptrace.h
> @@ -61,6 +61,42 @@
>
> #ifndef __ASSEMBLY__
>
> +#define ARM_cpsr pstate
There is no CPSR on AArch64, it's just called PSTATE. But more
importantly, what's the point of all these macros?
> diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
> index d882b83..adc1f39 100644
> --- a/arch/arm64/kernel/ptrace.c
> +++ b/arch/arm64/kernel/ptrace.c
> @@ -48,6 +48,122 @@
> #define CREATE_TRACE_POINTS
> #include <trace/events/syscalls.h>
>
> +struct pt_regs_offset {
> + const char *name;
> + int offset;
> +};
> +
> +#define REG_OFFSET_NAME(r) \
> + {.name = #r, .offset = offsetof(struct pt_regs, ARM_##r)}
> +#define REG_OFFSET_END {.name = NULL, .offset = 0}
> +
> +static const struct pt_regs_offset regoffset_table[] = {
> + REG_OFFSET_NAME(x0),
If it is just for defining a name, just change the REG_OFFSET_NAME macro
to take a string argument and remove all the ARM_ macros.
I'm also not sure why we need the ARM_ prefix. Do you see them used
outside the arm64 context?
--
Catalin
next prev parent reply other threads:[~2015-03-25 13:44 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-17 23:11 [PATCH v5 0/6] arm64: Add kernel probes (kprobes) support David Long
2015-02-17 23:11 ` David Long
2015-02-17 23:11 ` [PATCH v5 1/6] arm64: Add HAVE_REGS_AND_STACK_ACCESS_API feature David Long
2015-02-17 23:11 ` David Long
2015-02-18 14:59 ` Masami Hiramatsu
2015-02-18 14:59 ` Masami Hiramatsu
2015-03-25 13:44 ` Catalin Marinas [this message]
2015-03-25 13:44 ` Catalin Marinas
2015-04-20 7:15 ` David Long
2015-04-20 7:15 ` David Long
2015-02-17 23:11 ` [PATCH v5 2/6] arm64: Add more test functions to insn.c David Long
2015-02-17 23:11 ` David Long
2015-02-18 15:00 ` Masami Hiramatsu
2015-02-18 15:00 ` Masami Hiramatsu
2015-02-17 23:11 ` [PATCH v5 3/6] arm64: Kprobes with single stepping support David Long
2015-02-17 23:11 ` David Long
2015-02-18 14:59 ` Masami Hiramatsu
2015-02-18 14:59 ` Masami Hiramatsu
2015-02-27 6:38 ` David Long
2015-02-27 6:38 ` David Long
2015-02-27 8:27 ` Masami Hiramatsu
2015-02-27 8:27 ` Masami Hiramatsu
2015-04-08 6:07 ` Pratyush Anand
2015-04-08 6:07 ` Pratyush Anand
2015-04-08 11:01 ` David Long
2015-04-08 11:01 ` David Long
2015-02-17 23:11 ` [PATCH v5 4/6] arm64: kprobes instruction simulation support David Long
2015-02-17 23:11 ` David Long
2015-03-06 11:39 ` Steve Capper
2015-03-06 11:39 ` Steve Capper
2015-03-06 14:42 ` David Long
2015-03-06 14:42 ` David Long
2015-02-17 23:11 ` [PATCH v5 5/6] arm64: Add kernel return probes support (kretprobes) David Long
2015-02-17 23:11 ` David Long
2015-02-19 14:49 ` Masami Hiramatsu
2015-02-19 14:49 ` Masami Hiramatsu
2015-02-17 23:11 ` [PATCH v5 6/6] kprobes: Add arm64 case in kprobe example module David Long
2015-02-17 23:11 ` David Long
2015-02-19 14:18 ` Masami Hiramatsu
2015-02-19 14:18 ` Masami Hiramatsu
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=20150325134410.GA26903@localhost \
--to=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.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 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.