linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: James Morse <james.morse@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH 6/8] arm64: entry: convert el0_sync to C
Date: Fri, 4 Oct 2019 13:57:49 +0100	[thread overview]
Message-ID: <20191004125746.GE34756@lakrids.cambridge.arm.com> (raw)
In-Reply-To: <20191003171642.135652-7-james.morse@arm.com>

On Thu, Oct 03, 2019 at 06:16:40PM +0100, James Morse wrote:
> From: Mark Rutland <mark.rutland@arm.com>
> 
> This is largely a 1-1 conversion of asm to C, with a couple of caveats.
> 
> The el0_sync{_compat} switches explicitly handle all the EL0 debug
> cases, so el0_dbg doesn't have to try to bail out for unexpected EL1
> debug ESR values. This also means that an unexpected vector catch from
> AArch32 is routed to el0_inv.
> 
> We *could* merge the native and compat switches, which would make the
> diffstat negative, but I've tried to stay as close to the existing
> assembly as possible for the moment.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> [split out of a bigger series, added nokprobes. removed irq trace
>  calls as the C helpers do this. renamed el0_dbg's use of FAR]
> Signed-off-by: James Morse <james.morse@arm.com>
> Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
> ---
>  arch/arm64/include/asm/asm-uaccess.h |  10 --
>  arch/arm64/kernel/entry-common.c     | 221 +++++++++++++++++++++++++++
>  arch/arm64/kernel/entry.S            | 206 +------------------------
>  3 files changed, 226 insertions(+), 211 deletions(-)

[...]

> +static void notrace el0_dbg(struct pt_regs *regs, unsigned long esr)
> +{
> +	unsigned long addr_if_watchpoint = read_sysreg(far_el1);
> +
> +	if (system_uses_irq_prio_masking())
> +		gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET);
> +
> +	user_exit_irqoff();
> +	do_debug_exception(addr_if_watchpoint, esr, regs);
> +	local_daif_restore(DAIF_PROCCTX_NOIRQ);
> +}
> +NOKPROBE_SYMBOL(el0_dbg);

I think that it'd be best to stick with 'far' here, and only have the
'addr_if_watchpoint' name within do_debug_exception(), where it used to
be 'addr'. That way all of this code consistently uses 'far'.

Otherwise this all looks good to me:

Reviewed-by: Mark Rutland <mark.rutland@arm.com>

Thanks for all the rework and cleanup!

Mark.

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

  reply	other threads:[~2019-10-04 12:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 17:16 [PATCH 0/8] arm64: Convert entry.S synchronous exception handling to C James Morse
2019-10-03 17:16 ` [PATCH 1/8] arm64: Fix incorrect irqflag restore for priority masking for compat James Morse
2019-10-03 17:16 ` [PATCH 2/8] arm64: remove __exception annotations James Morse
2019-10-04 10:17   ` Mark Rutland
2019-10-04 14:10     ` Masami Hiramatsu
2019-10-04 16:08       ` James Morse
2019-10-04 16:34         ` Mark Rutland
2019-10-04 13:03   ` Marc Gonzalez
2019-10-04 16:08     ` James Morse
2019-10-03 17:16 ` [PATCH 3/8] arm64: Add prototypes for functions called by entry.S James Morse
2019-10-04 10:22   ` Mark Rutland
2019-10-03 17:16 ` [PATCH 4/8] arm64: add local_daif_inherit() James Morse
2019-10-03 17:16 ` [PATCH 5/8] arm64: entry: convert el1_sync to C James Morse
2019-10-04 10:39   ` Mark Rutland
2019-10-03 17:16 ` [PATCH 6/8] arm64: entry: convert el0_sync " James Morse
2019-10-04 12:57   ` Mark Rutland [this message]
2019-10-04 16:09     ` James Morse
2019-10-04 16:37       ` Mark Rutland
2019-10-03 17:16 ` [PATCH 7/8] arm64: Remove asmlinkage from updated functions James Morse
2019-10-04 12:58   ` Mark Rutland
2019-10-03 17:16 ` [PATCH 8/8] arm64: entry-common: don't touch daif before bp-hardening James Morse
2019-10-04 13:31   ` Mark Rutland
2019-10-04 16:09     ` James Morse

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=20191004125746.GE34756@lakrids.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mhiramat@kernel.org \
    --cc=will@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).