]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: arm64: Factor out core register ID enumeration
authorDave Martin <Dave.Martin@arm.com>
Fri, 15 Mar 2019 15:47:04 +0000 (15:47 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 29 Mar 2019 14:41:53 +0000 (14:41 +0000)
commitbe25bbb392fad3a721d6d21b78639b60612b5439
tree1d22a8aa5dc028c097fe4383b087420e1f55bdea
parentdc52f31a928ba591757aac4e72b35ea163713b57
KVM: arm64: Factor out core register ID enumeration

In preparation for adding logic to filter out some KVM_REG_ARM_CORE
registers from the KVM_GET_REG_LIST output, this patch factors out
the core register enumeration into a separate function and rebuilds
num_core_regs() on top of it.

This may be a little more expensive (depending on how good a job
the compiler does of specialising the code), but KVM_GET_REG_LIST
is not a hot path.

This will make it easier to consolidate ID filtering code in one
place.

No functional change.

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