Commit 5d9a718b authored by Oliver Upton's avatar Oliver Upton Committed by Marc Zyngier

KVM: arm64: Spin off helper for calling visibility hook

No functional change intended.
Reviewed-by: default avatarReiji Watanabe <reijiw@google.com>
Signed-off-by: default avatarOliver Upton <oliver.upton@linux.dev>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220913094441.3957645-5-oliver.upton@linux.dev
parent cdd5036d
......@@ -136,22 +136,25 @@ static inline void reset_val(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r
__vcpu_sys_reg(vcpu, r->reg) = r->val;
}
static inline bool sysreg_hidden(const struct kvm_vcpu *vcpu,
static inline unsigned int sysreg_visibility(const struct kvm_vcpu *vcpu,
const struct sys_reg_desc *r)
{
if (likely(!r->visibility))
return false;
return 0;
return r->visibility(vcpu, r) & REG_HIDDEN;
return r->visibility(vcpu, r);
}
static inline bool sysreg_visible_as_raz(const struct kvm_vcpu *vcpu,
static inline bool sysreg_hidden(const struct kvm_vcpu *vcpu,
const struct sys_reg_desc *r)
{
if (likely(!r->visibility))
return false;
return sysreg_visibility(vcpu, r) & REG_HIDDEN;
}
return r->visibility(vcpu, r) & REG_RAZ;
static inline bool sysreg_visible_as_raz(const struct kvm_vcpu *vcpu,
const struct sys_reg_desc *r)
{
return sysreg_visibility(vcpu, r) & REG_RAZ;
}
static inline int cmp_sys_reg(const struct sys_reg_desc *i1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment