Re: [PATCH 1/2] kvm/powerpc: rename kvm_hypercall() to epapr_hypercall()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23.09.2013, at 07:23, Bharat Bhushan wrote:

> kvm_hypercall() have nothing KVM specific, so renamed to epapr_hypercall().
> Also this in moved to arch/powerpc/include/asm/epapr_hcalls.h
> 
> Signed-off-by: Bharat Bhushan <bharat.bhushan@xxxxxxxxxxxxx>
> ---
> arch/powerpc/include/asm/epapr_hcalls.h |   36 +++++++++++++++++++++++++++
> arch/powerpc/include/asm/kvm_para.h     |   23 ++++-------------
> arch/powerpc/kernel/kvm.c               |   41 +-----------------------------
> 3 files changed, 44 insertions(+), 56 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h
> index d3d6342..8a85f6f 100644
> --- a/arch/powerpc/include/asm/epapr_hcalls.h
> +++ b/arch/powerpc/include/asm/epapr_hcalls.h
> @@ -454,5 +454,41 @@ static inline unsigned int ev_idle(void)
> 
> 	return r3;
> }
> +
> +static inline unsigned long epapr_hypercall(unsigned long *in,
> +			    unsigned long *out,
> +			    unsigned long nr)
> +{
> +	unsigned long register r0 asm("r0");
> +	unsigned long register r3 asm("r3") = in[0];
> +	unsigned long register r4 asm("r4") = in[1];
> +	unsigned long register r5 asm("r5") = in[2];
> +	unsigned long register r6 asm("r6") = in[3];
> +	unsigned long register r7 asm("r7") = in[4];
> +	unsigned long register r8 asm("r8") = in[5];
> +	unsigned long register r9 asm("r9") = in[6];
> +	unsigned long register r10 asm("r10") = in[7];
> +	unsigned long register r11 asm("r11") = nr;
> +	unsigned long register r12 asm("r12");
> +
> +	asm volatile("bl	epapr_hypercall_start"
> +		     : "=r"(r0), "=r"(r3), "=r"(r4), "=r"(r5), "=r"(r6),
> +		       "=r"(r7), "=r"(r8), "=r"(r9), "=r"(r10), "=r"(r11),
> +		       "=r"(r12)
> +		     : "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "r"(r8),
> +		       "r"(r9), "r"(r10), "r"(r11)
> +		     : "memory", "cc", "xer", "ctr", "lr");
> +
> +	out[0] = r4;
> +	out[1] = r5;
> +	out[2] = r6;
> +	out[3] = r7;
> +	out[4] = r8;
> +	out[5] = r9;
> +	out[6] = r10;
> +	out[7] = r11;
> +
> +	return r3;
> +}
> #endif /* !__ASSEMBLY__ */
> #endif /* _EPAPR_HCALLS_H */
> diff --git a/arch/powerpc/include/asm/kvm_para.h b/arch/powerpc/include/asm/kvm_para.h
> index 2b11965..c18660e 100644
> --- a/arch/powerpc/include/asm/kvm_para.h
> +++ b/arch/powerpc/include/asm/kvm_para.h
> @@ -39,10 +39,6 @@ static inline int kvm_para_available(void)
> 	return 1;
> }
> 
> -extern unsigned long kvm_hypercall(unsigned long *in,
> -				   unsigned long *out,
> -				   unsigned long nr);
> -
> #else
> 
> static inline int kvm_para_available(void)
> @@ -50,13 +46,6 @@ static inline int kvm_para_available(void)
> 	return 0;
> }
> 
> -static unsigned long kvm_hypercall(unsigned long *in,
> -				   unsigned long *out,
> -				   unsigned long nr)
> -{
> -	return EV_UNIMPLEMENTED;
> -}
> -
> #endif
> 
> static inline long kvm_hypercall0_1(unsigned int nr, unsigned long *r2)
> @@ -65,7 +54,7 @@ static inline long kvm_hypercall0_1(unsigned int nr, unsigned long *r2)
> 	unsigned long out[8];
> 	unsigned long r;
> 
> -	r = kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
> +	r = epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));

Won't this break when CONFIG_EPAPR_PARAVIRT=n? We wouldn't have epapr_hcalls.S compiled into the code base then and the bl above would reference an unknown function.


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux