]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit77bb536258962ff5f6ae87ef6fe9f31afcb34b91
tree1a0bbc29930455ba1176f12876432f64b862d5af
parenta1272fe51225ed474f529f4b8d90a0a4a9b26641
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