From: Mark Rutland <mark.rutland@arm.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Subject: Re: [bootwrapper PATCH 1/2] aarch64: Disable trapping into EL3 while accessing MDSELR_EL1
Date: Thu, 18 Apr 2024 11:27:36 +0100 [thread overview]
Message-ID: <ZiD1mP_nbvgOAmFs@FVFF77S0Q05N> (raw)
In-Reply-To: <20240404073726.947215-2-anshuman.khandual@arm.com>
On Thu, Apr 04, 2024 at 01:07:25PM +0530, Anshuman Khandual wrote:
> This disables trapping into EL3 while accessing MDSELR_EL1 either in EL1 or
> EL2 via setting MDCR_EL3.EBWE. But first ensure that FEAT_Debugv8p9 feature
> is implemented and enabled looking into ID_AA64DFR0_EL1.
The patch itself looks fine, but I'm going to reword the commit message for clarity:
| aarch64: Enable access to MDSELR_EL1 from EL2 and below
|
| FEAT_Debugv8p9 adds a new MDSELR_EL1 register to select between banks of
| breakpoints and watchpoints. Accesses to MDSELR_EL1 from EL2 and below trap
| to EL3 unless MDCR_EL3.EBWE is set.
|
| Enable access to MDSELR_EL1 when it is implemented.
Mark.
>
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> arch/aarch64/include/asm/cpu.h | 2 ++
> arch/aarch64/init.c | 3 +++
> 2 files changed, 5 insertions(+)
>
> diff --git a/arch/aarch64/include/asm/cpu.h b/arch/aarch64/include/asm/cpu.h
> index d1f8fd9..124ef91 100644
> --- a/arch/aarch64/include/asm/cpu.h
> +++ b/arch/aarch64/include/asm/cpu.h
> @@ -41,6 +41,7 @@
> #define MDCR_EL3_NSTB_NS_NOTRAP (UL(3) << 24)
> #define MDCR_EL3_SBRBE_NOTRAP_NOPROHIBIT (UL(3) << 32)
> #define MDCR_EL3_ENPMSN BIT(36)
> +#define MDCR_EL3_EBWE BIT(43)
>
> #define SCR_EL3_RES1 BITS(5, 4)
> #define SCR_EL3_NS BIT(0)
> @@ -62,6 +63,7 @@
> #define ID_AA64DFR0_EL1_PMSVER BITS(35, 32)
> #define ID_AA64DFR0_EL1_TRACEBUFFER BITS(47, 44)
> #define ID_AA64DFR0_EL1_BRBE BITS(55, 52)
> +#define ID_AA64DFR0_EL1_DEBUGVER BITS(3, 0)
>
> #define ID_AA64ISAR0_EL1_TME BITS(27, 24)
>
> diff --git a/arch/aarch64/init.c b/arch/aarch64/init.c
> index c4e91e4..37cb45f 100644
> --- a/arch/aarch64/init.c
> +++ b/arch/aarch64/init.c
> @@ -105,6 +105,9 @@ void cpu_init_el3(void)
> if (mrs_field(ID_AA64DFR0_EL1, BRBE))
> mdcr |= MDCR_EL3_SBRBE_NOTRAP_NOPROHIBIT;
>
> + if (mrs_field(ID_AA64DFR0_EL1, DEBUGVER) >= 11)
> + mdcr |= MDCR_EL3_EBWE;
> +
> msr(MDCR_EL3, mdcr);
>
> if (mrs_field(ID_AA64PFR0_EL1, SVE)) {
> --
> 2.25.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-04-18 10:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-04 7:37 [bootwrapper PATCH 0/2] aarch64: Prepare EL3 for MDSELR_EL1 Anshuman Khandual
2024-04-04 7:37 ` [bootwrapper PATCH 1/2] aarch64: Disable trapping into EL3 while accessing MDSELR_EL1 Anshuman Khandual
2024-04-18 10:27 ` Mark Rutland [this message]
2024-04-19 2:21 ` Anshuman Khandual
2024-04-04 7:37 ` [bootwrapper PATCH 2/2] aarch64: Disable trapping into EL3 while accessing FEAT_FGT2 registers Anshuman Khandual
2024-04-18 10:40 ` Mark Rutland
2024-04-19 3:04 ` Anshuman Khandual
2024-04-17 3:25 ` [bootwrapper PATCH 0/2] aarch64: Prepare EL3 for MDSELR_EL1 Anshuman Khandual
2024-04-18 10:43 ` Mark Rutland
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=ZiD1mP_nbvgOAmFs@FVFF77S0Q05N \
--to=mark.rutland@arm.com \
--cc=anshuman.khandual@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.