Re: [PATCH 6/6 v2] kvm: ppc: Add SPRN_EPR get helper function

Alexander Graf
2014-07-17T13:44:54Z

On 17.07.14 13:31, Bharat Bhushan wrote:
> kvmppc_set_epr() is already defined in asm/kvm_ppc.h, So
> rename and move get_epr helper function to same file.
>
> Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
> ---
> v1->v2
> - vcpu->arch.epr under CONFIG_BOOKE
>
> arch/powerpc/include/asm/kvm_ppc.h | 10 ++++++++++
> arch/powerpc/kvm/booke.c | 11 +----------
> 2 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
> index 58a5202..14e2d87 100644
> --- a/arch/powerpc/include/asm/kvm_ppc.h
> +++ b/arch/powerpc/include/asm/kvm_ppc.h
> @@ -395,6 +395,16 @@ static inline int kvmppc_xics_hcall(struct kvm_vcpu *vcpu, u32 cmd)
> { return 0; }
> #endif
>
> +static inline unsigned long kvmppc_get_epr(struct kvm_vcpu *vcpu)
> +{
> +#ifdef CONFIG_KVM_BOOKE_HV
> + return mfspr(SPRN_GEPR);
> +#elif defined(CONFIG_BOOKE)
> + return vcpu->arch.epr;
> +#endif
> + return 0;

Let me change that to

#else
return 0;
#endif

Alex