Skip to contentSkip to conversation

kvm-29 and linux 2.6.22.1-cfs-v19

DISCUSSION Chris Clayton 3 participants 5 messages Jul 14, 2007 – Jul 15, 2007 4 messages not in the archive KVM

lore
Share & tools
lore
#0 lore raw

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.

If I comment the guarding #ifdef (and its partner #endif) kvm builds fine and everything seems to work OK.- the modules load and Damn Small Linux and FreeBSD run fine.

Any advice would be much appreciated and more than happy to test patches.

I'm not subscribed, so please cc me.

Thanks

-------------------------------------------------------------------------
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/

A message that is not in the archive (sent off-list or not yet received): 200707141956.41423.chris2553-gM/[email protected]

#2 lore raw
Quoted 26 lines · Chris Clayton

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
Quoted 8 lines

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.

Regards,

Anthony Liguori

Quoted 10 lines

If I comment the guarding #ifdef (and its partner #endif) kvm builds fine and everything seems to work OK.- the modules load and Damn Small Linux and FreeBSD run fine.

Any advice would be much appreciated and more than happy to test patches.

I'm not subscribed, so please cc me.

Thanks

Quoted 11 lines

-------------------------------------------------------------------------
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
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/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 31 lines · Anthony Liguori
Quoted 30 lines · Chris Clayton

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.

Quoted 7 lines
Quoted 4 lines

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?

Thanks

Chris

Quoted 23 lines

Regards,

Anthony Liguori

Quoted 19 lines

If I comment the guarding #ifdef (and its partner #endif) kvm builds fine and everything seems to work OK.- the modules load and Damn Small Linux and FreeBSD run fine.

Any advice would be much appreciated and more than happy to test patches.

I'm not subscribed, so please cc me.

Thanks

-------------------------------------------------------------------------
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
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/

A message that is not in the archive (sent off-list or not yet received): 200707142058.27525.chris2553-gM/[email protected]

#6 lore raw
Quoted 43 lines · Chris Clayton
Quoted 32 lines · Anthony Liguori
Quoted 30 lines · Chris Clayton

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.

Quoted 8 lines
Quoted 5 lines

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.

Quoted 7 lines

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.

Regards,

Anthony Liguori

Quoted 34 lines

Thanks

Chris

Quoted 25 lines

Regards,

Anthony Liguori

Quoted 20 lines

If I comment the guarding #ifdef (and its partner #endif) kvm builds fine and everything seems to work OK.- the modules load and Damn Small Linux and FreeBSD run fine.

Any advice would be much appreciated and more than happy to test patches.

I'm not subscribed, so please cc me.

Thanks

-------------------------------------------------------------------------
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
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/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 53 lines · Anthony Liguori
Quoted 51 lines · Chris Clayton
Quoted 33 lines · Anthony Liguori
Quoted 30 lines · Chris Clayton

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.

Quoted 10 lines
Quoted 6 lines

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.

Quoted 9 lines
Quoted 3 lines

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

arch/i386/Kconfig +1 -1
index 8770a5d..d2f6a24 100644
@@ -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.
arch/i386/Kconfig.cpu +1 -1
index d7f6fb0..5c95ceb 100644
@@ -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?

Signature · 8 lines
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/