diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/Makefile.um | 4 | ||||
-rw-r--r-- | arch/x86/um/Kconfig | 4 | ||||
-rw-r--r-- | arch/x86/um/asm/processor.h | 10 | ||||
-rw-r--r-- | arch/x86/um/asm/processor_32.h | 10 | ||||
-rw-r--r-- | arch/x86/um/asm/processor_64.h | 10 | ||||
-rw-r--r-- | arch/x86/um/bugs_32.c | 4 |
6 files changed, 13 insertions, 29 deletions
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um index 36ddec6a41c9..4be406abeefd 100644 --- a/arch/x86/Makefile.um +++ b/arch/x86/Makefile.um | |||
@@ -8,15 +8,11 @@ ELF_ARCH := i386 | |||
8 | ELF_FORMAT := elf32-i386 | 8 | ELF_FORMAT := elf32-i386 |
9 | CHECKFLAGS += -D__i386__ | 9 | CHECKFLAGS += -D__i386__ |
10 | 10 | ||
11 | ifeq ("$(origin SUBARCH)", "command line") | ||
12 | ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)") | ||
13 | KBUILD_CFLAGS += $(call cc-option,-m32) | 11 | KBUILD_CFLAGS += $(call cc-option,-m32) |
14 | KBUILD_AFLAGS += $(call cc-option,-m32) | 12 | KBUILD_AFLAGS += $(call cc-option,-m32) |
15 | LINK-y += $(call cc-option,-m32) | 13 | LINK-y += $(call cc-option,-m32) |
16 | 14 | ||
17 | export LDFLAGS | 15 | export LDFLAGS |
18 | endif | ||
19 | endif | ||
20 | 16 | ||
21 | # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y. | 17 | # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y. |
22 | include $(srctree)/arch/x86/Makefile_32.cpu | 18 | include $(srctree)/arch/x86/Makefile_32.cpu |
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index b2b54d2edf53..9926e11a772d 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig | |||
@@ -15,8 +15,8 @@ config UML_X86 | |||
15 | select GENERIC_FIND_FIRST_BIT | 15 | select GENERIC_FIND_FIRST_BIT |
16 | 16 | ||
17 | config 64BIT | 17 | config 64BIT |
18 | bool | 18 | bool "64-bit kernel" if SUBARCH = "x86" |
19 | default SUBARCH = "x86_64" | 19 | default SUBARCH != "i386" |
20 | 20 | ||
21 | config X86_32 | 21 | config X86_32 |
22 | def_bool !64BIT | 22 | def_bool !64BIT |
diff --git a/arch/x86/um/asm/processor.h b/arch/x86/um/asm/processor.h index 2c32df6fe231..04f82e020f2b 100644 --- a/arch/x86/um/asm/processor.h +++ b/arch/x86/um/asm/processor.h | |||
@@ -17,6 +17,16 @@ | |||
17 | #define ARCH_IS_STACKGROW(address) \ | 17 | #define ARCH_IS_STACKGROW(address) \ |
18 | (address + 65536 + 32 * sizeof(unsigned long) >= UPT_SP(¤t->thread.regs.regs)) | 18 | (address + 65536 + 32 * sizeof(unsigned long) >= UPT_SP(¤t->thread.regs.regs)) |
19 | 19 | ||
20 | #include <asm/user.h> | ||
21 | |||
22 | /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ | ||
23 | static inline void rep_nop(void) | ||
24 | { | ||
25 | __asm__ __volatile__("rep;nop": : :"memory"); | ||
26 | } | ||
27 | |||
28 | #define cpu_relax() rep_nop() | ||
29 | |||
20 | #include <asm/processor-generic.h> | 30 | #include <asm/processor-generic.h> |
21 | 31 | ||
22 | #endif | 32 | #endif |
diff --git a/arch/x86/um/asm/processor_32.h b/arch/x86/um/asm/processor_32.h index 018f732704dd..6c6689e574ce 100644 --- a/arch/x86/um/asm/processor_32.h +++ b/arch/x86/um/asm/processor_32.h | |||
@@ -45,16 +45,6 @@ static inline void arch_copy_thread(struct arch_thread *from, | |||
45 | memcpy(&to->tls_array, &from->tls_array, sizeof(from->tls_array)); | 45 | memcpy(&to->tls_array, &from->tls_array, sizeof(from->tls_array)); |
46 | } | 46 | } |
47 | 47 | ||
48 | #include <asm/user.h> | ||
49 | |||
50 | /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ | ||
51 | static inline void rep_nop(void) | ||
52 | { | ||
53 | __asm__ __volatile__("rep;nop": : :"memory"); | ||
54 | } | ||
55 | |||
56 | #define cpu_relax() rep_nop() | ||
57 | |||
58 | /* | 48 | /* |
59 | * Default implementation of macro that returns current | 49 | * Default implementation of macro that returns current |
60 | * instruction pointer ("program counter"). Stolen | 50 | * instruction pointer ("program counter"). Stolen |
diff --git a/arch/x86/um/asm/processor_64.h b/arch/x86/um/asm/processor_64.h index 61de92d916c3..4b02a8455bd1 100644 --- a/arch/x86/um/asm/processor_64.h +++ b/arch/x86/um/asm/processor_64.h | |||
@@ -14,14 +14,6 @@ struct arch_thread { | |||
14 | struct faultinfo faultinfo; | 14 | struct faultinfo faultinfo; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ | ||
18 | static inline void rep_nop(void) | ||
19 | { | ||
20 | __asm__ __volatile__("rep;nop": : :"memory"); | ||
21 | } | ||
22 | |||
23 | #define cpu_relax() rep_nop() | ||
24 | |||
25 | #define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \ | 17 | #define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \ |
26 | .debugregs_seq = 0, \ | 18 | .debugregs_seq = 0, \ |
27 | .fs = 0, \ | 19 | .fs = 0, \ |
@@ -37,8 +29,6 @@ static inline void arch_copy_thread(struct arch_thread *from, | |||
37 | to->fs = from->fs; | 29 | to->fs = from->fs; |
38 | } | 30 | } |
39 | 31 | ||
40 | #include <asm/user.h> | ||
41 | |||
42 | #define current_text_addr() \ | 32 | #define current_text_addr() \ |
43 | ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; }) | 33 | ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; }) |
44 | 34 | ||
diff --git a/arch/x86/um/bugs_32.c b/arch/x86/um/bugs_32.c index a1fba5fb9dbe..17d88cf2c6c4 100644 --- a/arch/x86/um/bugs_32.c +++ b/arch/x86/um/bugs_32.c | |||
@@ -13,8 +13,6 @@ | |||
13 | static int host_has_cmov = 1; | 13 | static int host_has_cmov = 1; |
14 | static jmp_buf cmov_test_return; | 14 | static jmp_buf cmov_test_return; |
15 | 15 | ||
16 | #define TASK_PID(task) *((int *) &(((char *) (task))[HOST_TASK_PID])) | ||
17 | |||
18 | static void cmov_sigill_test_handler(int sig) | 16 | static void cmov_sigill_test_handler(int sig) |
19 | { | 17 | { |
20 | host_has_cmov = 0; | 18 | host_has_cmov = 0; |
@@ -51,7 +49,7 @@ void arch_examine_signal(int sig, struct uml_pt_regs *regs) | |||
51 | * This is testing for a cmov (0x0f 0x4x) instruction causing a | 49 | * This is testing for a cmov (0x0f 0x4x) instruction causing a |
52 | * SIGILL in init. | 50 | * SIGILL in init. |
53 | */ | 51 | */ |
54 | if ((sig != SIGILL) || (TASK_PID(get_current()) != 1)) | 52 | if ((sig != SIGILL) || (get_current_pid() != 1)) |
55 | return; | 53 | return; |
56 | 54 | ||
57 | if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2)) { | 55 | if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2)) { |