linux-stable/arch/arm64
Marc Zyngier e0032f5c08 KVM: arm64: AArch32: Fix spurious trapping of conditional instructions
commit c92e8b9eac upstream.

We recently upgraded the view of ESR_EL2 to 64bit, in keeping with
the requirements of the architecture.

However, the AArch32 emulation code was left unaudited, and the
(already dodgy) code that triages whether a trap is spurious or not
(because the condition code failed) broke in a subtle way:

If ESR_EL2.ISS2 is ever non-zero (unlikely, but hey, this is the ARM
architecture we're talking about), the hack that tests the top bits
of ESR_EL2.EC will break in an interesting way.

Instead, use kvm_vcpu_trap_get_class() to obtain the EC, and list
all the possible ECs that can fail a condition code check.

While we're at it, add SMC32 to the list, as it is explicitly listed
as being allowed to trap despite failing a condition code check (as
described in the HCR_EL2.TSC documentation).

Fixes: 0b12620fdd ("KVM: arm64: Treat ESR_EL2 as a 64-bit register")
Cc: stable@vger.kernel.org
Acked-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240524141956.1450304-4-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-16 13:41:37 +02:00
..
boot arm64: dts: hi3798cv200: fix the size of GICR 2024-06-16 13:41:35 +02:00
configs arm64: defconfig: remove CONFIG_COMMON_CLK_NPCM8XX=y 2023-10-06 14:57:03 +02:00
crypto crypto: arm64/neonbs - fix out-of-bounds access on short input 2024-03-06 14:45:10 +00:00
hyperv hyperv: simplify and rename generate_guest_id 2022-09-28 13:36:56 +00:00
include arm64: asm-bug: Add .align 2 to the end of __BUG_ENTRY 2024-06-12 11:03:52 +02:00
kernel arm64/sve: Lower the maximum allocation for the SVE ptrace regset 2024-03-26 18:20:25 -04:00
kvm KVM: arm64: AArch32: Fix spurious trapping of conditional instructions 2024-06-16 13:41:37 +02:00
lib arm64: csum: Fix OoB access in IP checksum code for negative lengths 2023-09-13 09:43:01 +02:00
mm arm64: hibernate: Fix level3 translation fault in swsusp_save() 2024-04-27 17:07:16 +02:00
net bpf, arm64: Fix incorrect runtime stats 2024-05-17 11:55:58 +02:00
tools arm64: Rename ARM64_WORKAROUND_2966298 2024-01-31 16:17:01 -08:00
xen
Kbuild
Kconfig arm64: atomics: lse: remove stale dependency on JUMP_LABEL 2024-05-25 16:21:34 +02:00
Kconfig.debug
Kconfig.platforms ARM: SoC code changes for 6.1 2022-10-06 11:22:25 -07:00
Makefile arm64: add dependency between vmlinuz.efi and Image 2023-12-20 17:00:24 +01:00