From: f.fainelli@gmail.com (Florian Fainelli)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/6] arm: Add icache invalidation on switch_mm for Cortex-A15
Date: Tue, 9 Jan 2018 17:28:53 -0800	[thread overview]
Message-ID: <a11193e5-0f0b-3280-e2b2-c0665676d230@gmail.com> (raw)
In-Reply-To: <20180108185533.9698-5-marc.zyngier@arm.com>
On 01/08/2018 10:55 AM, Marc Zyngier wrote:
> In order to avoid aliasing attacks against the branch predictor,
> Cortex-A15 require to invalidate the BTB when switching
> from one user context to another. The only way to do so on this
> CPU is to perform an ICIALLU, having set ACTLR[0] to 1 from secure
> mode.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
[snip]
> diff --git a/arch/arm/mm/proc-v7-3level.S b/arch/arm/mm/proc-v7-3level.S
> index f6adfe88ead2..0a2245b309e5 100644
> --- a/arch/arm/mm/proc-v7-3level.S
> +++ b/arch/arm/mm/proc-v7-3level.S
> @@ -71,6 +71,22 @@ ENTRY(cpu_v7_switch_mm)
>  ENDPROC(cpu_v7_switch_mm)
>  ENDPROC(cpu_v7_btbinv_switch_mm)
>  
> +/*
> + *	Cortex-A15 requires ACTLR[0] to be set from secure in order
> + *	for the icache invalidation to also invalidate the BTB.
Considering that writes are ignored when we don't have the correct
permission level, how about set try to set this bit from the
__v7_ca15mp_setup and __v7_b15mp_setup labels just like we are setting
the SMP_EN bit for the poor bastards out there stuck with possibly
frozen bootloaders/ATF?
-- 
Florian
next prev parent reply	other threads:[~2018-01-10  1:28 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08 18:55 [PATCH v2 0/6] ARM branch predictor hardening Marc Zyngier
2018-01-08 18:55 ` [PATCH v2 1/6] arm: Add BTB invalidation on switch_mm for Cortex-A9, A12 and A17 Marc Zyngier
2018-01-09 14:14   ` Andre Przywara
2018-01-09 14:21     ` Marc Zyngier
2018-01-09 14:22       ` Marc Zyngier
2018-01-10 17:53   ` Tony Lindgren
2018-01-10 17:57     ` Marc Zyngier
2018-01-10 21:52       ` Nishanth Menon
2018-01-11  9:03         ` Marc Zyngier
2018-01-29 18:41           ` Fabio Estevam
2018-01-29 19:21             ` Fabio Estevam
2018-01-29 19:28               ` Fabio Estevam
2018-01-08 18:55 ` [PATCH v2 2/6] arm: Invalidate BTB on prefetch abort outside of user mapping on Cortex A8, A9, " Marc Zyngier
2018-01-09  9:56   ` Marc Zyngier
2018-01-10 16:45   ` Russell King - ARM Linux
2018-01-08 18:55 ` [PATCH v2 3/6] arm: KVM: Invalidate BTB on guest exit Marc Zyngier
2018-01-15 12:22   ` Robin Murphy
2018-01-23 14:22   ` Christoffer Dall
2018-01-23 14:38     ` Marc Zyngier
2018-01-08 18:55 ` [PATCH v2 4/6] arm: Add icache invalidation on switch_mm for Cortex-A15 Marc Zyngier
2018-01-10  1:28   ` Florian Fainelli [this message]
2018-01-10  1:33     ` André Przywara
2018-01-10  1:35       ` Florian Fainelli
2018-01-10  9:13         ` Andre Przywara
2018-01-08 18:55 ` [PATCH v2 5/6] arm: Invalidate icache on prefetch abort outside of user mapping on Cortex-A15 Marc Zyngier
2018-01-08 18:55 ` [PATCH v2 6/6] arm: KVM: Invalidate icache on guest exit for Cortex-A15 Marc Zyngier
2018-01-23 14:26   ` Christoffer Dall
2018-01-09 17:13 ` [PATCH v2 0/6] ARM branch predictor hardening Florian Fainelli
2018-01-09 17:46   ` Russell King - ARM Linux
2018-01-10 16:50 ` Nishanth Menon
2018-01-10 17:16   ` Marc Zyngier
2018-01-10 22:59 ` Nishanth Menon
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=a11193e5-0f0b-3280-e2b2-c0665676d230@gmail.com \
    --to=f.fainelli@gmail.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 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).