From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dushyant Bansal Date: Wed, 12 Jan 2011 20:54:00 +0000 Subject: Re: error: building kvm for powerpc using cross compiler on x86 Message-Id: <4D2E146D.8000906@cse.iitd.ac.in> List-Id: References: <4D260C69.7000605@cse.iitd.ac.in> In-Reply-To: <4D260C69.7000605@cse.iitd.ac.in> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org >>> $ cp arch/powerpc/configs/pmac32_defconfig .config >>> $ make menuconfig ARCH=powerpc >>> >>> seems to work. I'm not sure what default config is taken by default, but apparently one of the KVM constraints isn't fulfilled. Since you want to build a kernel for a pmac32 anyways, just take that config as the basis or use the one from a VM you already have working :). >>> >>> >>> Alex >>> >>> >> I tried to build kernel image for powerpc-750 >> user@user:~/project/kvm$ cp arch/powerpc/configs/pmac32_defconfig .config >> user@user:~/project/kvm$ make ARCH=powerpc menuconfig >> >> [I selected "KVM support for PowerPC book3s_32 processors" under virtualization menu. I have attached the final .config file] >> >> user@user:~/project/kvm$ make ARCH=powerpc CROSS_COMPILE=powerpc-750-linux-gnu- >> [I get this error] >> CHK include/linux/version.h >> CHK include/generated/utsrelease.h >> CALL scripts/checksyscalls.sh >> CHK include/generated/compile.h >> CALL arch/powerpc/kernel/systbl_chk.sh >> CALL arch/powerpc/kernel/prom_init_check.sh >> AS arch/powerpc/kvm/fpu.o >> arch/powerpc/kvm/fpu.S: Assembler messages: >> arch/powerpc/kvm/fpu.S:244: Error: Unrecognized opcode: `frsqrtes.' >> arch/powerpc/kvm/fpu.S:250: Error: Unrecognized opcode: `fre.' >> arch/powerpc/kvm/fpu.S:259: Error: Unrecognized opcode: `fcpsgn.' >> make[1]: *** [arch/powerpc/kvm/fpu.o] Error 1 >> make: *** [arch/powerpc/kvm] Error 2 >> > This means that your assembler doesn't understand some of the floating point instructions in the paired single emulation code. Since you don't need that code anyways, just comment them out. > > Thanks a lot, Alex. After debugging some more errors, I was finally able to compile it. user@user:~/kvm$ make distclean user@user:~/kvm$ cp arch/powerpc/configs/pmac32_defconfig .config user@user:~/kvm$ make ARCH=powerpc menuconfig [I selected "KVM support for PowerPC book3s_32 processors" under virtualization menu.] user@user:~/kvm$ make ARCH=powerpc CROSS_COMPILE=powerpc-750-linux-gnu- user@user:~/kvm$ make ARCH=powerpc CROSS_COMPILE=powerpc-750-linux-gnu- modules Then, I mounted the qemu-system-ppc image "debian_lenny_powerpc.raw". user@user:/$ losetup /dev/loop0 debian_lenny_powerpc.raw user@user:/$ kpartx -a /dev/loop0 user@user:/$ mount /dev/mapper/loop0p3 /mnt/image2 user@user:/$ mount /dev/mapper/loop0p2 /mnt/image2/boot/ user@user:~/kvm$ sudo make ARCH=powerpc CROSS_COMPILE=powerpc-750-linux-gnu- INSTALL_NOD_PATH="/mnt/image2" modules_install [Replaced /boot/vmlinux with the generated vmlinux] user@user:~/kvm$ cp vmlinux /mnt/image2/boot/vmlinux And, on booting that image [debian_lenny_powerpc.raw], I can see the new kernel image. # uname -r 2.6.37-rc6+ But still, I cannot find the kvm module. File kvm.ko is not present inside "lib/modules/2.6.37-rc6+/" # modprobe kvm FATAL: Module kvm not found. Am I missing something? How do I build kvm module ? Thanks,