aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2012-11-28 14:50:26 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2012-11-29 16:23:02 -0500
commite5bb8ad862a97a0facc83f3b81731de919fec6ad (patch)
treef3778e2c0530ed51bb686d426d2af12491136111
parent7ac468b1300f35143a9b5b100e3970ca7ae1d9b8 (diff)
x86, 386 removal: Remove CONFIG_BSWAP
All 486+ CPUs support BSWAP, so remove the fallback 386 support code. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Link: http://lkml.kernel.org/r/1354132230-21854-5-git-send-email-hpa@linux.intel.com
-rw-r--r--arch/x86/Kconfig.cpu4
-rw-r--r--arch/x86/include/asm/futex.h12
-rw-r--r--arch/x86/include/asm/swab.h29
-rw-r--r--arch/x86/kernel/cpu/bugs.c13
4 files changed, 4 insertions, 54 deletions
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 52955eeeb1ef..8e5867cf07d0 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -332,10 +332,6 @@ config X86_INVLPG
332 def_bool y 332 def_bool y
333 depends on X86_32 333 depends on X86_32
334 334
335config X86_BSWAP
336 def_bool y
337 depends on X86_32
338
339config X86_POPAD_OK 335config X86_POPAD_OK
340 def_bool y 336 def_bool y
341 depends on X86_32 337 depends on X86_32
diff --git a/arch/x86/include/asm/futex.h b/arch/x86/include/asm/futex.h
index f373046e63ec..be27ba1e947a 100644
--- a/arch/x86/include/asm/futex.h
+++ b/arch/x86/include/asm/futex.h
@@ -55,12 +55,6 @@ static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr)
55 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) 55 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
56 return -EFAULT; 56 return -EFAULT;
57 57
58#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_BSWAP)
59 /* Real i386 machines can only support FUTEX_OP_SET */
60 if (op != FUTEX_OP_SET && boot_cpu_data.x86 == 3)
61 return -ENOSYS;
62#endif
63
64 pagefault_disable(); 58 pagefault_disable();
65 59
66 switch (op) { 60 switch (op) {
@@ -118,12 +112,6 @@ static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
118{ 112{
119 int ret = 0; 113 int ret = 0;
120 114
121#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_BSWAP)
122 /* Real i386 machines have no cmpxchg instruction */
123 if (boot_cpu_data.x86 == 3)
124 return -ENOSYS;
125#endif
126
127 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) 115 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
128 return -EFAULT; 116 return -EFAULT;
129 117
diff --git a/arch/x86/include/asm/swab.h b/arch/x86/include/asm/swab.h
index 557cd9f00661..7f235c7105c1 100644
--- a/arch/x86/include/asm/swab.h
+++ b/arch/x86/include/asm/swab.h
@@ -6,22 +6,7 @@
6 6
7static inline __attribute_const__ __u32 __arch_swab32(__u32 val) 7static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
8{ 8{
9#ifdef __i386__ 9 asm("bswapl %0" : "=r" (val) : "0" (val));
10# ifdef CONFIG_X86_BSWAP
11 asm("bswap %0" : "=r" (val) : "0" (val));
12# else
13 asm("xchgb %b0,%h0\n\t" /* swap lower bytes */
14 "rorl $16,%0\n\t" /* swap words */
15 "xchgb %b0,%h0" /* swap higher bytes */
16 : "=q" (val)
17 : "0" (val));
18# endif
19
20#else /* __i386__ */
21 asm("bswapl %0"
22 : "=r" (val)
23 : "0" (val));
24#endif
25 return val; 10 return val;
26} 11}
27#define __arch_swab32 __arch_swab32 12#define __arch_swab32 __arch_swab32
@@ -37,22 +22,12 @@ static inline __attribute_const__ __u64 __arch_swab64(__u64 val)
37 __u64 u; 22 __u64 u;
38 } v; 23 } v;
39 v.u = val; 24 v.u = val;
40# ifdef CONFIG_X86_BSWAP
41 asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1" 25 asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
42 : "=r" (v.s.a), "=r" (v.s.b) 26 : "=r" (v.s.a), "=r" (v.s.b)
43 : "0" (v.s.a), "1" (v.s.b)); 27 : "0" (v.s.a), "1" (v.s.b));
44# else
45 v.s.a = __arch_swab32(v.s.a);
46 v.s.b = __arch_swab32(v.s.b);
47 asm("xchgl %0,%1"
48 : "=r" (v.s.a), "=r" (v.s.b)
49 : "0" (v.s.a), "1" (v.s.b));
50# endif
51 return v.u; 28 return v.u;
52#else /* __i386__ */ 29#else /* __i386__ */
53 asm("bswapq %0" 30 asm("bswapq %0" : "=r" (val) : "0" (val));
54 : "=r" (val)
55 : "0" (val));
56 return val; 31 return val;
57#endif 32#endif
58} 33}
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index d0e910da16c5..0cd07ccdf380 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -136,24 +136,15 @@ static void __init check_popad(void)
136/* 136/*
137 * Check whether we are able to run this kernel safely on SMP. 137 * Check whether we are able to run this kernel safely on SMP.
138 * 138 *
139 * - In order to run on a i386, we need to be compiled for i386 139 * - i386 is no longer supported.
140 * (for due to lack of "invlpg" and working WP on a i386)
141 * - In order to run on anything without a TSC, we need to be 140 * - In order to run on anything without a TSC, we need to be
142 * compiled for a i486. 141 * compiled for a i486.
143 */ 142 */
144 143
145static void __init check_config(void) 144static void __init check_config(void)
146{ 145{
147/* 146 if (boot_cpu_data.x86 < 4)
148 * We'd better not be a i386 if we're configured to use some
149 * i486+ only features! (WP works in supervisor mode and the
150 * new "invlpg" and "bswap" instructions)
151 */
152#if defined(CONFIG_X86_WP_WORKS_OK) || defined(CONFIG_X86_INVLPG) || \
153 defined(CONFIG_X86_BSWAP)
154 if (boot_cpu_data.x86 == 3)
155 panic("Kernel requires i486+ for 'invlpg' and other features"); 147 panic("Kernel requires i486+ for 'invlpg' and other features");
156#endif
157} 148}
158 149
159 150