]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64/sve: sys_regs: Demote redundant vcpu_has_sve() checks to WARNs
authorDave Martin <Dave.Martin@arm.com>
Fri, 5 Apr 2019 15:35:50 +0000 (16:35 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Thu, 18 Apr 2019 16:14:01 +0000 (17:14 +0100)
commit18456be8786c0c706ee624b4829948c5898e4f4f
tree66caa6e6d930ffd8db2a1a747920f5ec410d5f85
parentbb127eaf5dff7004dd7149a7598277998e51e436
KVM: arm64/sve: sys_regs: Demote redundant vcpu_has_sve() checks to WARNs

Because of the logic in kvm_arm_sys_reg_{get,set}_reg() and
sve_id_visibility(), we should never call
{get,set}_id_aa64zfr0_el1() for a vcpu where !vcpu_has_sve(vcpu).

To avoid the code giving the impression that it is valid for these
functions to be called in this situation, and to help the compiler
make the right optimisation decisions, this patch adds WARN_ON()
for these cases.

Given the way the logic is spread out, this seems preferable to
dropping the checks altogether.

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>
arch/arm64/kvm/sys_regs.c