diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/byteorder.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/hpet.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/kprobes.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/syscall_table_32.S | 2 | ||||
-rw-r--r-- | arch/x86/mm/pageattr.c | 10 | ||||
-rw-r--r-- | arch/x86/mm/pat.c | 45 |
7 files changed, 21 insertions, 43 deletions
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index a9f8a814a1f7..4a8e80cdcfa5 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild | |||
@@ -22,4 +22,3 @@ unifdef-y += unistd_32.h | |||
22 | unifdef-y += unistd_64.h | 22 | unifdef-y += unistd_64.h |
23 | unifdef-y += vm86.h | 23 | unifdef-y += vm86.h |
24 | unifdef-y += vsyscall.h | 24 | unifdef-y += vsyscall.h |
25 | unifdef-y += swab.h | ||
diff --git a/arch/x86/include/asm/byteorder.h b/arch/x86/include/asm/byteorder.h index 7c49917e3d9d..b13a7a88f3eb 100644 --- a/arch/x86/include/asm/byteorder.h +++ b/arch/x86/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASM_X86_BYTEORDER_H | 1 | #ifndef _ASM_X86_BYTEORDER_H |
2 | #define _ASM_X86_BYTEORDER_H | 2 | #define _ASM_X86_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
6 | 5 | ||
7 | #endif /* _ASM_X86_BYTEORDER_H */ | 6 | #endif /* _ASM_X86_BYTEORDER_H */ |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index cd759ad90690..64d5ad0b8add 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -628,11 +628,12 @@ static int hpet_cpuhp_notify(struct notifier_block *n, | |||
628 | 628 | ||
629 | switch (action & 0xf) { | 629 | switch (action & 0xf) { |
630 | case CPU_ONLINE: | 630 | case CPU_ONLINE: |
631 | INIT_DELAYED_WORK(&work.work, hpet_work); | 631 | INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work); |
632 | init_completion(&work.complete); | 632 | init_completion(&work.complete); |
633 | /* FIXME: add schedule_work_on() */ | 633 | /* FIXME: add schedule_work_on() */ |
634 | schedule_delayed_work_on(cpu, &work.work, 0); | 634 | schedule_delayed_work_on(cpu, &work.work, 0); |
635 | wait_for_completion(&work.complete); | 635 | wait_for_completion(&work.complete); |
636 | destroy_timer_on_stack(&work.work.timer); | ||
636 | break; | 637 | break; |
637 | case CPU_DEAD: | 638 | case CPU_DEAD: |
638 | if (hdev) { | 639 | if (hdev) { |
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c index 884d985b8b82..e948b28a5a9a 100644 --- a/arch/x86/kernel/kprobes.c +++ b/arch/x86/kernel/kprobes.c | |||
@@ -446,7 +446,7 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri, | |||
446 | static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs, | 446 | static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs, |
447 | struct kprobe_ctlblk *kcb) | 447 | struct kprobe_ctlblk *kcb) |
448 | { | 448 | { |
449 | #if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM) | 449 | #if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER) |
450 | if (p->ainsn.boostable == 1 && !p->post_handler) { | 450 | if (p->ainsn.boostable == 1 && !p->post_handler) { |
451 | /* Boost up -- we can execute copied instructions directly */ | 451 | /* Boost up -- we can execute copied instructions directly */ |
452 | reset_current_kprobe(); | 452 | reset_current_kprobe(); |
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S index d44395ff34c3..e2e86a08f31d 100644 --- a/arch/x86/kernel/syscall_table_32.S +++ b/arch/x86/kernel/syscall_table_32.S | |||
@@ -88,7 +88,7 @@ ENTRY(sys_call_table) | |||
88 | .long sys_uselib | 88 | .long sys_uselib |
89 | .long sys_swapon | 89 | .long sys_swapon |
90 | .long sys_reboot | 90 | .long sys_reboot |
91 | .long old_readdir | 91 | .long sys_old_readdir |
92 | .long old_mmap /* 90 */ | 92 | .long old_mmap /* 90 */ |
93 | .long sys_munmap | 93 | .long sys_munmap |
94 | .long sys_truncate | 94 | .long sys_truncate |
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 4cf30dee8161..e89d24815f26 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -555,12 +555,10 @@ repeat: | |||
555 | if (!pte_val(old_pte)) { | 555 | if (!pte_val(old_pte)) { |
556 | if (!primary) | 556 | if (!primary) |
557 | return 0; | 557 | return 0; |
558 | 558 | WARN(1, KERN_WARNING "CPA: called for zero pte. " | |
559 | /* | 559 | "vaddr = %lx cpa->vaddr = %lx\n", address, |
560 | * Special error value returned, indicating that the mapping | 560 | *cpa->vaddr); |
561 | * did not exist at this address. | 561 | return -EINVAL; |
562 | */ | ||
563 | return -EFAULT; | ||
564 | } | 562 | } |
565 | 563 | ||
566 | if (level == PG_LEVEL_4K) { | 564 | if (level == PG_LEVEL_4K) { |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 160c42d3eb8f..8b08fb955274 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -505,35 +505,6 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size) | |||
505 | } | 505 | } |
506 | #endif /* CONFIG_STRICT_DEVMEM */ | 506 | #endif /* CONFIG_STRICT_DEVMEM */ |
507 | 507 | ||
508 | /* | ||
509 | * Change the memory type for the physial address range in kernel identity | ||
510 | * mapping space if that range is a part of identity map. | ||
511 | */ | ||
512 | static int kernel_map_sync_memtype(u64 base, unsigned long size, | ||
513 | unsigned long flags) | ||
514 | { | ||
515 | unsigned long id_sz; | ||
516 | int ret; | ||
517 | |||
518 | if (!pat_enabled || base >= __pa(high_memory)) | ||
519 | return 0; | ||
520 | |||
521 | id_sz = (__pa(high_memory) < base + size) ? | ||
522 | __pa(high_memory) - base : | ||
523 | size; | ||
524 | |||
525 | ret = ioremap_change_attr((unsigned long)__va(base), id_sz, flags); | ||
526 | /* | ||
527 | * -EFAULT return means that the addr was not valid and did not have | ||
528 | * any identity mapping. That case is a success for | ||
529 | * kernel_map_sync_memtype. | ||
530 | */ | ||
531 | if (ret == -EFAULT) | ||
532 | ret = 0; | ||
533 | |||
534 | return ret; | ||
535 | } | ||
536 | |||
537 | int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, | 508 | int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, |
538 | unsigned long size, pgprot_t *vma_prot) | 509 | unsigned long size, pgprot_t *vma_prot) |
539 | { | 510 | { |
@@ -584,7 +555,9 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, | |||
584 | if (retval < 0) | 555 | if (retval < 0) |
585 | return 0; | 556 | return 0; |
586 | 557 | ||
587 | if (kernel_map_sync_memtype(offset, size, flags)) { | 558 | if (((pfn < max_low_pfn_mapped) || |
559 | (pfn >= (1UL<<(32 - PAGE_SHIFT)) && pfn < max_pfn_mapped)) && | ||
560 | ioremap_change_attr((unsigned long)__va(offset), size, flags) < 0) { | ||
588 | free_memtype(offset, offset + size); | 561 | free_memtype(offset, offset + size); |
589 | printk(KERN_INFO | 562 | printk(KERN_INFO |
590 | "%s:%d /dev/mem ioremap_change_attr failed %s for %Lx-%Lx\n", | 563 | "%s:%d /dev/mem ioremap_change_attr failed %s for %Lx-%Lx\n", |
@@ -632,7 +605,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, | |||
632 | int strict_prot) | 605 | int strict_prot) |
633 | { | 606 | { |
634 | int is_ram = 0; | 607 | int is_ram = 0; |
635 | int ret; | 608 | int id_sz, ret; |
636 | unsigned long flags; | 609 | unsigned long flags; |
637 | unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK); | 610 | unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK); |
638 | 611 | ||
@@ -673,7 +646,15 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, | |||
673 | flags); | 646 | flags); |
674 | } | 647 | } |
675 | 648 | ||
676 | if (kernel_map_sync_memtype(paddr, size, flags)) { | 649 | /* Need to keep identity mapping in sync */ |
650 | if (paddr >= __pa(high_memory)) | ||
651 | return 0; | ||
652 | |||
653 | id_sz = (__pa(high_memory) < paddr + size) ? | ||
654 | __pa(high_memory) - paddr : | ||
655 | size; | ||
656 | |||
657 | if (ioremap_change_attr((unsigned long)__va(paddr), id_sz, flags) < 0) { | ||
677 | free_memtype(paddr, paddr + size); | 658 | free_memtype(paddr, paddr + size); |
678 | printk(KERN_ERR | 659 | printk(KERN_ERR |
679 | "%s:%d reserve_pfn_range ioremap_change_attr failed %s " | 660 | "%s:%d reserve_pfn_range ioremap_change_attr failed %s " |