Re: Current kernel fails to compile with KVM on PowerPC

2012-02-26 Thread Jörg Sommer
Jörg Sommer hat am Sat 25. Feb, 15:51 (+0100) geschrieben:
 Jörg Sommer hat am Tue 21. Feb, 09:32 (+0100) geschrieben:
  Alexander Graf hat am Mon 20. Feb, 22:27 (+0100) geschrieben:
   On 20.02.2012, at 18:38, Jörg Sommer wrote:
Alexander Graf hat am Tue 22. Nov, 22:29 (+0100) geschrieben:
On 22.11.2011, at 21:04, Jörg Sommer wrote:
[1] »kernel BUG at include/linux/kvm_host.h:603!«
http://www.mail-archive.com/kvm@vger.kernel.org/msg61433.html

This is unfortunately still there. It's because of preemption being
enabled. Please just use CONFIG_PREEMPT_NONE for the time being

This doesn't help. I've build with CONFIG_PREEMPT_NONE, but I'm getting
this Oops, when I start qemu.
   
   Could you please try git://git.kernel.org/pub/scm/virt/kvm/kvm.git? I
   fixed a bunch of things with preemption since then and it definitely
   worked for me. If it still fails in that tree, I can try again to
   reproduce it :).
  
  This kernel (e9badff4b38a3f8b2c20aa8a30db210caf85a497) fails to build:
  
CC [M]  arch/powerpc/kvm/book3s_pr.o
  arch/powerpc/kvm/book3s_pr.c: In function ‘kvm_vcpu_ioctl_get_one_reg’:
  arch/powerpc/kvm/book3s_pr.c:883:45: error: cast to pointer from integer of 
  different size [-Werror=int-to-pointer-cast]
  arch/powerpc/kvm/book3s_pr.c:883:80: error: cast to pointer from integer of 
  different size [-Werror=int-to-pointer-cast]
  arch/powerpc/kvm/book3s_pr.c:883:284: error: cast to pointer from integer 
  of different size [-Werror=int-to-pointer-cast]
  arch/powerpc/kvm/book3s_pr.c:883:327: error: cast to pointer from integer 
  of different size [-Werror=int-to-pointer-cast]
  arch/powerpc/kvm/book3s_pr.c:883:459: error: cast to pointer from integer 
  of different size [-Werror=int-to-pointer-cast]
  arch/powerpc/kvm/book3s_pr.c:883:748: error: cast to pointer from integer 
  of different size [-Werror=int-to-pointer-cast]
  arch/powerpc/kvm/book3s_pr.c:883:1112: error: cast to pointer from integer 
  of different size [-Werror=int-to-pointer-cast]
  arch/powerpc/kvm/book3s_pr.c:883:1476: error: cast to pointer from integer 
  of different size [-Werror=int-to-pointer-cast]
  arch/powerpc/kvm/book3s_pr.c:883:1867: error: cast to pointer from integer 
  of different size [-Werror=int-to-pointer-cast]

 @@ -652,6 +653,11 @@ static int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu 
 *vcpu,
 int r = -EINVAL;
  
 switch (reg-id) {
 +#ifdef CONFIG_PPC_BOOK3S
 +   case KVM_REG_PPC_HIOR:
 +   r = put_user(to_book3s(vcpu)-hior, (u64 __user *)reg-addr);
 +   break;
 +#endif
 default:
 break;
 }

Is this the right fix for this code?

diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index ee222ec..a5d061c 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -880,7 +880,7 @@ int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, 
struct kvm_one_reg *reg)
 
switch (reg-id) {
case KVM_REG_PPC_HIOR:
-   r = put_user(to_book3s(vcpu)-hior, (u64 __user *)reg-addr);
+   r = put_user(to_book3s(vcpu)-hior, (u64 __user *)reg-addr);
break;
default:
break;
@@ -895,7 +895,7 @@ int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, 
struct kvm_one_reg *reg)
 
switch (reg-id) {
case KVM_REG_PPC_HIOR:
-   r = get_user(to_book3s(vcpu)-hior, (u64 __user *)reg-addr);
+   r = get_user(to_book3s(vcpu)-hior, (u64 __user *)reg-addr);
if (!r)
to_book3s(vcpu)-hior_explicit = true;
break;

Bye, Jörg.
-- 
If Java had true garbage collection, most programs would delete
themselves upon execution


signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP


Re: Current kernel fails to compile with KVM on PowerPC

2012-02-26 Thread Alexander Graf

On 26.02.2012, at 01:06, Jörg Sommer wrote:

 Jörg Sommer hat am Sat 25. Feb, 15:51 (+0100) geschrieben:
 Jörg Sommer hat am Tue 21. Feb, 09:32 (+0100) geschrieben:
 Alexander Graf hat am Mon 20. Feb, 22:27 (+0100) geschrieben:
 On 20.02.2012, at 18:38, Jörg Sommer wrote:
 Alexander Graf hat am Tue 22. Nov, 22:29 (+0100) geschrieben:
 On 22.11.2011, at 21:04, Jörg Sommer wrote:
 [1] »kernel BUG at include/linux/kvm_host.h:603!«
 http://www.mail-archive.com/kvm@vger.kernel.org/msg61433.html
 
 This is unfortunately still there. It's because of preemption being
 enabled. Please just use CONFIG_PREEMPT_NONE for the time being
 
 This doesn't help. I've build with CONFIG_PREEMPT_NONE, but I'm getting
 this Oops, when I start qemu.
 
 Could you please try git://git.kernel.org/pub/scm/virt/kvm/kvm.git? I
 fixed a bunch of things with preemption since then and it definitely
 worked for me. If it still fails in that tree, I can try again to
 reproduce it :).
 
 This kernel (e9badff4b38a3f8b2c20aa8a30db210caf85a497) fails to build:
 
  CC [M]  arch/powerpc/kvm/book3s_pr.o
 arch/powerpc/kvm/book3s_pr.c: In function ‘kvm_vcpu_ioctl_get_one_reg’:
 arch/powerpc/kvm/book3s_pr.c:883:45: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:80: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:284: error: cast to pointer from integer 
 of different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:327: error: cast to pointer from integer 
 of different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:459: error: cast to pointer from integer 
 of different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:748: error: cast to pointer from integer 
 of different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:1112: error: cast to pointer from integer 
 of different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:1476: error: cast to pointer from integer 
 of different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:1867: error: cast to pointer from integer 
 of different size [-Werror=int-to-pointer-cast]
 
 @@ -652,6 +653,11 @@ static int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu 
 *vcpu,
int r = -EINVAL;
 
switch (reg-id) {
 +#ifdef CONFIG_PPC_BOOK3S
 +   case KVM_REG_PPC_HIOR:
 +   r = put_user(to_book3s(vcpu)-hior, (u64 __user *)reg-addr);
 +   break;
 +#endif
default:
break;
}
 
 Is this the right fix for this code?

The idea of the put/get_user is to access memory that is at the address 
reg-addr. The code works as expected on book3s_64 for me too, where 
sizeof(u64) == sizeof(ulong). On book3s_32 however, sizeof(ulong) is 4, which 
is not the same as the size of reg-addr, which is u64, thus 8.

So we need to tell the compiler to cut off the high 32 bits (because we can't 
access them anyways) and instead take the lower 32 bits as the pointer at which 
address we want to access things. That's basically what the patch I sent out 
earlier today did :).


Alex

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


Re: Current kernel fails to compile with KVM on PowerPC

2012-02-26 Thread Jörg Sommer
Alexander Graf hat am Sun 26. Feb, 12:43 (+0100) geschrieben:
 On 25.02.2012, at 15:51, Jörg Sommer wrote:
  Jörg Sommer hat am Tue 21. Feb, 09:32 (+0100) geschrieben:
  Alexander Graf hat am Mon 20. Feb, 22:27 (+0100) geschrieben:
  On 20.02.2012, at 18:38, Jörg Sommer wrote:
  Alexander Graf hat am Tue 22. Nov, 22:29 (+0100) geschrieben:
  On 22.11.2011, at 21:04, Jörg Sommer wrote:
  [1] »kernel BUG at include/linux/kvm_host.h:603!«
  http://www.mail-archive.com/kvm@vger.kernel.org/msg61433.html
  
  This is unfortunately still there. It's because of preemption being
  enabled. Please just use CONFIG_PREEMPT_NONE for the time being
  
  This doesn't help. I've build with CONFIG_PREEMPT_NONE, but I'm getting
  this Oops, when I start qemu.
  
  Could you please try git://git.kernel.org/pub/scm/virt/kvm/kvm.git? I
  fixed a bunch of things with preemption since then and it definitely
  worked for me. If it still fails in that tree, I can try again to
  reproduce it :).
  
  This kernel (e9badff4b38a3f8b2c20aa8a30db210caf85a497) fails to build:
  
   CC [M]  arch/powerpc/kvm/book3s_pr.o
  arch/powerpc/kvm/book3s_pr.c: In function ‘kvm_vcpu_ioctl_get_one_reg’:
  arch/powerpc/kvm/book3s_pr.c:883:45: error: cast to pointer from integer 
  of different size [-Werror=int-to-pointer-cast]
  arch/powerpc/kvm/book3s_pr.c:883:80: error: cast to pointer from integer 
  of different size [-Werror=int-to-pointer-cast]

 Yikes. Does this patch work for you?

 diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
 index ee222ec..f329eae 100644
 --- a/arch/powerpc/kvm/book3s_pr.c
 +++ b/arch/powerpc/kvm/book3s_pr.c
 @@ -880,7 +880,8 @@ int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, 
 struct kvm_one_reg *reg)
  
 switch (reg-id) {
 case KVM_REG_PPC_HIOR:
 -   r = put_user(to_book3s(vcpu)-hior, (u64 __user *)reg-addr);
 +   r = put_user(to_book3s(vcpu)-hior,
 +(u64 __user *)(long)reg-addr);

Yes and no. It brings me a step further, but not to a working kernel.

  CHK include/linux/version.h
  CHK include/generated/utsrelease.h
  CALLscripts/checksyscalls.sh
  CC [M]  arch/powerpc/kvm/book3s_pr.o
  LD [M]  arch/powerpc/kvm/kvm.o
  Building modules, stage 2.
  MODPOST 227 modules
ERROR: __get_user_bad [arch/powerpc/kvm/kvm.ko] undefined!
make[1]: *** [__modpost] Fehler 1
make: *** [modules] Fehler 2
-- 
Der Wille und nicht die Gabe macht den Geber.


signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP


Re: Current kernel fails to compile with KVM on PowerPC

2012-02-26 Thread Alexander Graf

On 27.02.2012, at 01:08, Jörg Sommer wrote:

 Alexander Graf hat am Sun 26. Feb, 12:43 (+0100) geschrieben:
 On 25.02.2012, at 15:51, Jörg Sommer wrote:
 Jörg Sommer hat am Tue 21. Feb, 09:32 (+0100) geschrieben:
 Alexander Graf hat am Mon 20. Feb, 22:27 (+0100) geschrieben:
 On 20.02.2012, at 18:38, Jörg Sommer wrote:
 Alexander Graf hat am Tue 22. Nov, 22:29 (+0100) geschrieben:
 On 22.11.2011, at 21:04, Jörg Sommer wrote:
 [1] »kernel BUG at include/linux/kvm_host.h:603!«
 http://www.mail-archive.com/kvm@vger.kernel.org/msg61433.html
 
 This is unfortunately still there. It's because of preemption being
 enabled. Please just use CONFIG_PREEMPT_NONE for the time being
 
 This doesn't help. I've build with CONFIG_PREEMPT_NONE, but I'm getting
 this Oops, when I start qemu.
 
 Could you please try git://git.kernel.org/pub/scm/virt/kvm/kvm.git? I
 fixed a bunch of things with preemption since then and it definitely
 worked for me. If it still fails in that tree, I can try again to
 reproduce it :).
 
 This kernel (e9badff4b38a3f8b2c20aa8a30db210caf85a497) fails to build:
 
 CC [M]  arch/powerpc/kvm/book3s_pr.o
 arch/powerpc/kvm/book3s_pr.c: In function ‘kvm_vcpu_ioctl_get_one_reg’:
 arch/powerpc/kvm/book3s_pr.c:883:45: error: cast to pointer from integer 
 of different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:80: error: cast to pointer from integer 
 of different size [-Werror=int-to-pointer-cast]
 
 Yikes. Does this patch work for you?
 
 diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
 index ee222ec..f329eae 100644
 --- a/arch/powerpc/kvm/book3s_pr.c
 +++ b/arch/powerpc/kvm/book3s_pr.c
 @@ -880,7 +880,8 @@ int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, 
 struct kvm_one_reg *reg)
 
switch (reg-id) {
case KVM_REG_PPC_HIOR:
 -   r = put_user(to_book3s(vcpu)-hior, (u64 __user *)reg-addr);
 +   r = put_user(to_book3s(vcpu)-hior,
 +(u64 __user *)(long)reg-addr);
 
 Yes and no. It brings me a step further, but not to a working kernel.
 
  CHK include/linux/version.h
  CHK include/generated/utsrelease.h
  CALLscripts/checksyscalls.sh
  CC [M]  arch/powerpc/kvm/book3s_pr.o
  LD [M]  arch/powerpc/kvm/kvm.o
  Building modules, stage 2.
  MODPOST 227 modules
 ERROR: __get_user_bad [arch/powerpc/kvm/kvm.ko] undefined!

Ah, because you can't get_user u64s I suppose. Sigh. As a quick hack, just 
comment out the get/put_user lines - you don't care about configuring HIOR on 
ppc32 anyways. I'll try to come up with something :)


Alex

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


Re: Current kernel fails to compile with KVM on PowerPC

2012-02-25 Thread Jörg Sommer
Jörg Sommer hat am Tue 21. Feb, 09:32 (+0100) geschrieben:
 Alexander Graf hat am Mon 20. Feb, 22:27 (+0100) geschrieben:
  On 20.02.2012, at 18:38, Jörg Sommer wrote:
   Alexander Graf hat am Tue 22. Nov, 22:29 (+0100) geschrieben:
   On 22.11.2011, at 21:04, Jörg Sommer wrote:
   [1] »kernel BUG at include/linux/kvm_host.h:603!«
   http://www.mail-archive.com/kvm@vger.kernel.org/msg61433.html
   
   This is unfortunately still there. It's because of preemption being
   enabled. Please just use CONFIG_PREEMPT_NONE for the time being
   
   This doesn't help. I've build with CONFIG_PREEMPT_NONE, but I'm getting
   this Oops, when I start qemu.
  
  Could you please try git://git.kernel.org/pub/scm/virt/kvm/kvm.git? I
  fixed a bunch of things with preemption since then and it definitely
  worked for me. If it still fails in that tree, I can try again to
  reproduce it :).
 
 This kernel (e9badff4b38a3f8b2c20aa8a30db210caf85a497) fails to build:
 
   CC [M]  arch/powerpc/kvm/book3s_pr.o
 arch/powerpc/kvm/book3s_pr.c: In function ‘kvm_vcpu_ioctl_get_one_reg’:
 arch/powerpc/kvm/book3s_pr.c:883:45: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:80: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:284: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:327: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:459: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:748: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:1112: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:1476: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:883:1867: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c: In function ‘kvm_vcpu_ioctl_set_one_reg’:
 arch/powerpc/kvm/book3s_pr.c:898:79: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:898:114: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:898:319: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:898:364: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:898:502: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:898:591: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 arch/powerpc/kvm/book3s_pr.c:898:2061: error: cast to pointer from integer of 
 different size [-Werror=int-to-pointer-cast]
 cc1: all warnings being treated as errors
 make[3]: *** [arch/powerpc/kvm/book3s_pr.o] Fehler 1
 make[2]: *** [arch/powerpc/kvm] Fehler 2
 make[2]: *** Warte auf noch nicht beendete Prozesse...

The culprit is this patch:

commit 784f1782e3c9cab310d6c513df966c547c3f17aa
Author: Alexander Graf ag...@suse.de
Date:   Wed Sep 14 21:45:23 2011 +0200

KVM: PPC: Add support for explicit HIOR setting

Until now, we always set HIOR based on the PVR, but this is just wrong.
Instead, we should be setting HIOR explicitly, so user space can decide
what the initial HIOR value is - just like on real hardware.

We keep the old PVR based way around for backwards compatibility, but
once user space uses the SET_ONE_REG based method, we drop the PVR logic.

Signed-off-by: Alexander Graf ag...@suse.de

diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 089c61b..5985209 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -212,6 +212,7 @@ int kvm_dev_ioctl_check_extension(long ext)
case KVM_CAP_PPC_BOOKE_SREGS:
 #else
case KVM_CAP_PPC_SEGSTATE:
+   case KVM_CAP_PPC_HIOR:
case KVM_CAP_PPC_PAPR:
 #endif
case KVM_CAP_PPC_UNSET_IRQ:
@@ -652,6 +653,11 @@ static int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu 
*vcpu,
int r = -EINVAL;
 
switch (reg-id) {
+#ifdef CONFIG_PPC_BOOK3S
+   case KVM_REG_PPC_HIOR:
+   r = put_user(to_book3s(vcpu)-hior, (u64 __user *)reg-addr);
+   break;
+#endif
default:
break;
}
@@ -665,6 +671,13 @@ static int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu 
*vcpu,
int r = -EINVAL;
 
switch (reg-id) {
+#ifdef CONFIG_PPC_BOOK3S
+   case KVM_ONE_REG_PPC_HIOR:
+   r = get_user(to_book3s(vcpu)-hior, 

Re: Current kernel fails to compile with KVM on PowerPC

2012-02-21 Thread Jörg Sommer
Alexander Graf hat am Mon 20. Feb, 22:27 (+0100) geschrieben:
 On 20.02.2012, at 18:38, Jörg Sommer wrote:
  Alexander Graf hat am Tue 22. Nov, 22:29 (+0100) geschrieben:
  On 22.11.2011, at 21:04, Jörg Sommer wrote:
  [1] »kernel BUG at include/linux/kvm_host.h:603!«
  http://www.mail-archive.com/kvm@vger.kernel.org/msg61433.html
  
  This is unfortunately still there. It's because of preemption being
  enabled. Please just use CONFIG_PREEMPT_NONE for the time being
  
  This doesn't help. I've build with CONFIG_PREEMPT_NONE, but I'm getting
  this Oops, when I start qemu.
 
 Could you please try git://git.kernel.org/pub/scm/virt/kvm/kvm.git? I
 fixed a bunch of things with preemption since then and it definitely
 worked for me. If it still fails in that tree, I can try again to
 reproduce it :).

This kernel (e9badff4b38a3f8b2c20aa8a30db210caf85a497) fails to build:

  CC [M]  arch/powerpc/kvm/book3s_pr.o
arch/powerpc/kvm/book3s_pr.c: In function ‘kvm_vcpu_ioctl_get_one_reg’:
arch/powerpc/kvm/book3s_pr.c:883:45: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:883:80: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:883:284: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:883:327: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:883:459: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:883:748: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:883:1112: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:883:1476: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:883:1867: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c: In function ‘kvm_vcpu_ioctl_set_one_reg’:
arch/powerpc/kvm/book3s_pr.c:898:79: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:898:114: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:898:319: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:898:364: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:898:502: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:898:591: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:898:2061: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
cc1: all warnings being treated as errors
make[3]: *** [arch/powerpc/kvm/book3s_pr.o] Fehler 1
make[2]: *** [arch/powerpc/kvm] Fehler 2
make[2]: *** Warte auf noch nicht beendete Prozesse...

Schöne Grüße, Jörg.
-- 
Manchmal denke ich, das sicherste Indiz dafür, daß anderswo im Universum
intelligentes Leben existiert, ist, daß niemand versucht hat, mit uns
Kontakt aufzunehmen.   (Calvin und Hobbes)


signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP


Re: Current kernel fails to compile with KVM on PowerPC

2012-02-20 Thread Jörg Sommer
Hello Alexander,

Alexander Graf hat am Tue 22. Nov, 22:29 (+0100) geschrieben:
 On 22.11.2011, at 21:04, Jörg Sommer wrote:
  Jörg Sommer hat am Mon 07. Nov, 20:48 (+0100) geschrieben:
  I'm trying to build the kernel with the git commit-id
  31555213f03bca37d2c02e10946296052f4ecfcd, but it fails
  
   CHK include/linux/version.h
   HOSTCC  scripts/mod/modpost.o
   CHK include/generated/utsrelease.h
   UPD include/generated/utsrelease.h
   HOSTLD  scripts/mod/modpost
   GEN include/generated/bounds.h
   CC  arch/powerpc/kernel/asm-offsets.s
  In file included from arch/powerpc/kernel/asm-offsets.c:59:0:
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h: In function 
  ‘compute_tlbie_rb’:
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: error: 
  ‘HPTE_V_SECONDARY’ undeclared (first use in this function)
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: note: 
  each undeclared identifier is reported only once for each function it 
  appears in
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:396:12: error: 
  ‘HPTE_V_1TB_SEG’ undeclared (first use in this function)
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:401:10: error: 
  ‘HPTE_V_LARGE’ undeclared (first use in this function)
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:415:2: 
  warning: right shift count = width of type [enabled by default]
  make[3]: *** [arch/powerpc/kernel/asm-offsets.s] Fehler 1
  make[2]: *** [prepare0] Fehler 2
  make[1]: *** [deb-pkg] Fehler 2
  make: *** [deb-pkg] Fehler 2
  
  I'm still having this problem. I can' build
  6fe4c6d466e95d31164f14b1ac4aefb51f0f4f82. Are there any patches to
  make the kernel builds and do not oops [1] on PowerPC?
 
 The failures above should be fixed by now.
 
  [1] »kernel BUG at include/linux/kvm_host.h:603!«
   http://www.mail-archive.com/kvm@vger.kernel.org/msg61433.html
 
 This is unfortunately still there. It's because of preemption being
 enabled. Please just use CONFIG_PREEMPT_NONE for the time being

This doesn't help. I've build with CONFIG_PREEMPT_NONE, but I'm getting
this Oops, when I start qemu.

% uname -a
Linux ibook 3.3.0-rc3-00279-g8e4baad #74 Sun Feb 19 03:57:54 CET 2012 ppc 
GNU/Linux

% cat /proc/cpuinfo
processor   : 0
cpu : 7455, altivec supported
clock   : 606.00MHz
revision: 3.3 (pvr 8001 0303)
bogomips: 36.86
timebase: 18432000
platform: PowerMac
model   : PowerBook6,3
machine : PowerBook6,3
motherboard : PowerBook6,3 MacRISC3 Power Macintosh
detected as : 287 (iBook G4)
pmac flags  : 001b
L2 cache: 256K unified
pmac-generation : NewWorld
Memory  : 640 MB

% grep PREEM /boot/config-$(uname -r)
# CONFIG_PREEMPT_RCU is not set
CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
CONFIG_PREEMPT_COUNT=y

% qemu-system-ppc --version
QEMU emulator version 1.0 (Debian 1.0+dfsg-3), Copyright (c) 2003-2008 Fabrice 
Bellard

% qemu-system-ppc -M mac99 -cpu 7400 -prom-env 'auto-boot?=false' -k de 
-enable-kvm

[ 4205.444343] [ cut here ]
[ 4205.444373] kernel BUG at include/linux/kvm_host.h:634!
[ 4205.07] Oops: Exception in kernel mode, sig: 5 [#1]
[ 4205.18] PowerMac
[ 4205.26] Modules linked in: kvm ppp_async crc_ccitt ppp_generic slhc ipv6 
fuse snd_powermac option usb_wwan
[ 4205.444562] NIP: ea823c34 LR: ea823bcc CTR: 
[ 4205.444579] REGS: e3617a10 TRAP: 0700   Not tainted  
(3.3.0-rc3-00279-g8e4baad)
[ 4205.444590] MSR: 00029032 EE,ME,IR,DR,RI  CR: 28002462  XER: 
[ 4205.444624] TASK = e3405bc0[4169] 'qemu-system-ppc' THREAD: e3616000
[ 4205.444634] GPR00: 0001 e3617ac0 e3405bc0 e3617be0 e34060fc  
e3617ddc  
[ 4205.444664] GPR08:      1036c490 
103051b8 10304e48 
[ 4205.444693] GPR16: 48048000 10e2a5c0 10e2ada8 1014662c 0007 48021018 
0040 d032 
[ 4205.444723] GPR24:  0900  e362f000 0001 e3405bc0 
ea83b000 e3617ac0 
[ 4205.444817] NIP [ea823c34] kvmppc_vcpu_run+0x138/0x210 [kvm]
[ 4205.444843] LR [ea823bcc] kvmppc_vcpu_run+0xd0/0x210 [kvm]
[ 4205.444853] Call Trace:
[ 4205.444876] [e3617ac0] [e3616000] 0xe3616000 (unreliable)
[ 4205.444909] [e3617e20] [ea81e12c] kvm_arch_vcpu_ioctl_run+0x350/0x37c [kvm]
[ 4205.444940] [e3617e50] [ea817c98] kvm_vcpu_ioctl+0x158/0x888 [kvm]
[ 4205.444967] [e3617ea0] [c0129020] do_vfs_ioctl+0x714/0x78c
[ 4205.444984] [e3617f10] [c0129100] sys_ioctl+0x68/0x8c
[ 4205.445004] [e3617f40] [c0013b70] ret_from_syscall+0x0/0x38
[ 4205.445022] --- Exception: c01 at 0xf4efa98
[ 4205.445028] LR = 0xf4ef9fc
[ 4205.445036] Instruction dump:
[ 4205.445049] 41a20014 7fc3f378 38800800 38a02000 4bffe929 54290024 3800 
8129000c 
[ 4205.445080] 2f89 409e000c 7ca6 54008ffe 0f00 8002000c 7f63db78 
7fc4f378 
[ 

Re: Current kernel fails to compile with KVM on PowerPC

2011-12-26 Thread Alexander Graf

On 25.12.2011, at 12:01, Jörg Sommer wrote:

 Alexander Graf hat am Sat 24. Dec, 18:05 (+0100) geschrieben:
 On 24.12.2011, at 12:13, Jörg Sommer wrote:
 Jörg Sommer hat am Sat 24. Dec, 11:31 (+0100) geschrieben:
 Alexander Graf hat am Fri 23. Dec, 14:50 (+0100) geschrieben:
 On 20.12.2011, at 21:27, Jörg Sommer wrote:
 
 I'm so sorry to have to report a new bug in one of your patches. It was
 covered by the one above. I've picked the commit for it from your git
 repository and now, the kernel build fails with this error:
 
 BOOTCC  arch/powerpc/boot/fdt_strerror.o
 BOOTAR  arch/powerpc/boot/wrapper.a
 WRAParch/powerpc/boot/zImage.pmac
 WRAParch/powerpc/boot/zImage.coff
 ERROR: kvmppc_h_pr [arch/powerpc/kvm/kvm.ko] undefined!
 make[3]: *** [__modpost] Fehler 1
 make[2]: *** [modules] Fehler 2
 make[2]: *** Warte auf noch nicht beendete Prozesse...
 WRAParch/powerpc/boot/zImage.miboot
 make[1]: *** [deb-pkg] Fehler 2
 make: *** [deb-pkg] Fehler 2
 
 I was actually thinking of:
 
 commit dfc209648daf8ba4197e71376b76c95fd26fd272
 Author: Andreas Schwab sch...@linux-m68k.org
 Date:   Tue Nov 8 07:17:39 2011 +
 
 But yes :). I guess we need to make sure this commit also lands in 3.2 :(.
 
 So there are at least two commits they must go into 3.2 to make the
 kernel build again, from my point of view:
 
 • KVM: PPC: protect use of kvmppc_h_pr
 • KVM: PPC: move compute_tlbie_rb to book3s_64 common header

Yup, thanks :). All compile fixes that piled up in my tree are now with Avi to 
push to 3.2 :).


Alex

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


Re: Current kernel fails to compile with KVM on PowerPC

2011-12-25 Thread Avi Kivity
On 12/24/2011 07:05 PM, Alexander Graf wrote:
 I was actually thinking of:

 commit dfc209648daf8ba4197e71376b76c95fd26fd272
 Author: Andreas Schwab sch...@linux-m68k.org
 Date:   Tue Nov 8 07:17:39 2011 +

 KVM: PPC: protect use of kvmppc_h_pr
 
 kvmppc_h_pr is only available if CONFIG_KVM_BOOK3S_64_PR.
 
 Signed-off-by: Andreas Schwab sch...@linux-m68k.org
 Signed-off-by: Alexander Graf ag...@suse.de

 diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
 index 72559b0..aaefe19 100644
 --- a/arch/powerpc/kvm/book3s_pr.c
 +++ b/arch/powerpc/kvm/book3s_pr.c
 @@ -660,10 +660,12 @@ program_interrupt:
 ulong cmd = kvmppc_get_gpr(vcpu, 3);
 int i;
  
 +#ifdef CONFIG_KVM_BOOK3S_64_PR
 if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) {
 r = RESUME_GUEST;
 break;
 }
 +#endif
  
 run-papr_hcall.nr = cmd;
 for (i = 0; i  9; ++i) {

 But yes :). I guess we need to make sure this commit also lands in 3.2 :(.



Please post it ASAP, I'm preparing a pull request for 3.2.

-- 
error compiling committee.c: too many arguments to function

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


Re: Current kernel fails to compile with KVM on PowerPC

2011-12-25 Thread Jörg Sommer
Alexander Graf hat am Sat 24. Dec, 18:05 (+0100) geschrieben:
 On 24.12.2011, at 12:13, Jörg Sommer wrote:
  Jörg Sommer hat am Sat 24. Dec, 11:31 (+0100) geschrieben:
  Alexander Graf hat am Fri 23. Dec, 14:50 (+0100) geschrieben:
  On 20.12.2011, at 21:27, Jörg Sommer wrote:
  
  I'm so sorry to have to report a new bug in one of your patches. It was
  covered by the one above. I've picked the commit for it from your git
  repository and now, the kernel build fails with this error:
  
  BOOTCC  arch/powerpc/boot/fdt_strerror.o
  BOOTAR  arch/powerpc/boot/wrapper.a
  WRAParch/powerpc/boot/zImage.pmac
  WRAParch/powerpc/boot/zImage.coff
  ERROR: kvmppc_h_pr [arch/powerpc/kvm/kvm.ko] undefined!
  make[3]: *** [__modpost] Fehler 1
  make[2]: *** [modules] Fehler 2
  make[2]: *** Warte auf noch nicht beendete Prozesse...
  WRAParch/powerpc/boot/zImage.miboot
  make[1]: *** [deb-pkg] Fehler 2
  make: *** [deb-pkg] Fehler 2

 I was actually thinking of:
 
 commit dfc209648daf8ba4197e71376b76c95fd26fd272
 Author: Andreas Schwab sch...@linux-m68k.org
 Date:   Tue Nov 8 07:17:39 2011 +

 But yes :). I guess we need to make sure this commit also lands in 3.2 :(.

So there are at least two commits they must go into 3.2 to make the
kernel build again, from my point of view:

• KVM: PPC: protect use of kvmppc_h_pr
• KVM: PPC: move compute_tlbie_rb to book3s_64 common header

Bye, Jörg.
-- 
And 1.1.81 is officially BugFree(tm), so if you receive any bug-reports
on it, you know they are just evil lies.
(Linus Torvalds)


signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP


Re: Current kernel fails to compile with KVM on PowerPC

2011-12-24 Thread Jörg Sommer
Alexander Graf hat am Fri 23. Dec, 14:50 (+0100) geschrieben:
 On 20.12.2011, at 21:27, Jörg Sommer wrote:
   BOOTCC  arch/powerpc/boot/fdt_strerror.o
   BOOTAR  arch/powerpc/boot/wrapper.a
   WRAParch/powerpc/boot/zImage.pmac
   WRAParch/powerpc/boot/zImage.coff
  ERROR: kvmppc_h_pr [arch/powerpc/kvm/kvm.ko] undefined!
  make[3]: *** [__modpost] Fehler 1
  make[2]: *** [modules] Fehler 2
  make[2]: *** Warte auf noch nicht beendete Prozesse...
   WRAParch/powerpc/boot/zImage.miboot
  make[1]: *** [deb-pkg] Fehler 2
  make: *** [deb-pkg] Fehler 2
 
 This is odd. kvmppc_h_pr shouldn't be accessed when not in book3s_64_pr mode:
 
 #ifdef CONFIG_KVM_BOOK3S_64_PR
 if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) {
 r = RESUME_GUEST;
 break;
 }
 #endif

I had simply reverted the commit a668f2bd3f14ce7f92e119f4b5d9b50cdc59e855
and now, I get these lines:

[  539.183154] BUG: sleeping function called from invalid context at 
/home/joerg/kein_Backup/git/linux/arch/powerpc/include/asm/uaccess.h:438
[  539.183193] in_atomic(): 1, irqs_disabled(): 0, pid: 1889, name: 
qemu-system-ppc
[  539.183205] Call Trace:
[  539.183231] [e33f5e00] [c000bcf4] show_stack+0xbc/0x194 (unreliable)
[  539.183253] [e33f5e50] [c04601cc] dump_stack+0x30/0x38
[  539.183277] [e33f5e60] [c0033edc] __might_sleep+0xf8/0x100
[  539.183302] [e33f5e70] [c0053f70] copy_siginfo_to_user+0x64/0x5ac
[  539.183320] [e33f5e90] [c00547ac] sys_rt_sigtimedwait+0x124/0x168
[  539.183337] [e33f5f40] [c0013c70] ret_from_syscall+0x0/0x38
[  539.183378] --- Exception: c01 at 0xf5bbd34
[  539.183383] LR = 0x1000eea4
[  539.183886] BUG: scheduling while atomic: qemu-system-ppc/1889/0x1003
[  539.183901] Modules linked in: kvm ipv6 fuse option usb_wwan usbserial 
snd_powermac b43 mac80211 snd_aoa_i2sbus snd_pcm_oss snd_mixer_oss snd_pcm 
snd_page_alloc snd_seq cfg80211 firewire_ohci usb_storage sr_mod evdev 
firewire_core rng_core snd_timer snd_seq_device snd pmac_zilog cdrom crc_itu_t 
serial_core soundcore ssb snd_aoa_soundbus
[  539.184000] Call Trace:
[  539.184018] [e33f5630] [c000bcf4] show_stack+0xbc/0x194 (unreliable)
[  539.184038] [e33f5680] [c04601cc] dump_stack+0x30/0x38
[  539.184054] [e33f5690] [c0460628] __schedule_bug+0x68/0x70
[  539.184074] [e33f56a0] [c0456af0] __schedule+0x94/0x55c
[  539.184094] [e33f57a0] [c00361b0] __cond_resched+0x34/0x48
[  539.184110] [e33f57b0] [c0457074] _cond_resched+0x48/0x54
[  539.184138] [e33f57c0] [c00e8ce0] __get_user_pages+0x3c8/0x488
[  539.184155] [e33f5830] [c00e8e64] get_user_pages+0x60/0x68
[  539.184181] [e33f5840] [c001b028] get_user_pages_fast+0x144/0x190
[  539.184238] [e33f5890] [ea4458f8] hva_to_pfn.isra.40+0x124/0x344 [kvm]
[  539.184269] [e33f58d0] [ea445bd4] __gfn_to_pfn+0xbc/0xc4 [kvm]
[  539.184298] [e33f58f0] [ea445c54] gfn_to_pfn+0x38/0x40 [kvm]
[  539.184334] [e33f5900] [ea44de78] kvmppc_gfn_to_pfn+0xb8/0xc8 [kvm]
[  539.184363] [e33f5920] [ea4520fc] kvmppc_mmu_map_page+0x3c/0x274 [kvm]
[  539.184393] [e33f5970] [ea44ed28] kvmppc_handle_pagefault+0x264/0x3d0 [kvm]
[  539.184423] [e33f59c0] [ea44f254] kvmppc_handle_exit+0x250/0x734 [kvm]
[  539.184452] [e33f5a00] [ea450e5c] kvmppc_handler_highmem+0x5c/0x6c [kvm]
[  539.184481] [e33f5ac0] [ea44fc94] kvmppc_vcpu_run+0x164/0x224 [kvm]
[  539.184511] [e33f5e20] [ea44a1bc] kvm_arch_vcpu_ioctl_run+0x350/0x37c [kvm]
[  539.184542] [e33f5e50] [ea4441b4] kvm_vcpu_ioctl+0x158/0xa08 [kvm]
[  539.184565] [e33f5ea0] [c011e508] do_vfs_ioctl+0x730/0x7a8
[  539.184581] [e33f5f10] [c011e5e8] sys_ioctl+0x68/0x8c
[  539.184597] [e33f5f40] [c0013c70] ret_from_syscall+0x0/0x38
[  539.184620] --- Exception: c01 at 0xf668048
[  539.184625] LR = 0xf667fac
[  539.190159] Page fault in user mode with in_atomic() = 1 mm = e3398c40
[  539.192448] NIP = 10029af0  MSR = d032
[  539.194530] BUG: scheduling while atomic: qemu-system-ppc/1889/0x1003
[  539.196654] Modules linked in: kvm ipv6 fuse option usb_wwan usbserial 
snd_powermac b43 mac80211 snd_aoa_i2sbus snd_pcm_oss snd_mixer_oss snd_pcm 
snd_page_alloc snd_seq cfg80211 firewire_ohci usb_storage sr_mod evdev 
firewire_core rng_core snd_timer snd_seq_device snd pmac_zilog cdrom crc_itu_t 
serial_core soundcore ssb snd_aoa_soundbus
[  539.203960] Call Trace:
[  539.205886] [e33f5c00] [c000bcf4] show_stack+0xbc/0x194 (unreliable)
[  539.207936] [e33f5c50] [c04601cc] dump_stack+0x30/0x38
[  539.209939] [e33f5c60] [c0460628] __schedule_bug+0x68/0x70
[  539.211968] [e33f5c70] [c0456af0] __schedule+0x94/0x55c
[  539.214000] [e33f5d70] [c00361b0] __cond_resched+0x34/0x48
[  539.216042] [e33f5d80] [c0457074] _cond_resched+0x48/0x54
[  539.218100] [e33f5d90] [c0458404] mutex_lock+0x3c/0x64
[  539.220162] [e33f5da0] [c000edcc] die+0xb4/0x244
[  539.222161] [e33f5dd0] [c045a1f4] do_page_fault+0x168/0x5e0
[  539.224146] [e33f5f40] [c00140a0] handle_page_fault+0xc/0x80
[  539.226148] --- 

Re: Current kernel fails to compile with KVM on PowerPC

2011-12-24 Thread Jörg Sommer
Alexander Graf hat am Fri 23. Dec, 14:50 (+0100) geschrieben:
 On 20.12.2011, at 21:27, Jörg Sommer wrote:
  Jörg Sommer hat am Mon 07. Nov, 20:48 (+0100) geschrieben:
   CHK include/linux/version.h
   HOSTCC  scripts/mod/modpost.o
   CHK include/generated/utsrelease.h
   UPD include/generated/utsrelease.h
   HOSTLD  scripts/mod/modpost
   GEN include/generated/bounds.h
   CC  arch/powerpc/kernel/asm-offsets.s
  In file included from arch/powerpc/kernel/asm-offsets.c:59:0:
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h: In function 
  ‘compute_tlbie_rb’:
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: error: 
  ‘HPTE_V_SECONDARY’ undeclared (first use in this function)
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: note: 
  each undeclared identifier is reported only once for each function it 
  appears in
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:396:12: error: 
  ‘HPTE_V_1TB_SEG’ undeclared (first use in this function)
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:401:10: error: 
  ‘HPTE_V_LARGE’ undeclared (first use in this function)
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:415:2: 
  warning: right shift count = width of type [enabled by default]
  make[3]: *** [arch/powerpc/kernel/asm-offsets.s] Fehler 1
  make[2]: *** [prepare0] Fehler 2
  make[1]: *** [deb-pkg] Fehler 2
  make: *** [deb-pkg] Fehler 2
  
  I'm so sorry to have to report a new bug in one of your patches. It was
  covered by the one above. I've picked the commit for it from your git
  repository and now, the kernel build fails with this error:
  
   BOOTCC  arch/powerpc/boot/fdt_strerror.o
   BOOTAR  arch/powerpc/boot/wrapper.a
   WRAParch/powerpc/boot/zImage.pmac
   WRAParch/powerpc/boot/zImage.coff
  ERROR: kvmppc_h_pr [arch/powerpc/kvm/kvm.ko] undefined!
  make[3]: *** [__modpost] Fehler 1
  make[2]: *** [modules] Fehler 2
  make[2]: *** Warte auf noch nicht beendete Prozesse...
   WRAParch/powerpc/boot/zImage.miboot
  make[1]: *** [deb-pkg] Fehler 2
  make: *** [deb-pkg] Fehler 2
 
 This is odd. kvmppc_h_pr shouldn't be accessed when not in book3s_64_pr mode:
 
 #ifdef CONFIG_KVM_BOOK3S_64_PR
 if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) {
 r = RESUME_GUEST;
 break;
 }
 #endif

But that's not the code from the named commit:

commit a668f2bd3f14ce7f92e119f4b5d9b50cdc59e855
Author: Alexander Graf ag...@suse.de
Date:   Mon Aug 8 17:26:24 2011 +0200

KVM: PPC: Support SC1 hypercalls for PAPR in PR mode

PAPR defines hypercalls as SC1 instructions. Using these, the guest modifies
page tables and does other privileged operations that it wouldn't be allowed
to do in supervisor mode.

This patch adds support for PR KVM to trap these instructions and route them
through the same PAPR hypercall interface that we already use for HV style
KVM.

Signed-off-by: Alexander Graf ag...@suse.de

diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 78dcf65..48558f6 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -648,7 +648,27 @@ program_interrupt:
break;
}
case BOOK3S_INTERRUPT_SYSCALL:
-   if (vcpu-arch.osi_enabled 
+   if (vcpu-arch.papr_enabled 
+   (kvmppc_get_last_inst(vcpu) == 0x4422) 
+   !(vcpu-arch.shared-msr  MSR_PR)) {
+   /* SC 1 papr hypercalls */
+   ulong cmd = kvmppc_get_gpr(vcpu, 3);
+   int i;
+
+   if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) {
+   r = RESUME_GUEST;
+   break;
+   }
+

Here are the preprocessor conditions are missing.

 Could you please send me your .config?

CONFIG_PPC_BOOK3S_32=y
CONFIG_PPC_BOOK3S=y
CONFIG_6xx=y
CONFIG_PPC_FPU=y
CONFIG_ALTIVEC=y
CONFIG_PPC_STD_MMU=y
CONFIG_PPC_STD_MMU_32=y
CONFIG_PPC_HAVE_PMU_SUPPORT=y
CONFIG_PPC_PERF_CTRS=y
CONFIG_PPC32=y
CONFIG_32BIT=y
CONFIG_WORD_SIZE=32
CONFIG_MMU=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_NR_IRQS=512
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_ARCH_HAS_ILOG2_U32=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_PPC=y
CONFIG_EARLY_PRINTK=y
CONFIG_GENERIC_NVRAM=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_PPC_OF=y
CONFIG_AUDIT_ARCH=y
CONFIG_GENERIC_BUG=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
CONFIG_HAVE_IRQ_WORK=y

Re: Current kernel fails to compile with KVM on PowerPC

2011-12-24 Thread Alexander Graf

On 24.12.2011, at 12:13, Jörg Sommer wrote:

 Jörg Sommer hat am Sat 24. Dec, 11:31 (+0100) geschrieben:
 Alexander Graf hat am Fri 23. Dec, 14:50 (+0100) geschrieben:
 On 20.12.2011, at 21:27, Jörg Sommer wrote:
 Jörg Sommer hat am Mon 07. Nov, 20:48 (+0100) geschrieben:
 CHK include/linux/version.h
 HOSTCC  scripts/mod/modpost.o
 CHK include/generated/utsrelease.h
 UPD include/generated/utsrelease.h
 HOSTLD  scripts/mod/modpost
 GEN include/generated/bounds.h
 CC  arch/powerpc/kernel/asm-offsets.s
 In file included from arch/powerpc/kernel/asm-offsets.c:59:0:
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h: In function 
 ‘compute_tlbie_rb’:
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: 
 error: ‘HPTE_V_SECONDARY’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: note: 
 each undeclared identifier is reported only once for each function it 
 appears in
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:396:12: 
 error: ‘HPTE_V_1TB_SEG’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:401:10: 
 error: ‘HPTE_V_LARGE’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:415:2: 
 warning: right shift count = width of type [enabled by default]
 make[3]: *** [arch/powerpc/kernel/asm-offsets.s] Fehler 1
 make[2]: *** [prepare0] Fehler 2
 make[1]: *** [deb-pkg] Fehler 2
 make: *** [deb-pkg] Fehler 2
 
 I'm so sorry to have to report a new bug in one of your patches. It was
 covered by the one above. I've picked the commit for it from your git
 repository and now, the kernel build fails with this error:
 
 BOOTCC  arch/powerpc/boot/fdt_strerror.o
 BOOTAR  arch/powerpc/boot/wrapper.a
 WRAParch/powerpc/boot/zImage.pmac
 WRAParch/powerpc/boot/zImage.coff
 ERROR: kvmppc_h_pr [arch/powerpc/kvm/kvm.ko] undefined!
 make[3]: *** [__modpost] Fehler 1
 make[2]: *** [modules] Fehler 2
 make[2]: *** Warte auf noch nicht beendete Prozesse...
 WRAParch/powerpc/boot/zImage.miboot
 make[1]: *** [deb-pkg] Fehler 2
 make: *** [deb-pkg] Fehler 2
 
 This is odd. kvmppc_h_pr shouldn't be accessed when not in book3s_64_pr 
 mode:
 
 #ifdef CONFIG_KVM_BOOK3S_64_PR
if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) {
r = RESUME_GUEST;
break;
}
 #endif
 
 Is this the change you've thought of?
 
 commit b8624f11e94dd9c2280cb01bf2ede31e4316477d
 Author: Jörg Sommer jo...@alea.gnuu.de
 Date:   Sat Dec 24 12:03:03 2011 +0100
 
KVM: PPC: Use kvmppc_h_pr only if it's available
 
The function kvmppc_h_pr() is only available when the config option
CONFIG_KVM_BOOK3S_64_PR is set, which is not the case for 32-bit PowerPCs
for example. Building the kernel for these systems failed, because the
symbol could not be resolved.
 
ERROR: kvmppc_h_pr [arch/powerpc/kvm/kvm.ko] undefined!
 
Signed-off-by: Jörg Sommer jo...@alea.gnuu.de
 
 diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
 index 4b0f01b..eddab24 100644
 --- a/arch/powerpc/kvm/book3s_pr.c
 +++ b/arch/powerpc/kvm/book3s_pr.c
 @@ -677,10 +677,12 @@ program_interrupt:
   ulong cmd = kvmppc_get_gpr(vcpu, 3);
   int i;
 
 +#ifdef CONFIG_KVM_BOOK3S_64_PR
   if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) {
   r = RESUME_GUEST;
   break;
   }
 +#endif
 
   run-papr_hcall.nr = cmd;
   for (i = 0; i  9; ++i) {


I was actually thinking of:

commit dfc209648daf8ba4197e71376b76c95fd26fd272
Author: Andreas Schwab sch...@linux-m68k.org
Date:   Tue Nov 8 07:17:39 2011 +

KVM: PPC: protect use of kvmppc_h_pr

kvmppc_h_pr is only available if CONFIG_KVM_BOOK3S_64_PR.

Signed-off-by: Andreas Schwab sch...@linux-m68k.org
Signed-off-by: Alexander Graf ag...@suse.de

diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 72559b0..aaefe19 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -660,10 +660,12 @@ program_interrupt:
ulong cmd = kvmppc_get_gpr(vcpu, 3);
int i;
 
+#ifdef CONFIG_KVM_BOOK3S_64_PR
if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) {
r = RESUME_GUEST;
break;
}
+#endif
 
run-papr_hcall.nr = cmd;
for (i = 0; i  9; ++i) {

But yes :). I guess we need to make sure this commit also lands in 3.2 :(.


Alex

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  

Re: Current kernel fails to compile with KVM on PowerPC

2011-12-20 Thread Jörg Sommer
Hello Alexander,

Jörg Sommer hat am Mon 07. Nov, 20:48 (+0100) geschrieben:
   CHK include/linux/version.h
   HOSTCC  scripts/mod/modpost.o
   CHK include/generated/utsrelease.h
   UPD include/generated/utsrelease.h
   HOSTLD  scripts/mod/modpost
   GEN include/generated/bounds.h
   CC  arch/powerpc/kernel/asm-offsets.s
 In file included from arch/powerpc/kernel/asm-offsets.c:59:0:
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h: In function 
 ‘compute_tlbie_rb’:
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: error: 
 ‘HPTE_V_SECONDARY’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: note: 
 each undeclared identifier is reported only once for each function it appears 
 in
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:396:12: error: 
 ‘HPTE_V_1TB_SEG’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:401:10: error: 
 ‘HPTE_V_LARGE’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:415:2: warning: 
 right shift count = width of type [enabled by default]
 make[3]: *** [arch/powerpc/kernel/asm-offsets.s] Fehler 1
 make[2]: *** [prepare0] Fehler 2
 make[1]: *** [deb-pkg] Fehler 2
 make: *** [deb-pkg] Fehler 2

I'm so sorry to have to report a new bug in one of your patches. It was
covered by the one above. I've picked the commit for it from your git
repository and now, the kernel build fails with this error:

  BOOTCC  arch/powerpc/boot/fdt_strerror.o
  BOOTAR  arch/powerpc/boot/wrapper.a
  WRAParch/powerpc/boot/zImage.pmac
  WRAParch/powerpc/boot/zImage.coff
ERROR: kvmppc_h_pr [arch/powerpc/kvm/kvm.ko] undefined!
make[3]: *** [__modpost] Fehler 1
make[2]: *** [modules] Fehler 2
make[2]: *** Warte auf noch nicht beendete Prozesse...
  WRAParch/powerpc/boot/zImage.miboot
make[1]: *** [deb-pkg] Fehler 2
make: *** [deb-pkg] Fehler 2

The bug was introduced by this commit

HEAD is now at aacf9aa KVM: PPC: Stub emulate CFAR and PURR SPRs
a668f2bd3f14ce7f92e119f4b5d9b50cdc59e855 is the first bad commit
commit a668f2bd3f14ce7f92e119f4b5d9b50cdc59e855
Author: Alexander Graf ag...@suse.de
Date:   Mon Aug 8 17:26:24 2011 +0200

KVM: PPC: Support SC1 hypercalls for PAPR in PR mode

PAPR defines hypercalls as SC1 instructions. Using these, the guest modifies
page tables and does other privileged operations that it wouldn't be allowed
to do in supervisor mode.

This patch adds support for PR KVM to trap these instructions and route them
through the same PAPR hypercall interface that we already use for HV style
KVM.

Signed-off-by: Alexander Graf ag...@suse.de

Bye, Jörg.
-- 
“Perl—the only language that looks the same
 before and after RSA encryption.”   (Keith Bostic)


signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP


Re: Current kernel fails to compile with KVM on PowerPC

2011-12-11 Thread Jörg Sommer
Alexander Graf hat am Tue 22. Nov, 22:29 (+0100) geschrieben:
 On 22.11.2011, at 21:04, Jörg Sommer wrote:
  Jörg Sommer hat am Mon 07. Nov, 20:48 (+0100) geschrieben:
  I'm trying to build the kernel with the git commit-id
  31555213f03bca37d2c02e10946296052f4ecfcd, but it fails
  
   CHK include/linux/version.h
   HOSTCC  scripts/mod/modpost.o
   CHK include/generated/utsrelease.h
   UPD include/generated/utsrelease.h
   HOSTLD  scripts/mod/modpost
   GEN include/generated/bounds.h
   CC  arch/powerpc/kernel/asm-offsets.s
  In file included from arch/powerpc/kernel/asm-offsets.c:59:0:
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h: In function 
  ‘compute_tlbie_rb’:
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: error: 
  ‘HPTE_V_SECONDARY’ undeclared (first use in this function)
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: note: 
  each undeclared identifier is reported only once for each function it 
  appears in
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:396:12: error: 
  ‘HPTE_V_1TB_SEG’ undeclared (first use in this function)
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:401:10: error: 
  ‘HPTE_V_LARGE’ undeclared (first use in this function)
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:415:2: 
  warning: right shift count = width of type [enabled by default]
  make[3]: *** [arch/powerpc/kernel/asm-offsets.s] Fehler 1
  make[2]: *** [prepare0] Fehler 2
  make[1]: *** [deb-pkg] Fehler 2
  make: *** [deb-pkg] Fehler 2
  
  I'm still having this problem. I can' build
  6fe4c6d466e95d31164f14b1ac4aefb51f0f4f82. Are there any patches to
  make the kernel builds and do not oops [1] on PowerPC?
 
 The failures above should be fixed by now.

I've pulled git://git.kernel.org/pub/scm/virt/kvm/kvm.git
(a41d08d13f903da5c633fc58ee074156f05ab3ce), but this tree doesn't contain
a suitable commit. Where can I find it?

Bye, Jörg.
-- 
 Ich kenn mich mit OpenBSD kaum aus, was sind denn da so die
 Vorteile gegenueber Linux und iptables?
Der Fuchsschwanzeffekt ist größer. :-
Message-ID: slrnb11064.54g.hsch...@humbert.ddns.org


signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP


Re: Current kernel fails to compile with KVM on PowerPC

2011-12-11 Thread Alexander Graf

On 11.12.2011, at 16:16, Jörg Sommer wrote:

 Alexander Graf hat am Tue 22. Nov, 22:29 (+0100) geschrieben:
 On 22.11.2011, at 21:04, Jörg Sommer wrote:
 Jörg Sommer hat am Mon 07. Nov, 20:48 (+0100) geschrieben:
 I'm trying to build the kernel with the git commit-id
 31555213f03bca37d2c02e10946296052f4ecfcd, but it fails
 
 CHK include/linux/version.h
 HOSTCC  scripts/mod/modpost.o
 CHK include/generated/utsrelease.h
 UPD include/generated/utsrelease.h
 HOSTLD  scripts/mod/modpost
 GEN include/generated/bounds.h
 CC  arch/powerpc/kernel/asm-offsets.s
 In file included from arch/powerpc/kernel/asm-offsets.c:59:0:
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h: In function 
 ‘compute_tlbie_rb’:
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: error: 
 ‘HPTE_V_SECONDARY’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: note: 
 each undeclared identifier is reported only once for each function it 
 appears in
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:396:12: error: 
 ‘HPTE_V_1TB_SEG’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:401:10: error: 
 ‘HPTE_V_LARGE’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:415:2: 
 warning: right shift count = width of type [enabled by default]
 make[3]: *** [arch/powerpc/kernel/asm-offsets.s] Fehler 1
 make[2]: *** [prepare0] Fehler 2
 make[1]: *** [deb-pkg] Fehler 2
 make: *** [deb-pkg] Fehler 2
 
 I'm still having this problem. I can' build
 6fe4c6d466e95d31164f14b1ac4aefb51f0f4f82. Are there any patches to
 make the kernel builds and do not oops [1] on PowerPC?
 
 The failures above should be fixed by now.
 
 I've pulled git://git.kernel.org/pub/scm/virt/kvm/kvm.git
 (a41d08d13f903da5c633fc58ee074156f05ab3ce), but this tree doesn't contain
 a suitable commit. Where can I find it?

Please try:

  git://github.com/agraf/linux-2.6.git kvm-ppc-next

That's my WIP tree. I still have a few more patches I want to collect before 
shoving everything through automated testing and pushing it on to Avi.


Alex

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


Re: Current kernel fails to compile with KVM on PowerPC

2011-11-22 Thread Jörg Sommer
Hi,

Jörg Sommer hat am Mon 07. Nov, 20:48 (+0100) geschrieben:
 I'm trying to build the kernel with the git commit-id
 31555213f03bca37d2c02e10946296052f4ecfcd, but it fails
 
   CHK include/linux/version.h
   HOSTCC  scripts/mod/modpost.o
   CHK include/generated/utsrelease.h
   UPD include/generated/utsrelease.h
   HOSTLD  scripts/mod/modpost
   GEN include/generated/bounds.h
   CC  arch/powerpc/kernel/asm-offsets.s
 In file included from arch/powerpc/kernel/asm-offsets.c:59:0:
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h: In function 
 ‘compute_tlbie_rb’:
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: error: 
 ‘HPTE_V_SECONDARY’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: note: 
 each undeclared identifier is reported only once for each function it appears 
 in
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:396:12: error: 
 ‘HPTE_V_1TB_SEG’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:401:10: error: 
 ‘HPTE_V_LARGE’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:415:2: warning: 
 right shift count = width of type [enabled by default]
 make[3]: *** [arch/powerpc/kernel/asm-offsets.s] Fehler 1
 make[2]: *** [prepare0] Fehler 2
 make[1]: *** [deb-pkg] Fehler 2
 make: *** [deb-pkg] Fehler 2

I'm still having this problem. I can' build
6fe4c6d466e95d31164f14b1ac4aefb51f0f4f82. Are there any patches to
make the kernel builds and do not oops [1] on PowerPC?

[1] »kernel BUG at include/linux/kvm_host.h:603!«
  http://www.mail-archive.com/kvm@vger.kernel.org/msg61433.html

Bye, Jörg.
-- 
Das Recht, seine Meinung zu wechseln, ist eines der wichtigsten
menschlichen Privilegien.
(Robert Peel)


signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP


Re: Current kernel fails to compile with KVM on PowerPC

2011-11-07 Thread Avi Kivity
On 11/07/2011 09:48 PM, Jörg Sommer wrote:
 Hello everybody,

 I'm trying to build the kernel with the git commit-id
 31555213f03bca37d2c02e10946296052f4ecfcd, but it fails


Alex, can we set up some buildbots for the ppc family, feeding on
kvm.git master/next?

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

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


Re: Current kernel fails to compile with KVM on PowerPC

2011-11-07 Thread Alexander Graf

On 07.11.2011, at 21:16, Avi Kivity a...@redhat.com wrote:

 On 11/07/2011 09:48 PM, Jörg Sommer wrote:
 Hello everybody,
 
 I'm trying to build the kernel with the git commit-id
 31555213f03bca37d2c02e10946296052f4ecfcd, but it fails
 
 
 Alex, can we set up some buildbots for the ppc family, feeding on
 kvm.git master/next?

We already have a ppc box for qemu builds, so all we need is someone 
knowledgable in buildbot to also fetch kvm.git and build it in parallel to 
qemu.git :)

Alex

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