linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: fix invalidation of wrong __early_cpu_boot_status cacheline
Date: Fri, 15 Apr 2016 12:07:55 +0100	[thread overview]
Message-ID: <20160415110755.GA32635@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <5710C449.3050900@arm.com>

On Fri, Apr 15, 2016 at 11:36:57AM +0100, Suzuki K. Poulose wrote:
> On 15/04/16 11:20, Mark Rutland wrote:
> >On Fri, Apr 15, 2016 at 12:11:21PM +0200, Ard Biesheuvel wrote:
> >>In head.S, the str_l macro, which takes a source register, a symbol name
> >>and a temp register, is used to store a status value to the variable
> >>__early_cpu_boot_status. Subsequently, the value of the temp register is
> >>reused to invalidate any cachelines covering this variable.
> >>
> >>However, since str_l resolves to
> >>
> >>       adrp    \tmp, \sym
> >>       str     \src, [\tmp, :lo12:\sym]
> >>
> >>the temp register never actually holds the address of the variable but
> >>only of the 4 KB window that covers it, and reusing it leads to the
> >>wrong cacheline being invalidated. So instead, take the address
> >>explicitly before doing the store, and reuse that value to perform
> >>the cache invalidation.
> >>
> >>Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >>---
> >>
> >>This deserves a cc stable, since the macro is always invoked for each CPU
> >>at boot.
> >
> >Sounds good, also:
> >
> >Fixes: bb9052744f4b7ae1 ("arm64: Handle early CPU boot failures")
> 
> This first appeared in 4.6-rc1, so I don't think we need to Cc stable.

Indeed. I'll add the Fixes line though, for reference.

> The initial patch was using adr_l as in this fix.
> 
> Catalin, was there a specific reason for that change ? I remember you mentioning
> something about it.

I think it was just code reduction.

I'll queue the fix for 4.6-rc.

Thanks.

-- 
Catalin

      reply	other threads:[~2016-04-15 11:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 10:11 [PATCH] arm64: fix invalidation of wrong __early_cpu_boot_status cacheline Ard Biesheuvel
2016-04-15 10:20 ` Mark Rutland
2016-04-15 10:36   ` Suzuki K Poulose
2016-04-15 11:07     ` Catalin Marinas [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=20160415110755.GA32635@e104818-lin.cambridge.arm.com \
    --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 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).