linux-kernelorg-stable/arch/arm64/kvm
Dave Martin 8ae6efdde4 KVM: arm64/sve: Clean up UAPI register ID definitions
Currently, the SVE register ID macros are not all defined in the
same way, and advertise the fact that FFR maps onto the nonexistent
predicate register P16.  This is really just for kernel
convenience, and may lead userspace into bad habits.

Instead, this patch masks the ID macro arguments so that
architecturally invalid register numbers will not be passed through
any more, and uses a literal KVM_REG_ARM64_SVE_FFR_BASE macro to
define KVM_REG_ARM64_SVE_FFR(), similarly to the way the _ZREG()
and _PREG() macros are defined.

Rather than plugging in magic numbers for the number of Z- and P-
registers and the maximum possible number of register slices, this
patch provides definitions for those too.  Userspace is going to
need them in any case, and it makes sense for them to come from
<uapi/asm/kvm.h>.

sve_reg_to_region() uses convenience constants that are defined in
a different way, and also makes use of the fact that the FFR IDs
are really contiguous with the P15 IDs, so this patch retains the
existing convenience constants in guest.c, supplemented with a
couple of sanity checks to check for consistency with the UAPI
header.

Fixes: e1c9c98345 ("KVM: arm64/sve: Add SVE support to register access ioctl interface")
Suggested-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
2019-04-18 17:14:01 +01:00
..
hyp KVM: arm64/sve: Context switch the SVE registers 2019-03-29 14:41:53 +00:00
Kconfig treewide: surround Kconfig file paths with double quotes 2018-12-22 00:25:54 +09:00
Makefile KVM: arm/arm64: Prefix header search paths with $(srctree)/ 2019-02-19 21:05:53 +00:00
debug.c arm/arm64: KVM: Introduce kvm_call_hyp_ret() 2019-02-19 21:05:24 +00:00
fpsimd.c KVM: arm64/sve: Context switch the SVE registers 2019-03-29 14:41:53 +00:00
guest.c KVM: arm64/sve: Clean up UAPI register ID definitions 2019-04-18 17:14:01 +01:00
handle_exit.c * ARM: selftests improvements, large PUD support for HugeTLB, 2018-12-26 11:46:28 -08:00
hyp-init.S
hyp.S arm64: KVM: Drop VHE-specific HYP call stub 2019-02-19 21:05:28 +00:00
inject_fault.c
irq.h
regmap.c
reset.c KVM: arm/arm64: Demote kvm_arm_init_arch_resources() to just set up SVE 2019-04-18 17:14:01 +01:00
sys_regs.c KVM: arm64/sve: sys_regs: Demote redundant vcpu_has_sve() checks to WARNs 2019-04-18 17:14:01 +01:00
sys_regs.h KVM: arm64: Support runtime sysreg visibility filtering 2019-03-29 14:41:53 +00:00
sys_regs_generic_v8.c
trace.h arm64: KVM: Add trapped system register access tracepoint 2018-12-19 17:47:08 +00:00
va_layout.c
vgic-sys-reg-v3.c