KVM: arm64: Check RAZ visibility in ID register accessors
authorAndrew Jones <drjones@redhat.com>
Thu, 5 Nov 2020 09:10:21 +0000 (10:10 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 6 Nov 2020 16:00:29 +0000 (16:00 +0000)
commit912dee572691ffb2b387dd8b4f183d549a6b24d1
treeed4dd944ade856e5536271a1055d3771ccdba752
parent01fe5ace92ddb8732e3331355e7ba9cb6f2ef787
KVM: arm64: Check RAZ visibility in ID register accessors

The instruction encodings of ID registers are preallocated. Until an
encoding is assigned a purpose the register is RAZ. KVM's general ID
register accessor functions already support both paths, RAZ or not.
If for each ID register we can determine if it's RAZ or not, then all
ID registers can build on the general functions. The register visibility
function allows us to check whether a register should be completely
hidden or not, extending it to also report when the register should
be RAZ or not allows us to use it for ID registers as well.

Check for RAZ visibility in the ID register accessor functions,
allowing the RAZ case to be handled in a generic way for all system
registers.

The new REG_RAZ flag will be used in a later patch. This patch has
no intended functional change.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20201105091022.15373-4-drjones@redhat.com
arch/arm64/kvm/sys_regs.c
arch/arm64/kvm/sys_regs.h