Re: [PATCH v2 05/22] KVM: ARM64: Add a helper for CP15 registers reset to UNKNOWN
On 11/09/15 09:54, Shannon Zhao wrote: > From: Shannon Zhao > > Signed-off-by: Shannon Zhao > --- > arch/arm64/kvm/sys_regs.h | 8 > 1 file changed, 8 insertions(+) > > diff --git a/arch/arm64/kvm/sys_regs.h b/arch/arm64/kvm/sys_regs.h > index d411e25..a0b3811 100644 > --- a/arch/arm64/kvm/sys_regs.h > +++ b/arch/arm64/kvm/sys_regs.h > @@ -104,6 +104,14 @@ static inline void reset_unknown(struct kvm_vcpu *vcpu, > vcpu_sys_reg(vcpu, r->reg) = 0x1de7ec7edbadc0deULL; > } > > +static inline void reset_unknown_cp15(struct kvm_vcpu *vcpu, > + const struct sys_reg_desc *r) > +{ Oh, and given that you are using this as a function pointer in the next patch, why is it an inline function? Please merge this with patch #6. M. -- Jazz is not dead. It just smells funny... -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 05/22] KVM: ARM64: Add a helper for CP15 registers reset to UNKNOWN
On 11/09/15 09:54, Shannon Zhao wrote: > From: Shannon Zhao > > Signed-off-by: Shannon Zhao > --- > arch/arm64/kvm/sys_regs.h | 8 > 1 file changed, 8 insertions(+) > > diff --git a/arch/arm64/kvm/sys_regs.h b/arch/arm64/kvm/sys_regs.h > index d411e25..a0b3811 100644 > --- a/arch/arm64/kvm/sys_regs.h > +++ b/arch/arm64/kvm/sys_regs.h > @@ -104,6 +104,14 @@ static inline void reset_unknown(struct kvm_vcpu *vcpu, > vcpu_sys_reg(vcpu, r->reg) = 0x1de7ec7edbadc0deULL; > } > > +static inline void reset_unknown_cp15(struct kvm_vcpu *vcpu, > + const struct sys_reg_desc *r) > +{ > + BUG_ON(!r->reg); > + BUG_ON(r->reg >= NR_COPRO_REGS); > + vcpu_cp15(vcpu, r->reg) = 0xdecafbad; Given how many times we use this constant, maybe we should consider having a #define for it? Thanks, M. -- Jazz is not dead. It just smells funny... -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 05/22] KVM: ARM64: Add a helper for CP15 registers reset to UNKNOWN
From: Shannon Zhao Signed-off-by: Shannon Zhao --- arch/arm64/kvm/sys_regs.h | 8 1 file changed, 8 insertions(+) diff --git a/arch/arm64/kvm/sys_regs.h b/arch/arm64/kvm/sys_regs.h index d411e25..a0b3811 100644 --- a/arch/arm64/kvm/sys_regs.h +++ b/arch/arm64/kvm/sys_regs.h @@ -104,6 +104,14 @@ static inline void reset_unknown(struct kvm_vcpu *vcpu, vcpu_sys_reg(vcpu, r->reg) = 0x1de7ec7edbadc0deULL; } +static inline void reset_unknown_cp15(struct kvm_vcpu *vcpu, + const struct sys_reg_desc *r) +{ + BUG_ON(!r->reg); + BUG_ON(r->reg >= NR_COPRO_REGS); + vcpu_cp15(vcpu, r->reg) = 0xdecafbad; +} + static inline void reset_val(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) { BUG_ON(!r->reg); -- 2.0.4 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html