KVM: arm64: Reuse fields of sys_reg_desc for idreg
authorJing Zhang <jingzhangos@google.com>
Fri, 9 Jun 2023 19:00:48 +0000 (19:00 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Mon, 12 Jun 2023 23:08:33 +0000 (23:08 +0000)
commitd86cde6e335fa442c6b0866562140a2bef25402a
treee73dbf2a6cc9bafa443b8107afcff935b6360834
parentf90f9360c3d7fbb731732fbb9a1228f55d178e10
KVM: arm64: Reuse fields of sys_reg_desc for idreg

sys_reg_desc::{reset, val} are presently unused for ID register
descriptors. Repurpose these fields to support user-configurable ID
registers.
Use the ::reset() function pointer to return the sanitised value of a
given ID register, optionally with KVM-specific feature sanitisation.
Additionally, keep a mask of writable register fields in ::val.

Signed-off-by: Jing Zhang <jingzhangos@google.com>
Link: https://lore.kernel.org/r/20230609190054.1542113-6-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/sys_regs.c
arch/arm64/kvm/sys_regs.h