Skip to content

Commit 5d9a718

Browse files
ouptonMarc Zyngier
authored andcommitted
KVM: arm64: Spin off helper for calling visibility hook
No functional change intended. Reviewed-by: Reiji Watanabe <[email protected]> Signed-off-by: Oliver Upton <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent cdd5036 commit 5d9a718

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

arch/arm64/kvm/sys_regs.h

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,22 +136,25 @@ static inline void reset_val(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r
136136
__vcpu_sys_reg(vcpu, r->reg) = r->val;
137137
}
138138

139-
static inline bool sysreg_hidden(const struct kvm_vcpu *vcpu,
140-
const struct sys_reg_desc *r)
139+
static inline unsigned int sysreg_visibility(const struct kvm_vcpu *vcpu,
140+
const struct sys_reg_desc *r)
141141
{
142142
if (likely(!r->visibility))
143-
return false;
143+
return 0;
144144

145-
return r->visibility(vcpu, r) & REG_HIDDEN;
145+
return r->visibility(vcpu, r);
146+
}
147+
148+
static inline bool sysreg_hidden(const struct kvm_vcpu *vcpu,
149+
const struct sys_reg_desc *r)
150+
{
151+
return sysreg_visibility(vcpu, r) & REG_HIDDEN;
146152
}
147153

148154
static inline bool sysreg_visible_as_raz(const struct kvm_vcpu *vcpu,
149155
const struct sys_reg_desc *r)
150156
{
151-
if (likely(!r->visibility))
152-
return false;
153-
154-
return r->visibility(vcpu, r) & REG_RAZ;
157+
return sysreg_visibility(vcpu, r) & REG_RAZ;
155158
}
156159

157160
static inline int cmp_sys_reg(const struct sys_reg_desc *i1,

0 commit comments

Comments
 (0)