Anthony Liguori wrote: > Chris Clayton wrote: > >> On Saturday 14 July 2007, Anthony Liguori wrote: >> >> >>> Chris Clayton wrote: >>> >>> >>>> Hi, >>>> >>>> I'm building kvm-29 on a system that is running linux-2.6.22.1-cfs-v19. >>>> When the modules are built I get warnings about set_64bit: >>>> >>>> CC [M] /home/users/chris/rpm/BUILD/kvm-29/kernel/vmx-debug.o >>>> CC [M] /home/users/chris/rpm/BUILD/kvm-29/kernel/kvm_main.o >>>> CC [M] /home/users/chris/rpm/BUILD/kvm-29/kernel/mmu.o >>>> /home/users/chris/rpm/BUILD/kvm-29/kernel/mmu.c: In function >>>> 'set_shadow_pte': /home/users/chris/rpm/BUILD/kvm-29/kernel/mmu.c:202: >>>> warning: implicit declaration of function 'set_64bit' >>>> CC [M] /home/users/chris/rpm/BUILD/kvm-29/kernel/x86_emulate.o >>>> CC [M] /home/users/chris/rpm/BUILD/kvm-29/kernel/anon_inodes.o >>>> LD [M] /home/users/chris/rpm/BUILD/kvm-29/kernel/kvm.o >>>> LD [M] /home/users/chris/rpm/BUILD/kvm-29/kernel/kvm-intel.o >>>> LD [M] /home/users/chris/rpm/BUILD/kvm-29/kernel/kvm-amd.o >>>> Building modules, stage 2. >>>> MODPOST 3 modules >>>> WARNING: "set_64bit" [/home/users/chris/rpm/BUILD/kvm-29/kernel/kvm.ko] >>>> undefined! >>>> CC /home/users/chris/rpm/BUILD/kvm-29/kernel/kvm-amd.mod.o >>>> CC /home/users/chris/rpm/BUILD/kvm-29/kernel/kvm-intel.mod.o >>>> CC /home/users/chris/rpm/BUILD/kvm-29/kernel/kvm.mod.o >>>> LD [M] /home/users/chris/rpm/BUILD/kvm-29/kernel/kvm-amd.ko >>>> LD [M] /home/users/chris/rpm/BUILD/kvm-29/kernel/kvm-intel.ko >>>> LD [M] /home/users/chris/rpm/BUILD/kvm-29/kernel/kvm.ko >>>> m >>>> Because set_64bit is undefined, kvm.ko (and kvm-intel.ko) can't be >>>> loaded. >>>> >>>> I've found the set_64bit in the kernel sources - it's a macro in >>>> asm-i386/cmpxchg.h. The problem is that the macro(and some realted macros >>>> and definitions are guarded by "#ifdef CONFIG_X86_CMPXCHG64". Since that >>>> isn't defined for my kernel, set_64bit is not defined either. >>>> >>>> >>> KVM depends on CONFIG_X86_CMPXCHG64 which also depends on CONFIG_X86_PAE. >>> >>> >>> >> To select that I have to specify (in make menuconfig) that I have more than >> 4 >> gigabytes of RAM, when actually I have 2 gigabytes. It's the only way I can >> find to get CONFIG_X86_PAE selected, but means I must ignore the help text >> offered around CONFIG_HIGHMEM4G/64G. >> >> Have I got that right, please? >> >> > > Enabling HIGHMEM64G enables the use of PAE. Any processor that support > virtualization supports PAE and there's very little harm to enabling it > even if you have less than 4G of memory. > >
While that's true, and while pae has an additional benefit (nx support on most processors), there's no reason not to support kvm on non-pae. set_64bit() is not intrinsically dependent on pae, rather it's the other way round. The following commit causes the issue (note that only newer kvm needs set_64bit(); 2.6.22 is fine): commit 9d9bbd4d247a674deb43565582151acdc22e90d1 Author: Andi Kleen <[EMAIL PROTECTED]> Date: Sat Jun 23 02:29:23 2007 +0200 i386: Make CMPXCHG64 only dependent on PAE It is only used for PAE kernels in set_64bit. The problem is that due to a old Windows bug many CPUs need magic MSRs to enable CMPXCHG64, and we can't do that nicely early enough before it is potentially used. But since we only need it in PAE kernels so only force the checking for CMPXCHG65 with PAE. This fixes a boot failure on Transmeta Crusoe Signed-off-by: Andi Kleen <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index 8770a5d..d2f6a24 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig @@ -541,7 +541,7 @@ config HIGHMEM4G config HIGHMEM64G bool "64GB" - depends on X86_CMPXCHG64 + depends on !M386 && !M486 help Select this if you have a 32-bit processor and more than 4 gigabytes of physical RAM. diff --git a/arch/i386/Kconfig.cpu b/arch/i386/Kconfig.cpu index d7f6fb0..5c95ceb 100644 --- a/arch/i386/Kconfig.cpu +++ b/arch/i386/Kconfig.cpu @@ -299,7 +299,7 @@ config X86_POPAD_OK config X86_CMPXCHG64 bool - depends on !M386 && !M486 + depends on X86_PAE default y Andi, will a patch to have X86_CMPXCHG64 depend on !M386 && !M486, default to n, and be selected by HIGHMEM64G and KVM be acceptable? -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel