]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: arm64: Make the exposed feature bits in AA64DFR0_EL1 writable from userspace
authorShameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Fri, 16 Aug 2024 13:28:19 +0000 (14:28 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 22 Aug 2024 17:05:37 +0000 (18:05 +0100)
commit980c41f554c3029ce4f99678c0cd95296212775f
tree1d333351089e9d74f5093ece74c75cdd972cc656
parent7c626ce4bae1ac14f60076d00eafe71af30450ba
KVM: arm64: Make the exposed feature bits in AA64DFR0_EL1 writable from userspace

KVM exposes the OS double lock feature bit to Guests but returns
RAZ/WI on Guest OSDLR_EL1 access. This breaks Guest migration between
systems where this feature differ. Add support to make this feature
writable from userspace by setting the mask bit. While at it, set the
mask bits for the exposed WRPs(Number of Watchpoints) as well.
Also update the selftest to cover these fields.

However we still can't make BRPs and CTX_CMPs fields writable, because
as per ARM ARM DDI 0487K.a, section D2.8.3 Breakpoint types and
linking of breakpoints, highest numbered breakpoints(BRPs) must be
context aware breakpoints(CTX_CMPs). KVM does not trap + emulate the
breakpoint registers, and as such cannot support a layout that misaligns
with the underlying hardware.

Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Link: https://lore.kernel.org/r/20240816132819.34316-1-shameerali.kolothum.thodi@huawei.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/sys_regs.c
tools/testing/selftests/kvm/aarch64/set_id_regs.c