linux-stable/arch/arm64
Mark Rutland bd37419f4f KVM: arm64: Extract ESR_ELx.EC only
commit 8bb084119f upstream.

Since ARMv8.0 the upper 32 bits of ESR_ELx have been RES0, and recently
some of the upper bits gained a meaning and can be non-zero. For
example, when FEAT_LS64 is implemented, ESR_ELx[36:32] contain ISS2,
which for an ST64BV or ST64BV0 can be non-zero. This can be seen in ARM
DDI 0487G.b, page D13-3145, section D13.2.37.

Generally, we must not rely on RES0 bit remaining zero in future, and
when extracting ESR_ELx.EC we must mask out all other bits.

All C code uses the ESR_ELx_EC() macro, which masks out the irrelevant
bits, and therefore no alterations are required to C code to avoid
consuming irrelevant bits.

In a couple of places the KVM assembly extracts ESR_ELx.EC using LSR on
an X register, and so could in theory consume previously RES0 bits. In
both cases this is for comparison with EC values ESR_ELx_EC_HVC32 and
ESR_ELx_EC_HVC64, for which the upper bits of ESR_ELx must currently be
zero, but this could change in future.

This patch adjusts the KVM vectors to use UBFX rather than LSR to
extract ESR_ELx.EC, ensuring these are robust to future additions to
ESR_ELx.

Cc: stable@vger.kernel.org
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211103110545.4613-1-mark.rutland@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-18 14:03:48 +01:00
..
boot arm64: dts: allwinner: h5: NanoPI Neo 2: Fix ethernet node 2021-11-02 19:48:22 +01:00
configs arm64: defconfig: Build in CONFIG_GPIO_MXC by default 2020-10-26 15:48:58 +08:00
crypto crypto: poly1305 - fix poly1305_core_setkey() declaration 2021-05-14 09:50:13 +02:00
include KVM: arm64: Extract ESR_ELx.EC only 2021-11-18 14:03:48 +01:00
kernel arm64: Mark __stack_chk_guard as __ro_after_init 2021-09-30 10:11:07 +02:00
kvm KVM: arm64: Extract ESR_ELx.EC only 2021-11-18 14:03:48 +01:00
lib arm64: Avoid premature usercopy failure 2021-11-02 19:48:18 +01:00
mm arm64/hugetlb: fix CMA gigantic page order for non-4K PAGE_SIZE 2021-10-20 11:44:58 +02:00
net bpf: Define bpf_jit_alloc_exec_limit for arm64 JIT 2021-11-18 14:03:42 +01:00
xen
Kbuild
Kconfig arm64: mte: Ensure TIF_MTE_ASYNC_FAULT is set atomically 2021-04-21 13:01:00 +02:00
Kconfig.debug
Kconfig.platforms arm64: berlin: Select DW_APB_TIMER_OF 2020-10-26 10:45:03 +01:00
Makefile arm64: link with -z norelro for LLD or aarch64-elf 2021-01-12 20:18:24 +01:00