mbox series

[0/2] ARM/decompressor: deal with disabled CP15 barrier instructions

Message ID 20191106094219.24365-1-ardb@kernel.org (mailing list archive)
Headers show
Series ARM/decompressor: deal with disabled CP15 barrier instructions | expand

Message

Ard Biesheuvel Nov. 6, 2019, 9:42 a.m. UTC
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.

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: avoid 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 | 51 ++++++++++----------
 1 file changed, 26 insertions(+), 25 deletions(-)

Comments

Linus Walleij Nov. 13, 2019, 1:58 p.m. UTC | #1
On Wed, Nov 6, 2019 at 10:42 AM Ard Biesheuvel <ardb@kernel.org> wrote:

> 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.
>
> Cc: Russell King <rmk+kernel@armlinux.org.uk>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Marc Zyngier <maz@kernel.org>

FWIW:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Looking at patches for stable is a bit like cleaning the sink in the bathroom,
seems OK at first but after a while you get scared by the stuff that comes
up.

Yours,
Linus Walleij
Ard Biesheuvel Nov. 14, 2019, 9:54 a.m. UTC | #2
On Wed, 13 Nov 2019 at 13:58, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Wed, Nov 6, 2019 at 10:42 AM Ard Biesheuvel <ardb@kernel.org> wrote:
>
> > 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.
> >
> > Cc: Russell King <rmk+kernel@armlinux.org.uk>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Marc Zyngier <maz@kernel.org>
>
> FWIW:
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>

Thanks!

> Looking at patches for stable is a bit like cleaning the sink in the bathroom,
> seems OK at first but after a while you get scared by the stuff that comes
> up.
>

Well, at least I didn't need gloves :-)