public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Anthony Liguori <anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	Chris Clayton <chris2553-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>,
	Andi Kleen <ak-l3A5Bk7waGM@public.gmane.org>
Subject: Re: kvm-29 and linux 2.6.22.1-cfs-v19
Date: Sun, 15 Jul 2007 09:17:20 +0300	[thread overview]
Message-ID: <4699BBF0.6030700@qumranet.com> (raw)
In-Reply-To: <469957A8.9030402-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>

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 <ak-l3A5Bk7waGM@public.gmane.org>
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 <ak-l3A5Bk7waGM@public.gmane.org>
    Signed-off-by: Linus Torvalds <torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>

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/

      parent reply	other threads:[~2007-07-15  6:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-14 19:56 kvm-29 and linux 2.6.22.1-cfs-v19 Chris Clayton
     [not found] ` <200707141956.41423.chris2553-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2007-07-14 20:13   ` Anthony Liguori
     [not found]     ` <46992E5B.1030102-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-07-14 20:58       ` Chris Clayton
     [not found]         ` <200707142058.27525.chris2553-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2007-07-14 23:09           ` Anthony Liguori
     [not found]             ` <469957A8.9030402-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-07-15  6:17               ` Avi Kivity [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4699BBF0.6030700@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=ak-l3A5Bk7waGM@public.gmane.org \
    --cc=anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org \
    --cc=chris2553-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox