From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] arm64: mm: increase VA range of identity map
Date: Wed, 25 Feb 2015 14:24:54 +0000 [thread overview]
Message-ID: <20150225142454.GH12377@arm.com> (raw)
In-Reply-To: <CAKv+Gu8gYV9Zr3SS6fUda=MKo5DR_=megy1aOAkUOoc4-4RgMA@mail.gmail.com>
On Wed, Feb 25, 2015 at 02:15:52PM +0000, Ard Biesheuvel wrote:
> On 25 February 2015 at 14:01, Will Deacon <will.deacon@arm.com> wrote:
> > On Tue, Feb 24, 2015 at 05:08:23PM +0000, Ard Biesheuvel wrote:
> >> +static inline void __cpu_set_tcr_t0sz(u64 t0sz)
> >> +{
> >> + unsigned long tcr;
> >> +
> >> + if (!IS_ENABLED(CONFIG_ARM64_VA_BITS_48)
> >> + && unlikely(idmap_t0sz != TCR_T0SZ(VA_BITS)))
> >> + asm volatile(
> >> + " mrs %0, tcr_el1 ;"
> >> + " bfi %0, %1, #%2, #%3 ;"
> >
> > It's odd that you need these '#'s. Do you see issues without them?
> >
>
> I actually haven't tried without them. I can remove them if you prefer
Yes, please.
> >> + " msr tcr_el1, %0 ;"
> >> + " isb"
> >> + : "=&r" (tcr)
> >> + : "r"(t0sz), "I"(TCR_T0SZ_OFFSET), "I"(TCR_TxSZ_WIDTH));
> >> +}
> >
> > Hmm, do we need a memory clobber here, or can we rely on the caller doing
> > having the appropriate compiler barriers?
> >
>
> The TCR_EL1 update only affects the lower TTBR0 mapping, so I don't
> think it would matter in this particular case if any memory accesses
> are reordered across it, would it?
What if those accesses were intended for the identity mapping and ended
up being translated with stale user mappings? It could be that the
preempt_disable() is enough, but if so, a comment would be helpful.
Will
next prev parent reply other threads:[~2015-02-25 14:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-24 17:08 [PATCH v2] arm64: mm: increase VA range of identity map Ard Biesheuvel
2015-02-25 1:30 ` Laura Abbott
2015-02-25 12:38 ` Catalin Marinas
2015-02-25 13:10 ` Ard Biesheuvel
2015-02-25 13:55 ` Ard Biesheuvel
2015-02-25 15:22 ` Catalin Marinas
2015-02-25 14:01 ` Will Deacon
2015-02-25 14:15 ` Ard Biesheuvel
2015-02-25 14:24 ` Will Deacon [this message]
2015-02-25 14:47 ` Ard Biesheuvel
2015-02-25 14:58 ` Will Deacon
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=20150225142454.GH12377@arm.com \
--to=will.deacon@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).