linux-stable/arch/arm64
Mark Rutland 8bb084119f KVM: arm64: Extract ESR_ELx.EC only
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
2021-11-08 10:41:12 +00:00
..
boot arm64: dts: qcom: ipq8074: remove USB tx-fifo-resize property 2021-09-14 11:14:59 +02:00
configs arm64: defconfig: Enable Qualcomm MSM8996 CPU clock driver 2021-08-04 15:02:54 -05:00
crypto crypto: arm64/sm4-ce - Make dependent on sm4 library instead of sm4-generic 2021-07-30 10:58:30 +08:00
hyperv arm64: hyperv: Initialize hypervisor on boot 2021-08-04 16:54:36 +00:00
include KVM: arm64: Extract ESR_ELx.EC only 2021-11-08 10:41:12 +00:00
kernel arm64: Prevent kexec and hibernation if is_protected_kvm_enabled() 2021-10-11 09:07:28 +01:00
kvm KVM: arm64: Extract ESR_ELx.EC only 2021-11-08 10:41:12 +00:00
lib arm64: Mitigate MTE issues with str{n}cmp() 2021-09-21 14:50:19 +01:00
mm arm64 fixes: 2021-09-10 11:58:20 -07:00
net bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-07-29 00:20:56 +02:00
tools arm64: Allow mismatched 32-bit EL0 support 2021-06-11 13:25:40 +01:00
xen
Kbuild arm64: hyperv: Add Hyper-V hypercall and register access utilities 2021-08-04 16:54:36 +00:00
Kconfig KVM: arm64: Depend on HAVE_KVM instead of OF 2021-10-11 10:08:50 +01:00
Kconfig.debug
Kconfig.platforms Merge branch 'arm/fixes' into arm/soc 2021-07-09 10:46:02 -07:00
Makefile arm64 updates for 5.15: 2021-09-01 15:04:29 -07:00