diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-11 22:59:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-11 22:59:32 -0500 |
commit | 743aa456c1834f76982af44e8b71d1a0b2a82e21 (patch) | |
tree | f240782115da675496c8d9d5328722933d0ef601 /arch/x86/lib | |
parent | a05a4e24dcd73c2de4ef3f8d520b8bbb44570c60 (diff) | |
parent | 11af32b69ef7ee64c7d8848cad71a6f3749d9e37 (diff) |
Merge branch 'x86-nuke386-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull "Nuke 386-DX/SX support" from Ingo Molnar:
"This tree removes ancient-386-CPUs support and thus zaps quite a bit
of complexity:
24 files changed, 56 insertions(+), 425 deletions(-)
... which complexity has plagued us with extra work whenever we wanted
to change SMP primitives, for years.
Unfortunately there's a nostalgic cost: your old original 386 DX33
system from early 1991 won't be able to boot modern Linux kernels
anymore. Sniff."
I'm not sentimental. Good riddance.
* 'x86-nuke386-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86, 386 removal: Document Nx586 as a 386 and thus unsupported
x86, cleanups: Simplify sync_core() in the case of no CPUID
x86, 386 removal: Remove CONFIG_X86_POPAD_OK
x86, 386 removal: Remove CONFIG_X86_WP_WORKS_OK
x86, 386 removal: Remove CONFIG_INVLPG
x86, 386 removal: Remove CONFIG_BSWAP
x86, 386 removal: Remove CONFIG_XADD
x86, 386 removal: Remove CONFIG_CMPXCHG
x86, 386 removal: Remove CONFIG_M386 from Kconfig
Diffstat (limited to 'arch/x86/lib')
-rw-r--r-- | arch/x86/lib/Makefile | 1 | ||||
-rw-r--r-- | arch/x86/lib/cmpxchg.c | 54 | ||||
-rw-r--r-- | arch/x86/lib/usercopy_32.c | 57 |
3 files changed, 0 insertions, 112 deletions
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index b00f6785da74..96b2c6697c9d 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile | |||
@@ -32,7 +32,6 @@ ifeq ($(CONFIG_X86_32),y) | |||
32 | lib-y += checksum_32.o | 32 | lib-y += checksum_32.o |
33 | lib-y += strstr_32.o | 33 | lib-y += strstr_32.o |
34 | lib-y += string_32.o | 34 | lib-y += string_32.o |
35 | lib-y += cmpxchg.o | ||
36 | ifneq ($(CONFIG_X86_CMPXCHG64),y) | 35 | ifneq ($(CONFIG_X86_CMPXCHG64),y) |
37 | lib-y += cmpxchg8b_emu.o atomic64_386_32.o | 36 | lib-y += cmpxchg8b_emu.o atomic64_386_32.o |
38 | endif | 37 | endif |
diff --git a/arch/x86/lib/cmpxchg.c b/arch/x86/lib/cmpxchg.c deleted file mode 100644 index 5d619f6df3ee..000000000000 --- a/arch/x86/lib/cmpxchg.c +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* | ||
2 | * cmpxchg*() fallbacks for CPU not supporting these instructions | ||
3 | */ | ||
4 | |||
5 | #include <linux/kernel.h> | ||
6 | #include <linux/smp.h> | ||
7 | #include <linux/module.h> | ||
8 | |||
9 | #ifndef CONFIG_X86_CMPXCHG | ||
10 | unsigned long cmpxchg_386_u8(volatile void *ptr, u8 old, u8 new) | ||
11 | { | ||
12 | u8 prev; | ||
13 | unsigned long flags; | ||
14 | |||
15 | /* Poor man's cmpxchg for 386. Unsuitable for SMP */ | ||
16 | local_irq_save(flags); | ||
17 | prev = *(u8 *)ptr; | ||
18 | if (prev == old) | ||
19 | *(u8 *)ptr = new; | ||
20 | local_irq_restore(flags); | ||
21 | return prev; | ||
22 | } | ||
23 | EXPORT_SYMBOL(cmpxchg_386_u8); | ||
24 | |||
25 | unsigned long cmpxchg_386_u16(volatile void *ptr, u16 old, u16 new) | ||
26 | { | ||
27 | u16 prev; | ||
28 | unsigned long flags; | ||
29 | |||
30 | /* Poor man's cmpxchg for 386. Unsuitable for SMP */ | ||
31 | local_irq_save(flags); | ||
32 | prev = *(u16 *)ptr; | ||
33 | if (prev == old) | ||
34 | *(u16 *)ptr = new; | ||
35 | local_irq_restore(flags); | ||
36 | return prev; | ||
37 | } | ||
38 | EXPORT_SYMBOL(cmpxchg_386_u16); | ||
39 | |||
40 | unsigned long cmpxchg_386_u32(volatile void *ptr, u32 old, u32 new) | ||
41 | { | ||
42 | u32 prev; | ||
43 | unsigned long flags; | ||
44 | |||
45 | /* Poor man's cmpxchg for 386. Unsuitable for SMP */ | ||
46 | local_irq_save(flags); | ||
47 | prev = *(u32 *)ptr; | ||
48 | if (prev == old) | ||
49 | *(u32 *)ptr = new; | ||
50 | local_irq_restore(flags); | ||
51 | return prev; | ||
52 | } | ||
53 | EXPORT_SYMBOL(cmpxchg_386_u32); | ||
54 | #endif | ||
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c index 98f6d6b68f5a..f0312d746402 100644 --- a/arch/x86/lib/usercopy_32.c +++ b/arch/x86/lib/usercopy_32.c | |||
@@ -570,63 +570,6 @@ do { \ | |||
570 | unsigned long __copy_to_user_ll(void __user *to, const void *from, | 570 | unsigned long __copy_to_user_ll(void __user *to, const void *from, |
571 | unsigned long n) | 571 | unsigned long n) |
572 | { | 572 | { |
573 | #ifndef CONFIG_X86_WP_WORKS_OK | ||
574 | if (unlikely(boot_cpu_data.wp_works_ok == 0) && | ||
575 | ((unsigned long)to) < TASK_SIZE) { | ||
576 | /* | ||
577 | * When we are in an atomic section (see | ||
578 | * mm/filemap.c:file_read_actor), return the full | ||
579 | * length to take the slow path. | ||
580 | */ | ||
581 | if (in_atomic()) | ||
582 | return n; | ||
583 | |||
584 | /* | ||
585 | * CPU does not honor the WP bit when writing | ||
586 | * from supervisory mode, and due to preemption or SMP, | ||
587 | * the page tables can change at any time. | ||
588 | * Do it manually. Manfred <manfred@colorfullife.com> | ||
589 | */ | ||
590 | while (n) { | ||
591 | unsigned long offset = ((unsigned long)to)%PAGE_SIZE; | ||
592 | unsigned long len = PAGE_SIZE - offset; | ||
593 | int retval; | ||
594 | struct page *pg; | ||
595 | void *maddr; | ||
596 | |||
597 | if (len > n) | ||
598 | len = n; | ||
599 | |||
600 | survive: | ||
601 | down_read(¤t->mm->mmap_sem); | ||
602 | retval = get_user_pages(current, current->mm, | ||
603 | (unsigned long)to, 1, 1, 0, &pg, NULL); | ||
604 | |||
605 | if (retval == -ENOMEM && is_global_init(current)) { | ||
606 | up_read(¤t->mm->mmap_sem); | ||
607 | congestion_wait(BLK_RW_ASYNC, HZ/50); | ||
608 | goto survive; | ||
609 | } | ||
610 | |||
611 | if (retval != 1) { | ||
612 | up_read(¤t->mm->mmap_sem); | ||
613 | break; | ||
614 | } | ||
615 | |||
616 | maddr = kmap_atomic(pg); | ||
617 | memcpy(maddr + offset, from, len); | ||
618 | kunmap_atomic(maddr); | ||
619 | set_page_dirty_lock(pg); | ||
620 | put_page(pg); | ||
621 | up_read(¤t->mm->mmap_sem); | ||
622 | |||
623 | from += len; | ||
624 | to += len; | ||
625 | n -= len; | ||
626 | } | ||
627 | return n; | ||
628 | } | ||
629 | #endif | ||
630 | stac(); | 573 | stac(); |
631 | if (movsl_is_ok(to, from, n)) | 574 | if (movsl_is_ok(to, from, n)) |
632 | __copy_user(to, from, n); | 575 | __copy_user(to, from, n); |