Re: [PATCH 3/6] kvmppc: add hypercall infrastructure - guest part

2008-07-24 Thread Christian Ehrhardt

Tony Breeds wrote:

On Wed, Jul 23, 2008 at 10:36:44AM +0200, [EMAIL PROTECTED] wrote:
  

From: Christian Ehrhardt <[EMAIL PROTECTED]>



Hi Christian,
  

This adds the guest portion of the hypercall infrastructure, basically an
illegal instruction with a defined layout.
See http://kvm.qumranet.com/kvmwiki/PowerPC_Hypercall_ABI for more detail
on the hypercall ABI for powerpc.

Signed-off-by: Christian Ehrhardt <[EMAIL PROTECTED]>
---

[diffstat]
 kvm_para.h |   16 
 1 file changed, 16 insertions(+)

[diff]
diff --git a/include/asm-powerpc/kvm_para.h b/include/asm-powerpc/kvm_para.h
--- a/include/asm-powerpc/kvm_para.h
+++ b/include/asm-powerpc/kvm_para.h
@@ -25,6 +25,8 @@
 #ifdef __KERNEL__
 
 #include 

+
+#define KVM_HYPERCALL_BIN 0x03ff



Ummm didn't you add this in patch 2 of 6?
  

This is just because I initially wanted to split Host & Guest patch series.
I need to separate my patches a bit more anyway for the next submission 
thanks for pointing out this duplication.



Yours Tony

  linux.conf.auhttp://www.marchsouth.org/
  Jan 19 - 24 2009 The Australian Linux Technical Conference!

  



--

GrĂ¼sse / regards, 
Christian Ehrhardt

IBM Linux Technology Center, Open Virtualization

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH 3/6] kvmppc: add hypercall infrastructure - guest part

2008-07-23 Thread Tony Breeds
On Wed, Jul 23, 2008 at 10:36:44AM +0200, [EMAIL PROTECTED] wrote:
> From: Christian Ehrhardt <[EMAIL PROTECTED]>

Hi Christian,
> 
> This adds the guest portion of the hypercall infrastructure, basically an
> illegal instruction with a defined layout.
> See http://kvm.qumranet.com/kvmwiki/PowerPC_Hypercall_ABI for more detail
> on the hypercall ABI for powerpc.
> 
> Signed-off-by: Christian Ehrhardt <[EMAIL PROTECTED]>
> ---
> 
> [diffstat]
>  kvm_para.h |   16 
>  1 file changed, 16 insertions(+)
> 
> [diff]
> diff --git a/include/asm-powerpc/kvm_para.h b/include/asm-powerpc/kvm_para.h
> --- a/include/asm-powerpc/kvm_para.h
> +++ b/include/asm-powerpc/kvm_para.h
> @@ -25,6 +25,8 @@
>  #ifdef __KERNEL__
>  
>  #include 
> +
> +#define KVM_HYPERCALL_BIN 0x03ff

Ummm didn't you add this in patch 2 of 6?

Yours Tony

  linux.conf.auhttp://www.marchsouth.org/
  Jan 19 - 24 2009 The Australian Linux Technical Conference!

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/6] kvmppc: add hypercall infrastructure - guest part

2008-07-23 Thread ehrhardt
From: Christian Ehrhardt <[EMAIL PROTECTED]>

This adds the guest portion of the hypercall infrastructure, basically an
illegal instruction with a defined layout.
See http://kvm.qumranet.com/kvmwiki/PowerPC_Hypercall_ABI for more detail
on the hypercall ABI for powerpc.

Signed-off-by: Christian Ehrhardt <[EMAIL PROTECTED]>
---

[diffstat]
 kvm_para.h |   16 
 1 file changed, 16 insertions(+)

[diff]
diff --git a/include/asm-powerpc/kvm_para.h b/include/asm-powerpc/kvm_para.h
--- a/include/asm-powerpc/kvm_para.h
+++ b/include/asm-powerpc/kvm_para.h
@@ -25,6 +25,8 @@
 #ifdef __KERNEL__
 
 #include 
+
+#define KVM_HYPERCALL_BIN 0x03ff
 
 static struct kvmppc_para_features {
char *dtcell;
@@ -63,6 +65,20 @@
 
 void kvm_guest_init(void);
 
+static inline long kvm_hypercall1(unsigned int nr, unsigned long p1)
+{
+   register unsigned long hcall asm ("r0") = nr;
+   register unsigned long arg1 asm ("r3") = p1;
+   register long ret asm ("r11");
+
+   asm volatile(".long %1"
+   : "=r"(ret)
+   : "i"(KVM_HYPERCALL_BIN), "r"(hcall), "r"(arg1)
+   : "r4", "r5", "r6", "r7", "r8",
+ "r9", "r10", "r12", "cc");
+   return ret;
+}
+
 #endif /* __KERNEL__ */
 
 #endif /* __POWERPC_KVM_PARA_H__ */
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev