linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] ARM: decompressor: use by-VA cache maintenance for v7 cores
@ 2020-02-19  9:43 Ard Biesheuvel
  2020-02-19  9:43 ` [PATCH v2 1/4] efi/arm: work around missing cache maintenance in decompressor handover Ard Biesheuvel
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Ard Biesheuvel @ 2020-02-19  9:43 UTC (permalink / raw)
  To: linux-efi
  Cc: linux-arm-kernel, Ard Biesheuvel, Russell King, Marc Zyngier,
	Nicolas Pitre, Catalin Marinas, Tony Lindgren

While making changes to the EFI stub startup code, I noticed that we are
still doing set/way maintenance on the caches when booting on v7 cores.
This works today on VMs by virtue of the fact that KVM traps set/way ops
and cleans the whole address space by VA on behalf of the guest, and on
most v7 hardware, the set/way ops are in fact sufficient when only one
core is running, as there usually is no system cache. But on systems
like SynQuacer, for which 32-bit firmware is available, the current cache
maintenance only pushes the data out to the L3 system cache, where it
is not visible to the CPU once it turns the MMU and caches off.

So instead, switch to the by-VA cache maintenance that the architecture
requires for v7 and later (and ARM1176, as a side effect).

Changes since v1:
- include the EFI patch that was sent out separately before (#1)
- split the preparatory work to pass the region to clean in r0/r1 in a EFI
  specific one and one for the decompressor - this way, the first two patches
  can go on a stable branch that is shared between the ARM tree and the EFI
  tree
- document the meaning of the values in r0/r1 upon entry to cache_clean_flush
- take care to treat the region end address as exclusive
- switch to clean+invalidate to align with the other implementations
- drop some code that manages the stack pointer value before calling 
  cache_clean_flush(), which is no longer necessary
- take care to clean the entire region that is covered by the relocated zImage
  if it needs to relocate itself before decompressing

https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=arm32-efi-cache-ops

Cc: Russell King <linux@armlinux.org.uk>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Nicolas Pitre <nico@fluxnic.net>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Tony Lindgren <tony@atomide.com>

Ard Biesheuvel (4):
  efi/arm: work around missing cache maintenance in decompressor
    handover
  efi/arm: pass start and end addresses to cache_clean_flush()
  ARM: decompressor: prepare cache_clean_flush for doing by-VA
    maintenance
  ARM: decompressor: switch to by-VA cache maintenance for v7 cores

 arch/arm/boot/compressed/head.S | 133 +++++++++++---------
 1 file changed, 74 insertions(+), 59 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-02-22 23:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19  9:43 [PATCH v2 0/4] ARM: decompressor: use by-VA cache maintenance for v7 cores Ard Biesheuvel
2020-02-19  9:43 ` [PATCH v2 1/4] efi/arm: work around missing cache maintenance in decompressor handover Ard Biesheuvel
2020-02-19  9:43 ` [PATCH v2 2/4] efi/arm: pass start and end addresses to cache_clean_flush() Ard Biesheuvel
2020-02-19  9:43 ` [PATCH v2 3/4] ARM: decompressor: prepare cache_clean_flush for doing by-VA maintenance Ard Biesheuvel
2020-02-19  9:43 ` [PATCH v2 4/4] ARM: decompressor: switch to by-VA cache maintenance for v7 cores Ard Biesheuvel
2020-02-20 18:08 ` [PATCH v2 0/4] ARM: decompressor: use " Ard Biesheuvel
2020-02-21 13:35   ` Robin Murphy
2020-02-21 13:42     ` Ard Biesheuvel
2020-02-21 15:54       ` Ard Biesheuvel
2020-02-21 16:09       ` Robin Murphy
2020-02-22 23:38         ` Linus Walleij

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).