diff options
author | Avi Kivity <avi@qumranet.com> | 2007-07-19 07:30:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 17:37:05 -0400 |
commit | 2d9ce177e68645945e3366cfe2d66ee3c28cd4f2 (patch) | |
tree | a98a3a8b0f1e92f0b8f9ecb44b67bb46c3b4451a | |
parent | 3e1f900bff40460d7bbab0ccd1a9efc3c70aee49 (diff) |
i386: Allow KVM on i386 nonpae
Currently, CONFIG_X86_CMPXCHG64 both enables boot-time checking of
the cmpxchg64b feature and enables compilation of the set_64bit() family.
Since the option is dependent on PAE, and since KVM depends on set_64bit(),
this effectively disables KVM on i386 nopae.
Simplify by removing the config option altogether: the boot check is made
dependent on CONFIG_X86_PAE directly, and the set_64bit() family is exposed
without constraints. It is up to users to check for the feature flag (KVM
does not as virtualiation extensions imply its existence).
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/i386/Kconfig.cpu | 5 | ||||
-rw-r--r-- | arch/i386/defconfig | 1 | ||||
-rw-r--r-- | arch/um/defconfig | 1 | ||||
-rw-r--r-- | drivers/kvm/Kconfig | 1 | ||||
-rw-r--r-- | include/asm-i386/cmpxchg.h | 14 | ||||
-rw-r--r-- | include/asm-i386/required-features.h | 2 |
6 files changed, 6 insertions, 18 deletions
diff --git a/arch/i386/Kconfig.cpu b/arch/i386/Kconfig.cpu index 9cbe76c3aa35..11a24d54f27b 100644 --- a/arch/i386/Kconfig.cpu +++ b/arch/i386/Kconfig.cpu | |||
@@ -297,11 +297,6 @@ config X86_POPAD_OK | |||
297 | depends on !M386 | 297 | depends on !M386 |
298 | default y | 298 | default y |
299 | 299 | ||
300 | config X86_CMPXCHG64 | ||
301 | bool | ||
302 | depends on X86_PAE | ||
303 | default y | ||
304 | |||
305 | config X86_ALIGNMENT_16 | 300 | config X86_ALIGNMENT_16 |
306 | bool | 301 | bool |
307 | depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1 | 302 | depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1 |
diff --git a/arch/i386/defconfig b/arch/i386/defconfig index 1a3a2217b7c2..0ac62cdcd3b7 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig | |||
@@ -166,7 +166,6 @@ CONFIG_X86_WP_WORKS_OK=y | |||
166 | CONFIG_X86_INVLPG=y | 166 | CONFIG_X86_INVLPG=y |
167 | CONFIG_X86_BSWAP=y | 167 | CONFIG_X86_BSWAP=y |
168 | CONFIG_X86_POPAD_OK=y | 168 | CONFIG_X86_POPAD_OK=y |
169 | CONFIG_X86_CMPXCHG64=y | ||
170 | CONFIG_X86_GOOD_APIC=y | 169 | CONFIG_X86_GOOD_APIC=y |
171 | CONFIG_X86_INTEL_USERCOPY=y | 170 | CONFIG_X86_INTEL_USERCOPY=y |
172 | CONFIG_X86_USE_PPRO_CHECKSUM=y | 171 | CONFIG_X86_USE_PPRO_CHECKSUM=y |
diff --git a/arch/um/defconfig b/arch/um/defconfig index a25cd25d55d4..1e0f677c2f46 100644 --- a/arch/um/defconfig +++ b/arch/um/defconfig | |||
@@ -52,7 +52,6 @@ CONFIG_X86_WP_WORKS_OK=y | |||
52 | CONFIG_X86_INVLPG=y | 52 | CONFIG_X86_INVLPG=y |
53 | CONFIG_X86_BSWAP=y | 53 | CONFIG_X86_BSWAP=y |
54 | CONFIG_X86_POPAD_OK=y | 54 | CONFIG_X86_POPAD_OK=y |
55 | CONFIG_X86_CMPXCHG64=y | ||
56 | CONFIG_X86_GOOD_APIC=y | 55 | CONFIG_X86_GOOD_APIC=y |
57 | CONFIG_X86_USE_PPRO_CHECKSUM=y | 56 | CONFIG_X86_USE_PPRO_CHECKSUM=y |
58 | CONFIG_X86_TSC=y | 57 | CONFIG_X86_TSC=y |
diff --git a/drivers/kvm/Kconfig b/drivers/kvm/Kconfig index 33fa28a8c199..2f661e5f0dae 100644 --- a/drivers/kvm/Kconfig +++ b/drivers/kvm/Kconfig | |||
@@ -11,7 +11,6 @@ if VIRTUALIZATION | |||
11 | config KVM | 11 | config KVM |
12 | tristate "Kernel-based Virtual Machine (KVM) support" | 12 | tristate "Kernel-based Virtual Machine (KVM) support" |
13 | depends on X86 && EXPERIMENTAL | 13 | depends on X86 && EXPERIMENTAL |
14 | depends on X86_CMPXCHG64 || 64BIT | ||
15 | ---help--- | 14 | ---help--- |
16 | Support hosting fully virtualized guest machines using hardware | 15 | Support hosting fully virtualized guest machines using hardware |
17 | virtualization extensions. You will need a fairly recent | 16 | virtualization extensions. You will need a fairly recent |
diff --git a/include/asm-i386/cmpxchg.h b/include/asm-i386/cmpxchg.h index 7adcef0cd53b..64dcdf46117b 100644 --- a/include/asm-i386/cmpxchg.h +++ b/include/asm-i386/cmpxchg.h | |||
@@ -3,14 +3,16 @@ | |||
3 | 3 | ||
4 | #include <linux/bitops.h> /* for LOCK_PREFIX */ | 4 | #include <linux/bitops.h> /* for LOCK_PREFIX */ |
5 | 5 | ||
6 | /* | ||
7 | * Note: if you use set64_bit(), __cmpxchg64(), or their variants, you | ||
8 | * you need to test for the feature in boot_cpu_data. | ||
9 | */ | ||
10 | |||
6 | #define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr)))) | 11 | #define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr)))) |
7 | 12 | ||
8 | struct __xchg_dummy { unsigned long a[100]; }; | 13 | struct __xchg_dummy { unsigned long a[100]; }; |
9 | #define __xg(x) ((struct __xchg_dummy *)(x)) | 14 | #define __xg(x) ((struct __xchg_dummy *)(x)) |
10 | 15 | ||
11 | |||
12 | #ifdef CONFIG_X86_CMPXCHG64 | ||
13 | |||
14 | /* | 16 | /* |
15 | * The semantics of XCHGCMP8B are a bit strange, this is why | 17 | * The semantics of XCHGCMP8B are a bit strange, this is why |
16 | * there is a loop and the loading of %%eax and %%edx has to | 18 | * there is a loop and the loading of %%eax and %%edx has to |
@@ -65,8 +67,6 @@ static inline void __set_64bit_var (unsigned long long *ptr, | |||
65 | __set_64bit(ptr, (unsigned int)(value), (unsigned int)((value)>>32ULL) ) : \ | 67 | __set_64bit(ptr, (unsigned int)(value), (unsigned int)((value)>>32ULL) ) : \ |
66 | __set_64bit(ptr, ll_low(value), ll_high(value)) ) | 68 | __set_64bit(ptr, ll_low(value), ll_high(value)) ) |
67 | 69 | ||
68 | #endif | ||
69 | |||
70 | /* | 70 | /* |
71 | * Note: no "lock" prefix even on SMP: xchg always implies lock anyway | 71 | * Note: no "lock" prefix even on SMP: xchg always implies lock anyway |
72 | * Note 2: xchg has side effect, so that attribute volatile is necessary, | 72 | * Note 2: xchg has side effect, so that attribute volatile is necessary, |
@@ -252,8 +252,6 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old, | |||
252 | }) | 252 | }) |
253 | #endif | 253 | #endif |
254 | 254 | ||
255 | #ifdef CONFIG_X86_CMPXCHG64 | ||
256 | |||
257 | static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long long old, | 255 | static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long long old, |
258 | unsigned long long new) | 256 | unsigned long long new) |
259 | { | 257 | { |
@@ -289,5 +287,3 @@ static inline unsigned long long __cmpxchg64_local(volatile void *ptr, | |||
289 | ((__typeof__(*(ptr)))__cmpxchg64_local((ptr),(unsigned long long)(o),\ | 287 | ((__typeof__(*(ptr)))__cmpxchg64_local((ptr),(unsigned long long)(o),\ |
290 | (unsigned long long)(n))) | 288 | (unsigned long long)(n))) |
291 | #endif | 289 | #endif |
292 | |||
293 | #endif | ||
diff --git a/include/asm-i386/required-features.h b/include/asm-i386/required-features.h index 65848a007050..618feb98f9f5 100644 --- a/include/asm-i386/required-features.h +++ b/include/asm-i386/required-features.h | |||
@@ -29,7 +29,7 @@ | |||
29 | # define NEED_CMOV 0 | 29 | # define NEED_CMOV 0 |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #ifdef CONFIG_X86_CMPXCHG64 | 32 | #ifdef CONFIG_X86_PAE |
33 | # define NEED_CX8 (1<<(X86_FEATURE_CX8 & 31)) | 33 | # define NEED_CX8 (1<<(X86_FEATURE_CX8 & 31)) |
34 | #else | 34 | #else |
35 | # define NEED_CX8 0 | 35 | # define NEED_CX8 0 |