Re: Current kernel fails to compile with KVM on PowerPC
Alexander Graf hat am Mon 27. Feb, 01:30 (+0100) geschrieben: > 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 > :) I've removed these lines and got a kernel. But it crashes: # modprobe kvm # qemu-system-ppc -enable-kvm -curses [ 155.982144] BUG: sleeping function called from invalid context at arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:1078 [ 155.982552] in_atomic(): 0, irqs_disabled(): 1, pid: 1727, name: qemu-system-ppc [ 155.982807] Call Trace: [ 155.982916] [e31ad820] [c000bc44] show_stack+0xbc/0x194 (unreliable) [ 155.983175] [e31ad870] [c047bc2c] dump_stack+0x30/0x38 [ 155.983372] [e31ad880] [c0062070] __might_sleep+0xf8/0x100 [ 155.983620] [e31ad890] [ea6c1830] hva_to_pfn.isra.41+0xc0/0x340 [kvm] [ 155.983869] [e31ad8d0] [ea6c1b6c] __gfn_to_pfn+0xbc/0xc4 [kvm] [ 155.984110] [e31ad8f0] [ea6c1bec] gfn_to_pfn+0x38/0x40 [kvm] [ 155.984335] [e31ad900] [ea6c9f60] kvmppc_gfn_to_pfn+0xb8/0xc8 [kvm] [ 155.984571] [e31ad920] [ea6ce454] kvmppc_mmu_map_page+0x3c/0x274 [kvm] [ 155.984817] [e31ad970] [ea6cadc4] kvmppc_handle_pagefault+0x264/0x3d0 [kvm] [ 155.985083] [e31ad9c0] [ea6cb22c] kvmppc_handle_exit+0x18c/0x800 [kvm] [ 155.985329] [e31ada00] [ea6cd18c] kvmppc_handler_highmem+0x5c/0x6c [kvm] [ 155.985580] [e31adac0] [ea6cbebc] kvmppc_vcpu_run+0x184/0x244 [kvm] [ 155.985817] [e31ade20] [
Re: Current kernel fails to compile with KVM on PowerPC
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
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 *)®->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 *)®->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
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 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 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_
Re: Current kernel fails to compile with KVM on PowerPC
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
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 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.444
Re: Current kernel fails to compile with KVM on PowerPC
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 > 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
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 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 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) { -- „Es wurden und werden zu viele sprachlose Bücher gedruckt, nach deren schon flüchtiger Lektüre man all die Bäume um Vergebung bitten möchte, die für den Schund ihr Leben lassen mussten.“ (Michael Jürgs, Seichtgebiete – Warum wir hemmungslos verblöden) signature.asc Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP
Re: Current kernel fails to compile with KVM on PowerPC
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 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 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_LATENC
Re: Current kernel fails to compile with KVM on PowerPC
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.222
Re: Current kernel fails to compile with KVM on PowerPC
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 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 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
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: signature.asc Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP
Re: Current kernel fails to compile with KVM on PowerPC
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
Current kernel fails to compile with KVM on PowerPC
Hello everybody, 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 % uname -m ppc % grep -Ev '#|^$' .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 CONFIG_IRQ_WORK=y CONFIG_EXPERIMENTAL=y CONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE_SYSCTL=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y CONFIG_TASK_XACCT=y CONFIG_TASK_IO_ACCOUNTING=y CONFIG_AUDIT=y CONFIG_HAVE_GENERIC_HARDIRQS=y CONFIG_GENERIC_HARDIRQS=y CONFIG_HAVE_SPARSE_IRQ=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_IRQ_SHOW_LEVEL=y CONFIG_SPARSE_IRQ=y CONFIG_TINY_RCU=y CONFIG_LOG_BUF_SHIFT=16 CONFIG_CGROUPS=y CONFIG_CGROUP_FREEZER=y CONFIG_CGROUP_DEVICE=y CONFIG_CPUSETS=y CONFIG_CGROUP_CPUACCT=y CONFIG_RESOURCE_COUNTERS=y CONFIG_CGROUP_MEM_RES_CTLR=y CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED=y CONFIG_CGROUP_SCHED=y CONFIG_FAIR_GROUP_SCHED=y CONFIG_CFS_BANDWIDTH=y CONFIG_BLK_CGROUP=y CONFIG_NAMESPACES=y CONFIG_UTS_NS=y CONFIG_IPC_NS=y CONFIG_USER_NS=y CONFIG_PID_NS=y CONFIG_NET_NS=y CONFIG_SCHED_AUTOGROUP=y CONFIG_MM_OWNER=y CONFIG_RELAY=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y CONFIG_ANON_INODES=y CONFIG_KALLSYMS=y CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SIGNALFD=y CONFIG_TIMERFD=y CONFIG_EVENTFD=y CONFIG_SHMEM=y CONFIG_AIO=y CONFIG_HAVE_PERF_EVENTS=y CONFIG_PERF_EVENTS=y CONFIG_VM_EVENT_COUNTERS=y CONFIG_PCI_QUIRKS=y CONFIG_SLUB_DEBUG=y CONFIG_SLUB=y CONFIG_TRACEPOINTS=y CONFIG_HAVE_OPROFILE=y CONFIG_KPROBES=y CONFIG_JUMP_LABEL=y CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y CONFIG_KRETPROBES=y CONFIG_HAVE_IOREMAP_PROT=y CONFIG_HAVE_KPROBES=y CONFIG_HAVE_KRETPROBES=y CONFIG_HAVE_ARCH_TRACEHOOK=y CONFIG_HAVE_DMA_ATTRS=y CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_DMA_API_DEBUG=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_SLABINFO=y CONFIG_RT_MUTEXES=y CONFIG_BASE_SMALL=0 CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_BLOCK=y CONFIG_LBDAF=y CONFIG_BLK_DEV_INTEGRITY=y CONFIG_BLK_DEV_THROTTLING=y CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y CONFIG_DEFAULT_CFQ=y CONFIG_DEFAULT_IOSCHED="cfq" CONFIG_PREEMPT_NOTIFIERS=y CONFIG_INLINE_SPIN_UNLOCK=y CONFIG_INLINE_SPIN_UNLOCK_IRQ=y CONFIG_INLINE_READ_UNLOCK=y CONFIG_INLINE_READ_UNLOCK_IRQ=y CONFIG_INLINE_WRITE_UNLOCK=y CONFIG_INLINE_WRITE_UNLOCK_IRQ=y CONFIG_FREEZER=y CONFIG_PPC_PMAC=y CONFIG_PPC_NATIVE=y CONFIG_PPC_OF_BOOT_TRAMPOLINE=y CONFIG_MPIC=y
Re: kernel BUG at include/linux/kvm_host.h:603!
Hi Alexander, Alexander Graf hat am Mon 10. Oct, 10:09 (+0200) geschrieben: > On 07.10.2011, at 23:10, Jörg Sommer wrote: > > > Hi, > > > > I've got this backtrace: > > > > [130902.709711] [ cut here ] > > [130902.709747] kernel BUG at include/linux/kvm_host.h:603! > > Ouch. This means that preemption is broken in KVM for PPC. To quickly > get things working on your side, please recompile your kernel with > CONFIG_PREEMPT_NONE. I'll take a look at fixing it for real ASAP. Did you look for it? I still get this message for 3.1.0-02829. Bye, Jörg. -- Es gibt nichts schöneres als dem Schweigen eines Dummkopfes zuzuhören. (Helmut Quatlinger) signature.asc Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP
kernel BUG at include/linux/kvm_host.h:603!
Hi, I've got this backtrace: [130902.709711] [ cut here ] [130902.709747] kernel BUG at include/linux/kvm_host.h:603! [130902.709778] Oops: Exception in kernel mode, sig: 5 [#1] [130902.709788] PowerMac [130902.709796] Modules linked in: kvm nfs lockd auth_rpcgss sunrpc ppp_async crc_ccitt ppp_generic slhc ipv6 fus [130902.709947] NIP: eb589934 LR: eb5898cc CTR: [130902.709964] REGS: c138fa10 TRAP: 0700 Not tainted (3.1.0-rc8.ledtest-00743-gf72a209-dirty) [130902.709976] MSR: 02029032 CR: 24000462 XER: [130902.710011] TASK = c0f33700[22334] 'qemu-system-ppc' THREAD: c138e000 [130902.710021] GPR00: 0001 c138fac0 c0f33700 c138fbe0 c0f33c3c c138fddc [130902.710051] GPR08: 1034181c bfa35843 10297f20 [130902.710080] GPR16: 10297f2c 10943ea0 1034 1034 d032 [130902.710108] GPR24: 82004000 0900 e69d5000 0001 c0f33700 eb5a1000 c138fac0 [130902.710199] NIP [eb589934] kvmppc_vcpu_run+0x11c/0x1f4 [kvm] [130902.710225] LR [eb5898cc] kvmppc_vcpu_run+0xb4/0x1f4 [kvm] [130902.710235] Call Trace: [130902.710264] [c138fe20] [eb583eec] kvm_arch_vcpu_ioctl_run+0x350/0x37c [kvm] [130902.710296] [c138fe50] [eb57e13c] kvm_vcpu_ioctl+0x158/0xa08 [kvm] [130902.710320] [c138fea0] [c0118dac] do_vfs_ioctl+0x730/0x7a8 [130902.710337] [c138ff10] [c0118e8c] sys_ioctl+0x68/0x8c [130902.710356] [c138ff40] [c0013a10] ret_from_syscall+0x0/0x38 [130902.710385] --- Exception: c01 at 0xf66cf38 [130902.710391] LR = 0xf66ce9c [130902.710399] Instruction dump: [130902.710412] 41a20014 7fc3f378 38800800 38a02000 4bffe9ad 54290024 3800 8129000c [130902.710442] 2f89 409e000c 7ca6 54008ffe <0f00> 8002000c 7f63db78 7fc4f378 [130902.710481] ---[ end trace 193d4a72a409c31f ]--- [130902.710512] BUG: sleeping function called from invalid context at kernel/rwsem.c:21 [130902.710528] in_atomic(): 0, irqs_disabled(): 1, pid: 22334, name: qemu-system-ppc [130902.710540] Call Trace: [130902.710555] [c138f7d0] [c000bba4] show_stack+0xbc/0x194 (unreliable) [130902.710587] [c138f820] [c0480344] dump_stack+0x30/0x38 [130902.710608] [c138f830] [c00325e8] __might_sleep+0xf8/0x100 [130902.710625] [c138f840] [c04789c0] down_read+0x38/0x64 [130902.710643] [c138f850] [c007e744] acct_collect+0x48/0x17c [130902.710661] [c138f870] [c003fd1c] do_exit+0x1ac/0x710 [130902.710680] [c138f8c0] [c000edf8] die+0x238/0x244 [130902.710697] [c138f8f0] [c000eec4] _exception+0x64/0x10c [130902.710714] [c138f9e0] [c04797a8] program_check_exception+0x1dc/0x1e4 [130902.710732] [c138fa00] [c0014070] ret_from_except_full+0x0/0x4c [130902.710780] --- Exception: 700 at kvmppc_vcpu_run+0x11c/0x1f4 [kvm] [130902.710787] LR = kvmppc_vcpu_run+0xb4/0x1f4 [kvm] [130902.710800] [c138fac0] [] (null) (unreliable) [130902.710832] [c138fe20] [eb583eec] kvm_arch_vcpu_ioctl_run+0x350/0x37c [kvm] [130902.710862] [c138fe50] [eb57e13c] kvm_vcpu_ioctl+0x158/0xa08 [kvm] [130902.710879] [c138fea0] [c0118dac] do_vfs_ioctl+0x730/0x7a8 [130902.710895] [c138ff10] [c0118e8c] sys_ioctl+0x68/0x8c [130902.710910] [c138ff40] [c0013a10] ret_from_syscall+0x0/0x38 [130902.710931] --- Exception: c01 at 0xf66cf38 [130902.710937] LR = 0xf66ce9c % uname -r 3.1.0-rc8.ledtest-00743-gf72a209-dirty % 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 It happend while running this command: % qemu-system-ppc -m 512 -cpu 7455 -k de -enable-kvm -kernel /boot/vmlinuz-2.6.39.ledtest-dirty % qemu-system-ppc --version QEMU emulator version 0.15.0 (Debian 0.15.0+dfsg-1), Copyright (c) 2003-2008 Fabrice Bellard 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: signature.asc Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP