linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: linux-arm-kernel@lists.infradead.org
Cc: maz@kernel.org, rmk+kernel@armlinux.org.uk,
	linus.walleij@linaro.org,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH v2 0/2] ARM/decompressor: deal with disabled CP15 barrier instructions
Date: Mon, 18 Nov 2019 19:15:41 +0100	[thread overview]
Message-ID: <20191118181543.122968-1-ardb@kernel.org> (raw)

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

While trying to test my v4.4 backport of the firmware/hypervisor based spectre
v1/v2 mitigations for 32-bit ARM, I noticed that KVM/qemu failed to boot my
kernel while it booted fine under TCG emulation.

As it turns out, KVM/qemu may instantiate the VCPU with support for CP15
barrier instructions disabled, causing them to UNDEF and crash the
decompressor.

I already fixed the same issue for UEFI boot, but since v4.4 does not support
that, I only noticed now that this is an issue for bare metal as well.

Changes since v1:
- instead of using v7 barriers in the v7 code, enable the CP15 barriers - this
  way, we can keep using the v7 routines for some v6 CPUs that implement CPUID
  instructions (causing them to take the v7 path) but not for the v7 barriers.
- applied Marc's and Linus's acks to #2 only

I have tested this via kernelci [0], which includes the v6 pogoplug that got
broken by the v1 version of this series.

[0] https://kernelci.org/build/ardb/branch/for-kernelci/kernel/v5.4-rc8-2-gcaea8d2861c8/

Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Marc Zyngier <maz@kernel.org>

Ard Biesheuvel (2):
  ARM/decompressor: enable CP15 barrier instructions in v7 cache setup
    code
  Revert "ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning
    the cache"

 arch/arm/boot/compressed/head.S | 29 ++++++++++----------
 1 file changed, 14 insertions(+), 15 deletions(-)

-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2019-11-18 18:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 18:15 Ard Biesheuvel [this message]
2019-11-18 18:15 ` [PATCH v2 1/2] ARM/decompressor: enable CP15 barrier instructions in v7 cache setup code Ard Biesheuvel
2019-11-18 18:15 ` [PATCH v2 2/2] Revert "ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning the cache" Ard Biesheuvel

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=20191118181543.122968-1-ardb@kernel.org \
    --to=ardb@kernel.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    /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).