All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: dbm: Invalidate local TLB when setting TCR_EL1.HD
Date: Thu, 1 Oct 2020 11:33:20 +0100	[thread overview]
Message-ID: <20201001103320.GB85649@C02TD0UTHF1T.local> (raw)
In-Reply-To: <20201001095251.GB21544@gaia>

On Thu, Oct 01, 2020 at 10:52:52AM +0100, Catalin Marinas wrote:
> On Thu, Oct 01, 2020 at 10:39:20AM +0100, Will Deacon wrote:
> > TCR_EL1.HD is permitted to be cached in a TLB, so invalidate the local
> > TLB after setting the bit when detected support for the feature. Although
> > this isn't strictly necessary, since we can happily operate with the bit
> > effectively clear, the current code uses an ISB in a half-hearted attempt
> > to make the change effective, so let's just fix that up.
> > 
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Signed-off-by: Will Deacon <will@kernel.org>
> > ---
> >  arch/arm64/kernel/cpufeature.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> > index 6424584be01e..29de76046977 100644
> > --- a/arch/arm64/kernel/cpufeature.c
> > +++ b/arch/arm64/kernel/cpufeature.c
> > @@ -1442,7 +1442,7 @@ static inline void __cpu_enable_hw_dbm(void)
> >  	u64 tcr = read_sysreg(tcr_el1) | TCR_HD;
> >  
> >  	write_sysreg(tcr, tcr_el1);
> > -	isb();
> > +	local_flush_tlb_all();
> 
> Is the TLBI ordered with the TCR_EL1 write or we need the ISB as well?

I believe we still need the ISB prior to the TLBI since MSR and TLBI are
not usually ordered w.r.t. one another, so after teh TLBI it might still
be possible to allcote the stale value into TLBs.

Mark.

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

      parent reply	other threads:[~2020-10-01 10:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01  9:39 [PATCH] arm64: dbm: Invalidate local TLB when setting TCR_EL1.HD Will Deacon
2020-10-01  9:52 ` Catalin Marinas
2020-10-01 10:32   ` Will Deacon
2020-10-01 10:33   ` Mark Rutland [this message]

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=20201001103320.GB85649@C02TD0UTHF1T.local \
    --to=mark.rutland@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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 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.