KVM: arm64: Treat 32bit ID registers as RAZ/WI on 64bit-only system
authorOliver Upton <oliver.upton@linux.dev>
Tue, 13 Sep 2022 09:44:39 +0000 (09:44 +0000)
committerMarc Zyngier <maz@kernel.org>
Wed, 14 Sep 2022 10:36:16 +0000 (11:36 +0100)
commitd5efec7ed826b3b29c6847bf59383d8d07347a4e
tree1a0bbc29930455ba1176f12876432f64b862d5af
parent4de06e4c1dc949c35c16e4423b4ccd735264b0a9
KVM: arm64: Treat 32bit ID registers as RAZ/WI on 64bit-only system

One of the oddities of the architecture is that the AArch64 views of the
AArch32 ID registers are UNKNOWN if AArch32 isn't implemented at any EL.
Nonetheless, KVM exposes these registers to userspace for the sake of
save/restore. It is possible that the UNKNOWN value could differ between
systems, leading to a rejected write from userspace.

Avoid the issue altogether by handling the AArch32 ID registers as
RAZ/WI when on an AArch64-only system.

Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220913094441.3957645-7-oliver.upton@linux.dev
arch/arm64/kvm/sys_regs.c