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: kernel: avoid literal load of virtual address with MMU off
Date: Wed, 17 Aug 2016 18:11:34 +0100	[thread overview]
Message-ID: <20160817171134.GF20762@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <1471449281-10367-1-git-send-email-ard.biesheuvel@linaro.org>

On Wed, Aug 17, 2016 at 05:54:41PM +0200, Ard Biesheuvel wrote:
> Literal loads of virtual addresses are subject to runtime relocation when
> CONFIG_RELOCATABLE=y, and given that the relocation routines run with the
> MMU and caches enabled, literal loads of relocated values performed with
> the MMU off are not guaranteed to return the latest value unless the
> memory covering the literal is cleaned to the PoC explicitly.
> 
> So defer the literal load until after the MMU has been enabled, just like
> we do for primary_switch() and secondary_switch() in head.S.

I think for consistency with head.S the patch is fine but do we actually
expect a literal pool value to be inconsistent between cache and PoC?
Presumably, the first time the kernel image was loaded it had to be
cleaned to PoC but after that we wouldn't expect modifications of the
literal pool data.

-- 
Catalin

  parent reply	other threads:[~2016-08-17 17:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 15:54 [PATCH] arm64: kernel: avoid literal load of virtual address with MMU off Ard Biesheuvel
2016-08-17 16:16 ` Mark Rutland
2016-08-17 17:11 ` Catalin Marinas [this message]
2016-08-17 17:22   ` Mark Rutland
2016-08-17 17:26   ` Ard Biesheuvel
2016-08-18  8:34     ` Catalin Marinas

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=20160817171134.GF20762@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).