From: will.deacon@arm•com (Will Deacon)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] arm64: mm: ensure patched kernel text is fetched from PoC
Date: Wed, 5 Aug 2015 10:16:08 +0100 [thread overview]
Message-ID: <20150805091607.GA6092@arm.com> (raw)
In-Reply-To: <20150804214522.GA14625@leverpostej>
On Tue, Aug 04, 2015 at 10:45:23PM +0100, Mark Rutland wrote:
> I assume that you meant PoU rather than PoC in the subject.
Oops, well spotted!
> On Tue, Aug 04, 2015 at 08:03:33PM +0100, Will Deacon wrote:
> > The arm64 booting document requires that the bootloader has cleaned the
> > kernel image to the PoC. However, when a CPU re-enters the kernel due to
> > either a CPU hotplug "on" event or resuming from a low-power state (e.g.
> > cpuidle), the kernel text may in-fact be dirty at the PoU due to things
> > like alternative patching or even module loading.
> >
> > Thanks to I-cache speculation with the MMU off, stale instructions could
> > be fetched prior to enabling the MMU, potentially leading to crashes
> > when executing regions of code that have been modified at runtime.
> >
> > This patch addresses the issue by ensuring that the local I-cache is
> > invalidated immediately after a CPU has enabled its MMU but before
> > jumping out of the identity mapping. Any stale instructions fetched from
> > the PoC will then be discarded and refetched correctly from the PoU.
>
> It may be worth mentioning that none of the instructions executed up to
> this point will have been patched, so we know that they have remained
> clean to the PoC. Otherwise we'd need to flush those to the PoC
> explicitly.
I'll add something to the log.
> Reviewed-by: Mark Rutland <mark.rutland@arm•com>
Cheers,
Will
prev parent reply other threads:[~2015-08-05 9:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 19:03 [PATCH] arm64: mm: ensure patched kernel text is fetched from PoC Will Deacon
2015-08-04 21:45 ` Mark Rutland
2015-08-05 9:16 ` Will Deacon [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=20150805091607.GA6092@arm.com \
--to=will.deacon@arm$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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