Re: [PATCH 2/6] kvmppc: add hypercall infrastructure - host part

2008-07-30 Thread Geert Uytterhoeven
On Thu, 24 Jul 2008, Tony Breeds wrote:
 On Wed, Jul 23, 2008 at 10:36:43AM +0200, [EMAIL PROTECTED] wrote:
  From: Christian Ehrhardt [EMAIL PROTECTED]
  diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
  --- a/arch/powerpc/kvm/emulate.c
  +++ b/arch/powerpc/kvm/emulate.c
  @@ -203,6 +203,24 @@
  kvmppc_set_msr(vcpu, vcpu-arch.srr1);
   }
   
  +static int kvmppc_do_hypercall(struct kvm_vcpu *vcpu)
  +{
  +   int ret = 0;
  +
  +   switch (vcpu-arch.gpr[0]) {
  +   default:
  +   printk(KERN_ERRunknown hypercall %d\n, vcpu-arch.gpr[0]);
 
 I think the preffered style is printk(KERN_ERR ...)  You've made the
 same style mistake in most of you printk()'s in your other patches
 aswell.

Note that these days people use pr_err() instead.

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:+32 (0)2 700 8453
Fax:  +32 (0)2 700 8622
E-mail:   [EMAIL PROTECTED]
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis 293-0376800-10 GEBA-BE-BB___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[PATCH 2/6] kvmppc: add hypercall infrastructure - host part

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

This adds the host portion of the hypercall infrastructure which receives
the guest calls - no specific hcall function is implemented in this patch.

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

[diffstat]
 arch/powerpc/kvm/emulate.c |   27 +++
 include/asm-powerpc/kvm_para.h |2 ++
 2 files changed, 29 insertions(+)

[diff]
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -203,6 +203,24 @@
kvmppc_set_msr(vcpu, vcpu-arch.srr1);
 }
 
+static int kvmppc_do_hypercall(struct kvm_vcpu *vcpu)
+{
+   int ret = 0;
+
+   switch (vcpu-arch.gpr[0]) {
+   default:
+   printk(KERN_ERRunknown hypercall %d\n, vcpu-arch.gpr[0]);
+   kvmppc_dump_vcpu(vcpu);
+   ret = -ENOSYS;
+   }
+
+   vcpu-arch.gpr[11] = ret;
+   vcpu-arch.pc += 4; /* Advance past hypercall instruction. */
+
+   return ret;
+}
+
+
 /* XXX to do:
  * lhax
  * lhaux
@@ -232,6 +250,15 @@
int advance = 1;
 
switch (get_op(inst)) {
+   case 0:
+   if (inst == KVM_HYPERCALL_BIN) {
+   kvmppc_do_hypercall(vcpu);
+   advance = 0; /* kvmppc_do_hypercall handles the PC. */
+   } else {
+   printk(KERN_ERRunknown op %d\n, get_op(inst));
+   emulated = EMULATE_FAIL;
+   }
+   break;
case 3: /* trap */
printk(trap!\n);
kvmppc_queue_exception(vcpu, BOOKE_INTERRUPT_PROGRAM);
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
@@ -22,6 +22,8 @@
 
 #ifdef __KERNEL__
 
+#define KVM_HYPERCALL_BIN 0x03ff
+
 static inline int kvm_para_available(void)
 {
return 0;
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/6] kvmppc: add hypercall infrastructure - host part

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

Hi Christian,
A few comments 

 diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
 --- a/arch/powerpc/kvm/emulate.c
 +++ b/arch/powerpc/kvm/emulate.c
 @@ -203,6 +203,24 @@
   kvmppc_set_msr(vcpu, vcpu-arch.srr1);
  }
  
 +static int kvmppc_do_hypercall(struct kvm_vcpu *vcpu)
 +{
 + int ret = 0;
 +
 + switch (vcpu-arch.gpr[0]) {
 + default:
 + printk(KERN_ERRunknown hypercall %d\n, vcpu-arch.gpr[0]);

I think the preffered style is printk(KERN_ERR ...)  You've made the
same style mistake in most of you printk()'s in your other patches
aswell.

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