OSDN Git Service

KVM: arm64: Enumerate SVE register indices for KVM_GET_REG_LIST
authorDave Martin <Dave.Martin@arm.com>
Fri, 28 Sep 2018 13:39:20 +0000 (14:39 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 29 Mar 2019 14:41:54 +0000 (14:41 +0000)
commit8e3c54c8b6a9286b1571c4a4ba1d4afbd217f297
tree25496c5a7a315ed065052ed882a9ea29581bee66
parente1c9c98345b356ad2890ac7e9223593cae8b4dba
KVM: arm64: Enumerate SVE register indices for KVM_GET_REG_LIST

This patch includes the SVE register IDs in the list returned by
KVM_GET_REG_LIST, as appropriate.

On a non-SVE-enabled vcpu, no new IDs are added.

On an SVE-enabled vcpu, IDs for the FPSIMD V-registers are removed
from the list, since userspace is required to access the Z-
registers instead in order to access the V-register content.  For
the variably-sized SVE registers, the appropriate set of slice IDs
are enumerated, depending on the maximum vector length for the
vcpu.

As it currently stands, the SVE architecture never requires more
than one slice to exist per register, so this patch adds no
explicit support for enumerating multiple slices.  The code can be
extended straightforwardly to support this in the future, if
needed.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Tested-by: zhang.lei <zhang.lei@jp.fujitsu.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/kvm/guest.c