public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] ARM: re-implement physical address space switching
Date: Wed, 6 May 2015 17:14:06 +0100	[thread overview]
Message-ID: <20150506161406.GC2974@leverpostej> (raw)
In-Reply-To: <20150506155004.GW2067@n2100.arm.linux.org.uk>

Hi Russell,

> > 	cr = get_cr();
> > 	set_cr(cr & ~(CR_I | CR_C | CR_W));
> > 	flush_cache_all();
> > 
> > With the MMU on at this point the page table walkers can race with the
> > set/way maintenance. It also relies on the compiler not making stack
> > accesses between the SCTLR write and the completion of flush_cache_all,
> > which is likely but not guranteed.
> 
> Yes, I suppose you're right, but there's really no other way to do
> this other than coding up CPU specific code.
> 
> What we'd need to do is to code up a specific assembly routine which
> disables the I and C control register flags, flushes the cache, jumps
> to the physical alias and then disables the MMU all without touching
> memory.  That's far too much effort.  Like I say, maybe we should just
> bin Keystone for this crap...
> 
> I'm not interested in trying to "fix" this code any further - as I
> said earlier, it took quite a while to get this code working on
> Keystone, which is really all we care about.  Anyone else who copies
> the abortion that TI made in Keystone should be shot. :)
> 
> While the community has the luxury of saying "we don't like it, it's
> TI's problem" - which is what was done when the problems were first
> pointed out by Will, the net result is that this problem became my
> problem to try and sort out.
> 
> So, if you have a better idea how to fix this, I'm all ears.
>
> What I'm certain of though is that this is an improvement over what's
> in the kernel today, and so should go in irrespective of whether it's
> totally bullet-proof or not.

I don't disagree with that. :)

w.r.t. "better" ideas, my initial thought was that we could move the
SCTLR.{C,M} clearing into lpae_pgtables_remap_asm, along with a call to
v7_flush_dcache_all (as it should be in the physical mapping). So long
as the kernel text was initially clean to the PoC I'd expect that to
work, but I understood from your initial reply you'd tried that and
something went wrong.

Perhaps we can look into that later.

Thanks,
Mark.

  reply	other threads:[~2015-05-06 16:14 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08  9:44 [PATCH 0/7] Fix Keystone 2 physical address switch Russell King - ARM Linux
2015-04-08  9:45 ` [PATCH 1/6] ARM: keystone2: move platform notifier initialisation into platform init Russell King
2015-04-13 18:57   ` santosh shilimkar
2015-04-08  9:45 ` [PATCH 2/6] ARM: keystone2: move update of the phys-to-virt constants into generic code Russell King
2015-04-08 14:56   ` Grygorii.Strashko@linaro.org
2015-04-08 18:00     ` Russell King - ARM Linux
2015-04-09 14:51       ` Grygorii.Strashko@linaro.org
2015-04-09 15:49         ` Russell King - ARM Linux
2015-04-09 16:15           ` Grygorii.Strashko@linaro.org
2015-04-08 19:19     ` Russell King - ARM Linux
2015-04-13 19:02   ` santosh shilimkar
2015-04-08  9:45 ` [PATCH 3/6] ARM: keystone2: move address space switch printk to " Russell King
2015-04-13 19:02   ` santosh shilimkar
2015-04-08  9:45 ` [PATCH 4/6] ARM: keystone2: rename init_meminfo to pv_fixup Russell King
2015-04-13 19:03   ` santosh shilimkar
2015-04-08  9:45 ` [PATCH 5/6] ARM: re-implement physical address space switching Russell King
2015-04-08 14:34   ` Thomas Petazzoni
2015-04-08 17:27     ` santosh shilimkar
2015-04-08 18:10     ` Russell King - ARM Linux
2015-04-08 17:36   ` Mark Rutland
2015-04-08 17:55     ` Russell King - ARM Linux
2015-04-13 19:11       ` santosh shilimkar
2015-04-15 12:07         ` Mark Rutland
2015-04-15 17:27           ` santosh shilimkar
2015-04-23 11:24             ` Mark Rutland
2015-05-06 10:18               ` Russell King - ARM Linux
2015-05-06 10:37                 ` Mark Rutland
2015-05-06 11:33                   ` Russell King - ARM Linux
2015-05-06 15:33                     ` Mark Rutland
2015-05-06 15:50                       ` Russell King - ARM Linux
2015-05-06 16:14                         ` Mark Rutland [this message]
2015-05-06 16:24                           ` Will Deacon
2015-04-08  9:45 ` [PATCH 6/6] ARM: cleanup early_paging_init() calling Russell King
2015-04-13 19:13   ` santosh shilimkar
2015-04-08 17:21 ` [PATCH 0/7] Fix Keystone 2 physical address switch santosh shilimkar
2015-04-09 16:21   ` Russell King - ARM Linux
2015-04-09 16:35     ` santosh shilimkar

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=20150506161406.GC2974@leverpostej \
    --to=mark.rutland@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