diff options
26 files changed, 175 insertions, 281 deletions
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 80abafb9bf33..9650c143afc1 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -906,27 +906,14 @@ long arch_ptrace(struct task_struct *child, long request, | |||
906 | return ret; | 906 | return ret; |
907 | } | 907 | } |
908 | 908 | ||
909 | #ifdef __ARMEB__ | ||
910 | #define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB | ||
911 | #else | ||
912 | #define AUDIT_ARCH_NR AUDIT_ARCH_ARM | ||
913 | #endif | ||
914 | |||
915 | asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) | 909 | asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) |
916 | { | 910 | { |
917 | unsigned long ip; | 911 | unsigned long ip; |
918 | 912 | ||
919 | /* | 913 | if (why) |
920 | * Save IP. IP is used to denote syscall entry/exit: | ||
921 | * IP = 0 -> entry, = 1 -> exit | ||
922 | */ | ||
923 | ip = regs->ARM_ip; | ||
924 | regs->ARM_ip = why; | ||
925 | |||
926 | if (!ip) | ||
927 | audit_syscall_exit(regs); | 914 | audit_syscall_exit(regs); |
928 | else | 915 | else |
929 | audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0, | 916 | audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, |
930 | regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); | 917 | regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); |
931 | 918 | ||
932 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 919 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) |
@@ -936,6 +923,13 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) | |||
936 | 923 | ||
937 | current_thread_info()->syscall = scno; | 924 | current_thread_info()->syscall = scno; |
938 | 925 | ||
926 | /* | ||
927 | * IP is used to denote syscall entry/exit: | ||
928 | * IP = 0 -> entry, =1 -> exit | ||
929 | */ | ||
930 | ip = regs->ARM_ip; | ||
931 | regs->ARM_ip = why; | ||
932 | |||
939 | /* the 0x80 provides a way for the tracing parent to distinguish | 933 | /* the 0x80 provides a way for the tracing parent to distinguish |
940 | between a syscall stop and SIGTRAP delivery */ | 934 | between a syscall stop and SIGTRAP delivery */ |
941 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) | 935 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index f6a4d32b0421..8f4644659777 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -251,8 +251,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void) | |||
251 | struct mm_struct *mm = &init_mm; | 251 | struct mm_struct *mm = &init_mm; |
252 | unsigned int cpu = smp_processor_id(); | 252 | unsigned int cpu = smp_processor_id(); |
253 | 253 | ||
254 | printk("CPU%u: Booted secondary processor\n", cpu); | ||
255 | |||
256 | /* | 254 | /* |
257 | * All kernel threads share the same mm context; grab a | 255 | * All kernel threads share the same mm context; grab a |
258 | * reference and switch to it. | 256 | * reference and switch to it. |
@@ -264,6 +262,8 @@ asmlinkage void __cpuinit secondary_start_kernel(void) | |||
264 | enter_lazy_tlb(mm, current); | 262 | enter_lazy_tlb(mm, current); |
265 | local_flush_tlb_all(); | 263 | local_flush_tlb_all(); |
266 | 264 | ||
265 | printk("CPU%u: Booted secondary processor\n", cpu); | ||
266 | |||
267 | cpu_init(); | 267 | cpu_init(); |
268 | preempt_disable(); | 268 | preempt_disable(); |
269 | trace_hardirqs_off(); | 269 | trace_hardirqs_off(); |
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c index d2b177905cdb..76cbb055dd05 100644 --- a/arch/arm/kernel/sys_arm.c +++ b/arch/arm/kernel/sys_arm.c | |||
@@ -115,7 +115,7 @@ int kernel_execve(const char *filename, | |||
115 | "Ir" (THREAD_START_SP - sizeof(regs)), | 115 | "Ir" (THREAD_START_SP - sizeof(regs)), |
116 | "r" (®s), | 116 | "r" (®s), |
117 | "Ir" (sizeof(regs)) | 117 | "Ir" (sizeof(regs)) |
118 | : "r0", "r1", "r2", "r3", "ip", "lr", "memory"); | 118 | : "r0", "r1", "r2", "r3", "r8", "r9", "ip", "lr", "memory"); |
119 | 119 | ||
120 | out: | 120 | out: |
121 | return ret; | 121 | return ret; |
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index f5104b7c52cd..463fb3bbe11e 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -1174,7 +1174,7 @@ out: | |||
1174 | 1174 | ||
1175 | bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu) | 1175 | bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu) |
1176 | { | 1176 | { |
1177 | return irqchip_in_kernel(vcpu->kcm) == (vcpu->arch.apic != NULL); | 1177 | return irqchip_in_kernel(vcpu->kvm) == (vcpu->arch.apic != NULL); |
1178 | } | 1178 | } |
1179 | 1179 | ||
1180 | int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) | 1180 | int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) |
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h index 548da3aa0a30..d58fc4e4149c 100644 --- a/arch/powerpc/include/asm/exception-64s.h +++ b/arch/powerpc/include/asm/exception-64s.h | |||
@@ -288,13 +288,6 @@ label##_hv: \ | |||
288 | /* Exception addition: Hard disable interrupts */ | 288 | /* Exception addition: Hard disable interrupts */ |
289 | #define DISABLE_INTS SOFT_DISABLE_INTS(r10,r11) | 289 | #define DISABLE_INTS SOFT_DISABLE_INTS(r10,r11) |
290 | 290 | ||
291 | /* Exception addition: Keep interrupt state */ | ||
292 | #define ENABLE_INTS \ | ||
293 | ld r11,PACAKMSR(r13); \ | ||
294 | ld r12,_MSR(r1); \ | ||
295 | rlwimi r11,r12,0,MSR_EE; \ | ||
296 | mtmsrd r11,1 | ||
297 | |||
298 | #define ADD_NVGPRS \ | 291 | #define ADD_NVGPRS \ |
299 | bl .save_nvgprs | 292 | bl .save_nvgprs |
300 | 293 | ||
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index f8a7a1a1a9f4..fc6015027a86 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -767,16 +767,6 @@ do_work: | |||
767 | SOFT_DISABLE_INTS(r3,r4) | 767 | SOFT_DISABLE_INTS(r3,r4) |
768 | 1: bl .preempt_schedule_irq | 768 | 1: bl .preempt_schedule_irq |
769 | 769 | ||
770 | /* Hard-disable interrupts again (and update PACA) */ | ||
771 | #ifdef CONFIG_PPC_BOOK3E | ||
772 | wrteei 0 | ||
773 | #else | ||
774 | ld r10,PACAKMSR(r13) /* Get kernel MSR without EE */ | ||
775 | mtmsrd r10,1 | ||
776 | #endif /* CONFIG_PPC_BOOK3E */ | ||
777 | li r0,PACA_IRQ_HARD_DIS | ||
778 | stb r0,PACAIRQHAPPENED(r13) | ||
779 | |||
780 | /* Re-test flags and eventually loop */ | 770 | /* Re-test flags and eventually loop */ |
781 | clrrdi r9,r1,THREAD_SHIFT | 771 | clrrdi r9,r1,THREAD_SHIFT |
782 | ld r4,TI_FLAGS(r9) | 772 | ld r4,TI_FLAGS(r9) |
@@ -787,14 +777,6 @@ do_work: | |||
787 | user_work: | 777 | user_work: |
788 | #endif /* CONFIG_PREEMPT */ | 778 | #endif /* CONFIG_PREEMPT */ |
789 | 779 | ||
790 | /* Enable interrupts */ | ||
791 | #ifdef CONFIG_PPC_BOOK3E | ||
792 | wrteei 1 | ||
793 | #else | ||
794 | ori r10,r10,MSR_EE | ||
795 | mtmsrd r10,1 | ||
796 | #endif /* CONFIG_PPC_BOOK3E */ | ||
797 | |||
798 | andi. r0,r4,_TIF_NEED_RESCHED | 780 | andi. r0,r4,_TIF_NEED_RESCHED |
799 | beq 1f | 781 | beq 1f |
800 | bl .restore_interrupts | 782 | bl .restore_interrupts |
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index cb705fdbb458..8f880bc77c56 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
@@ -768,8 +768,8 @@ alignment_common: | |||
768 | std r3,_DAR(r1) | 768 | std r3,_DAR(r1) |
769 | std r4,_DSISR(r1) | 769 | std r4,_DSISR(r1) |
770 | bl .save_nvgprs | 770 | bl .save_nvgprs |
771 | DISABLE_INTS | ||
771 | addi r3,r1,STACK_FRAME_OVERHEAD | 772 | addi r3,r1,STACK_FRAME_OVERHEAD |
772 | ENABLE_INTS | ||
773 | bl .alignment_exception | 773 | bl .alignment_exception |
774 | b .ret_from_except | 774 | b .ret_from_except |
775 | 775 | ||
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 43eb74fcedde..c6c6f3b7f8cd 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -260,11 +260,17 @@ EXPORT_SYMBOL(arch_local_irq_restore); | |||
260 | * if they are currently disabled. This is typically called before | 260 | * if they are currently disabled. This is typically called before |
261 | * schedule() or do_signal() when returning to userspace. We do it | 261 | * schedule() or do_signal() when returning to userspace. We do it |
262 | * in C to avoid the burden of dealing with lockdep etc... | 262 | * in C to avoid the burden of dealing with lockdep etc... |
263 | * | ||
264 | * NOTE: This is called with interrupts hard disabled but not marked | ||
265 | * as such in paca->irq_happened, so we need to resync this. | ||
263 | */ | 266 | */ |
264 | void restore_interrupts(void) | 267 | void restore_interrupts(void) |
265 | { | 268 | { |
266 | if (irqs_disabled()) | 269 | if (irqs_disabled()) { |
270 | local_paca->irq_happened |= PACA_IRQ_HARD_DIS; | ||
267 | local_irq_enable(); | 271 | local_irq_enable(); |
272 | } else | ||
273 | __hard_irq_enable(); | ||
268 | } | 274 | } |
269 | 275 | ||
270 | #endif /* CONFIG_PPC64 */ | 276 | #endif /* CONFIG_PPC64 */ |
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 6aa0c663e247..158972341a2d 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -248,7 +248,7 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) | |||
248 | addr, regs->nip, regs->link, code); | 248 | addr, regs->nip, regs->link, code); |
249 | } | 249 | } |
250 | 250 | ||
251 | if (!arch_irq_disabled_regs(regs)) | 251 | if (arch_irqs_disabled() && !arch_irq_disabled_regs(regs)) |
252 | local_irq_enable(); | 252 | local_irq_enable(); |
253 | 253 | ||
254 | memset(&info, 0, sizeof(info)); | 254 | memset(&info, 0, sizeof(info)); |
@@ -1019,7 +1019,9 @@ void __kprobes program_check_exception(struct pt_regs *regs) | |||
1019 | return; | 1019 | return; |
1020 | } | 1020 | } |
1021 | 1021 | ||
1022 | local_irq_enable(); | 1022 | /* We restore the interrupt state now */ |
1023 | if (!arch_irq_disabled_regs(regs)) | ||
1024 | local_irq_enable(); | ||
1023 | 1025 | ||
1024 | #ifdef CONFIG_MATH_EMULATION | 1026 | #ifdef CONFIG_MATH_EMULATION |
1025 | /* (reason & REASON_ILLEGAL) would be the obvious thing here, | 1027 | /* (reason & REASON_ILLEGAL) would be the obvious thing here, |
@@ -1069,6 +1071,10 @@ void alignment_exception(struct pt_regs *regs) | |||
1069 | { | 1071 | { |
1070 | int sig, code, fixed = 0; | 1072 | int sig, code, fixed = 0; |
1071 | 1073 | ||
1074 | /* We restore the interrupt state now */ | ||
1075 | if (!arch_irq_disabled_regs(regs)) | ||
1076 | local_irq_enable(); | ||
1077 | |||
1072 | /* we don't implement logging of alignment exceptions */ | 1078 | /* we don't implement logging of alignment exceptions */ |
1073 | if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS)) | 1079 | if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS)) |
1074 | fixed = fix_alignment(regs); | 1080 | fixed = fix_alignment(regs); |
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index ddc485a529f2..c3beaeef3f60 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c | |||
@@ -258,6 +258,8 @@ static long kvmppc_get_guest_page(struct kvm *kvm, unsigned long gfn, | |||
258 | !(memslot->userspace_addr & (s - 1))) { | 258 | !(memslot->userspace_addr & (s - 1))) { |
259 | start &= ~(s - 1); | 259 | start &= ~(s - 1); |
260 | pgsize = s; | 260 | pgsize = s; |
261 | get_page(hpage); | ||
262 | put_page(page); | ||
261 | page = hpage; | 263 | page = hpage; |
262 | } | 264 | } |
263 | } | 265 | } |
@@ -281,11 +283,8 @@ static long kvmppc_get_guest_page(struct kvm *kvm, unsigned long gfn, | |||
281 | err = 0; | 283 | err = 0; |
282 | 284 | ||
283 | out: | 285 | out: |
284 | if (got) { | 286 | if (got) |
285 | if (PageHuge(page)) | ||
286 | page = compound_head(page); | ||
287 | put_page(page); | 287 | put_page(page); |
288 | } | ||
289 | return err; | 288 | return err; |
290 | 289 | ||
291 | up_err: | 290 | up_err: |
@@ -678,8 +677,15 @@ int kvmppc_book3s_hv_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
678 | SetPageDirty(page); | 677 | SetPageDirty(page); |
679 | 678 | ||
680 | out_put: | 679 | out_put: |
681 | if (page) | 680 | if (page) { |
682 | put_page(page); | 681 | /* |
682 | * We drop pages[0] here, not page because page might | ||
683 | * have been set to the head page of a compound, but | ||
684 | * we have to drop the reference on the correct tail | ||
685 | * page to match the get inside gup() | ||
686 | */ | ||
687 | put_page(pages[0]); | ||
688 | } | ||
683 | return ret; | 689 | return ret; |
684 | 690 | ||
685 | out_unlock: | 691 | out_unlock: |
@@ -979,6 +985,7 @@ void *kvmppc_pin_guest_page(struct kvm *kvm, unsigned long gpa, | |||
979 | pa = *physp; | 985 | pa = *physp; |
980 | } | 986 | } |
981 | page = pfn_to_page(pa >> PAGE_SHIFT); | 987 | page = pfn_to_page(pa >> PAGE_SHIFT); |
988 | get_page(page); | ||
982 | } else { | 989 | } else { |
983 | hva = gfn_to_hva_memslot(memslot, gfn); | 990 | hva = gfn_to_hva_memslot(memslot, gfn); |
984 | npages = get_user_pages_fast(hva, 1, 1, pages); | 991 | npages = get_user_pages_fast(hva, 1, 1, pages); |
@@ -991,8 +998,6 @@ void *kvmppc_pin_guest_page(struct kvm *kvm, unsigned long gpa, | |||
991 | page = compound_head(page); | 998 | page = compound_head(page); |
992 | psize <<= compound_order(page); | 999 | psize <<= compound_order(page); |
993 | } | 1000 | } |
994 | if (!kvm->arch.using_mmu_notifiers) | ||
995 | get_page(page); | ||
996 | offset = gpa & (psize - 1); | 1001 | offset = gpa & (psize - 1); |
997 | if (nb_ret) | 1002 | if (nb_ret) |
998 | *nb_ret = psize - offset; | 1003 | *nb_ret = psize - offset; |
@@ -1003,7 +1008,6 @@ void kvmppc_unpin_guest_page(struct kvm *kvm, void *va) | |||
1003 | { | 1008 | { |
1004 | struct page *page = virt_to_page(va); | 1009 | struct page *page = virt_to_page(va); |
1005 | 1010 | ||
1006 | page = compound_head(page); | ||
1007 | put_page(page); | 1011 | put_page(page); |
1008 | } | 1012 | } |
1009 | 1013 | ||
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 01294a5099dd..108d1f580177 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c | |||
@@ -1192,8 +1192,6 @@ static void unpin_slot(struct kvm *kvm, int slot_id) | |||
1192 | continue; | 1192 | continue; |
1193 | pfn = physp[j] >> PAGE_SHIFT; | 1193 | pfn = physp[j] >> PAGE_SHIFT; |
1194 | page = pfn_to_page(pfn); | 1194 | page = pfn_to_page(pfn); |
1195 | if (PageHuge(page)) | ||
1196 | page = compound_head(page); | ||
1197 | SetPageDirty(page); | 1195 | SetPageDirty(page); |
1198 | put_page(page); | 1196 | put_page(page); |
1199 | } | 1197 | } |
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index b8ba6e4a27e4..e554e5ad2fe8 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c | |||
@@ -79,7 +79,6 @@ struct kvm_task_sleep_node { | |||
79 | u32 token; | 79 | u32 token; |
80 | int cpu; | 80 | int cpu; |
81 | bool halted; | 81 | bool halted; |
82 | struct mm_struct *mm; | ||
83 | }; | 82 | }; |
84 | 83 | ||
85 | static struct kvm_task_sleep_head { | 84 | static struct kvm_task_sleep_head { |
@@ -126,9 +125,7 @@ void kvm_async_pf_task_wait(u32 token) | |||
126 | 125 | ||
127 | n.token = token; | 126 | n.token = token; |
128 | n.cpu = smp_processor_id(); | 127 | n.cpu = smp_processor_id(); |
129 | n.mm = current->active_mm; | ||
130 | n.halted = idle || preempt_count() > 1; | 128 | n.halted = idle || preempt_count() > 1; |
131 | atomic_inc(&n.mm->mm_count); | ||
132 | init_waitqueue_head(&n.wq); | 129 | init_waitqueue_head(&n.wq); |
133 | hlist_add_head(&n.link, &b->list); | 130 | hlist_add_head(&n.link, &b->list); |
134 | spin_unlock(&b->lock); | 131 | spin_unlock(&b->lock); |
@@ -161,9 +158,6 @@ EXPORT_SYMBOL_GPL(kvm_async_pf_task_wait); | |||
161 | static void apf_task_wake_one(struct kvm_task_sleep_node *n) | 158 | static void apf_task_wake_one(struct kvm_task_sleep_node *n) |
162 | { | 159 | { |
163 | hlist_del_init(&n->link); | 160 | hlist_del_init(&n->link); |
164 | if (!n->mm) | ||
165 | return; | ||
166 | mmdrop(n->mm); | ||
167 | if (n->halted) | 161 | if (n->halted) |
168 | smp_send_reschedule(n->cpu); | 162 | smp_send_reschedule(n->cpu); |
169 | else if (waitqueue_active(&n->wq)) | 163 | else if (waitqueue_active(&n->wq)) |
@@ -207,7 +201,7 @@ again: | |||
207 | * async PF was not yet handled. | 201 | * async PF was not yet handled. |
208 | * Add dummy entry for the token. | 202 | * Add dummy entry for the token. |
209 | */ | 203 | */ |
210 | n = kmalloc(sizeof(*n), GFP_ATOMIC); | 204 | n = kzalloc(sizeof(*n), GFP_ATOMIC); |
211 | if (!n) { | 205 | if (!n) { |
212 | /* | 206 | /* |
213 | * Allocation failed! Busy wait while other cpu | 207 | * Allocation failed! Busy wait while other cpu |
@@ -219,7 +213,6 @@ again: | |||
219 | } | 213 | } |
220 | n->token = token; | 214 | n->token = token; |
221 | n->cpu = smp_processor_id(); | 215 | n->cpu = smp_processor_id(); |
222 | n->mm = NULL; | ||
223 | init_waitqueue_head(&n->wq); | 216 | init_waitqueue_head(&n->wq); |
224 | hlist_add_head(&n->link, &b->list); | 217 | hlist_add_head(&n->link, &b->list); |
225 | } else | 218 | } else |
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 733ca39f367e..43d8b48b23e6 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -423,6 +423,7 @@ void set_personality_ia32(bool x32) | |||
423 | current_thread_info()->status |= TS_COMPAT; | 423 | current_thread_info()->status |= TS_COMPAT; |
424 | } | 424 | } |
425 | } | 425 | } |
426 | EXPORT_SYMBOL_GPL(set_personality_ia32); | ||
426 | 427 | ||
427 | unsigned long get_wchan(struct task_struct *p) | 428 | unsigned long get_wchan(struct task_struct *p) |
428 | { | 429 | { |
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index 71f4727da373..5a98aa272184 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c | |||
@@ -185,10 +185,22 @@ void __init setup_per_cpu_areas(void) | |||
185 | #endif | 185 | #endif |
186 | rc = -EINVAL; | 186 | rc = -EINVAL; |
187 | if (pcpu_chosen_fc != PCPU_FC_PAGE) { | 187 | if (pcpu_chosen_fc != PCPU_FC_PAGE) { |
188 | const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE; | ||
189 | const size_t dyn_size = PERCPU_MODULE_RESERVE + | 188 | const size_t dyn_size = PERCPU_MODULE_RESERVE + |
190 | PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE; | 189 | PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE; |
190 | size_t atom_size; | ||
191 | 191 | ||
192 | /* | ||
193 | * On 64bit, use PMD_SIZE for atom_size so that embedded | ||
194 | * percpu areas are aligned to PMD. This, in the future, | ||
195 | * can also allow using PMD mappings in vmalloc area. Use | ||
196 | * PAGE_SIZE on 32bit as vmalloc space is highly contended | ||
197 | * and large vmalloc area allocs can easily fail. | ||
198 | */ | ||
199 | #ifdef CONFIG_X86_64 | ||
200 | atom_size = PMD_SIZE; | ||
201 | #else | ||
202 | atom_size = PAGE_SIZE; | ||
203 | #endif | ||
192 | rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE, | 204 | rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE, |
193 | dyn_size, atom_size, | 205 | dyn_size, atom_size, |
194 | pcpu_cpu_distance, | 206 | pcpu_cpu_distance, |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 91a5e989abcf..185a2b823a2d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -6581,6 +6581,7 @@ void kvm_arch_async_page_present(struct kvm_vcpu *vcpu, | |||
6581 | kvm_inject_page_fault(vcpu, &fault); | 6581 | kvm_inject_page_fault(vcpu, &fault); |
6582 | } | 6582 | } |
6583 | vcpu->arch.apf.halted = false; | 6583 | vcpu->arch.apf.halted = false; |
6584 | vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; | ||
6584 | } | 6585 | } |
6585 | 6586 | ||
6586 | bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu) | 6587 | bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu) |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index a8f8844b8d32..95dccce8e979 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #include <asm/stackprotector.h> | 63 | #include <asm/stackprotector.h> |
64 | #include <asm/hypervisor.h> | 64 | #include <asm/hypervisor.h> |
65 | #include <asm/mwait.h> | 65 | #include <asm/mwait.h> |
66 | #include <asm/pci_x86.h> | ||
66 | 67 | ||
67 | #ifdef CONFIG_ACPI | 68 | #ifdef CONFIG_ACPI |
68 | #include <linux/acpi.h> | 69 | #include <linux/acpi.h> |
@@ -809,9 +810,40 @@ static void xen_io_delay(void) | |||
809 | } | 810 | } |
810 | 811 | ||
811 | #ifdef CONFIG_X86_LOCAL_APIC | 812 | #ifdef CONFIG_X86_LOCAL_APIC |
813 | static unsigned long xen_set_apic_id(unsigned int x) | ||
814 | { | ||
815 | WARN_ON(1); | ||
816 | return x; | ||
817 | } | ||
818 | static unsigned int xen_get_apic_id(unsigned long x) | ||
819 | { | ||
820 | return ((x)>>24) & 0xFFu; | ||
821 | } | ||
812 | static u32 xen_apic_read(u32 reg) | 822 | static u32 xen_apic_read(u32 reg) |
813 | { | 823 | { |
814 | return 0; | 824 | struct xen_platform_op op = { |
825 | .cmd = XENPF_get_cpuinfo, | ||
826 | .interface_version = XENPF_INTERFACE_VERSION, | ||
827 | .u.pcpu_info.xen_cpuid = 0, | ||
828 | }; | ||
829 | int ret = 0; | ||
830 | |||
831 | /* Shouldn't need this as APIC is turned off for PV, and we only | ||
832 | * get called on the bootup processor. But just in case. */ | ||
833 | if (!xen_initial_domain() || smp_processor_id()) | ||
834 | return 0; | ||
835 | |||
836 | if (reg == APIC_LVR) | ||
837 | return 0x10; | ||
838 | |||
839 | if (reg != APIC_ID) | ||
840 | return 0; | ||
841 | |||
842 | ret = HYPERVISOR_dom0_op(&op); | ||
843 | if (ret) | ||
844 | return 0; | ||
845 | |||
846 | return op.u.pcpu_info.apic_id << 24; | ||
815 | } | 847 | } |
816 | 848 | ||
817 | static void xen_apic_write(u32 reg, u32 val) | 849 | static void xen_apic_write(u32 reg, u32 val) |
@@ -849,6 +881,8 @@ static void set_xen_basic_apic_ops(void) | |||
849 | apic->icr_write = xen_apic_icr_write; | 881 | apic->icr_write = xen_apic_icr_write; |
850 | apic->wait_icr_idle = xen_apic_wait_icr_idle; | 882 | apic->wait_icr_idle = xen_apic_wait_icr_idle; |
851 | apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle; | 883 | apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle; |
884 | apic->set_apic_id = xen_set_apic_id; | ||
885 | apic->get_apic_id = xen_get_apic_id; | ||
852 | } | 886 | } |
853 | 887 | ||
854 | #endif | 888 | #endif |
@@ -1365,8 +1399,10 @@ asmlinkage void __init xen_start_kernel(void) | |||
1365 | /* Make sure ACS will be enabled */ | 1399 | /* Make sure ACS will be enabled */ |
1366 | pci_request_acs(); | 1400 | pci_request_acs(); |
1367 | } | 1401 | } |
1368 | 1402 | #ifdef CONFIG_PCI | |
1369 | 1403 | /* PCI BIOS service won't work from a PV guest. */ | |
1404 | pci_probe &= ~PCI_PROBE_BIOS; | ||
1405 | #endif | ||
1370 | xen_raw_console_write("about to get started...\n"); | 1406 | xen_raw_console_write("about to get started...\n"); |
1371 | 1407 | ||
1372 | xen_setup_runstate_info(0); | 1408 | xen_setup_runstate_info(0); |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index b8e279479a6b..69f5857660ac 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -353,8 +353,13 @@ static pteval_t pte_mfn_to_pfn(pteval_t val) | |||
353 | { | 353 | { |
354 | if (val & _PAGE_PRESENT) { | 354 | if (val & _PAGE_PRESENT) { |
355 | unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; | 355 | unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; |
356 | unsigned long pfn = mfn_to_pfn(mfn); | ||
357 | |||
356 | pteval_t flags = val & PTE_FLAGS_MASK; | 358 | pteval_t flags = val & PTE_FLAGS_MASK; |
357 | val = ((pteval_t)mfn_to_pfn(mfn) << PAGE_SHIFT) | flags; | 359 | if (unlikely(pfn == ~0)) |
360 | val = flags & ~_PAGE_PRESENT; | ||
361 | else | ||
362 | val = ((pteval_t)pfn << PAGE_SHIFT) | flags; | ||
358 | } | 363 | } |
359 | 364 | ||
360 | return val; | 365 | return val; |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 80fce51e2f43..62892a826ede 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -398,10 +398,8 @@ static int init_render_ring(struct intel_ring_buffer *ring) | |||
398 | return ret; | 398 | return ret; |
399 | } | 399 | } |
400 | 400 | ||
401 | if (INTEL_INFO(dev)->gen >= 6) { | ||
402 | I915_WRITE(INSTPM, | ||
403 | INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING); | ||
404 | 401 | ||
402 | if (IS_GEN6(dev)) { | ||
405 | /* From the Sandybridge PRM, volume 1 part 3, page 24: | 403 | /* From the Sandybridge PRM, volume 1 part 3, page 24: |
406 | * "If this bit is set, STCunit will have LRA as replacement | 404 | * "If this bit is set, STCunit will have LRA as replacement |
407 | * policy. [...] This bit must be reset. LRA replacement | 405 | * policy. [...] This bit must be reset. LRA replacement |
@@ -411,6 +409,11 @@ static int init_render_ring(struct intel_ring_buffer *ring) | |||
411 | CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT); | 409 | CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT); |
412 | } | 410 | } |
413 | 411 | ||
412 | if (INTEL_INFO(dev)->gen >= 6) { | ||
413 | I915_WRITE(INSTPM, | ||
414 | INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING); | ||
415 | } | ||
416 | |||
414 | return ret; | 417 | return ret; |
415 | } | 418 | } |
416 | 419 | ||
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 232d77d07d8b..ae5e748f39bb 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -1220,8 +1220,14 @@ static bool intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct in | |||
1220 | 1220 | ||
1221 | static int intel_sdvo_supports_hotplug(struct intel_sdvo *intel_sdvo) | 1221 | static int intel_sdvo_supports_hotplug(struct intel_sdvo *intel_sdvo) |
1222 | { | 1222 | { |
1223 | struct drm_device *dev = intel_sdvo->base.base.dev; | ||
1223 | u8 response[2]; | 1224 | u8 response[2]; |
1224 | 1225 | ||
1226 | /* HW Erratum: SDVO Hotplug is broken on all i945G chips, there's noise | ||
1227 | * on the line. */ | ||
1228 | if (IS_I945G(dev) || IS_I945GM(dev)) | ||
1229 | return false; | ||
1230 | |||
1225 | return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, | 1231 | return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, |
1226 | &response, 2) && response[0]; | 1232 | &response, 2) && response[0]; |
1227 | } | 1233 | } |
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c index e2be95af2e52..77e564667b5c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_i2c.c +++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c | |||
@@ -29,10 +29,6 @@ | |||
29 | #include "nouveau_i2c.h" | 29 | #include "nouveau_i2c.h" |
30 | #include "nouveau_hw.h" | 30 | #include "nouveau_hw.h" |
31 | 31 | ||
32 | #define T_TIMEOUT 2200000 | ||
33 | #define T_RISEFALL 1000 | ||
34 | #define T_HOLD 5000 | ||
35 | |||
36 | static void | 32 | static void |
37 | i2c_drive_scl(void *data, int state) | 33 | i2c_drive_scl(void *data, int state) |
38 | { | 34 | { |
@@ -113,175 +109,6 @@ i2c_sense_sda(void *data) | |||
113 | return 0; | 109 | return 0; |
114 | } | 110 | } |
115 | 111 | ||
116 | static void | ||
117 | i2c_delay(struct nouveau_i2c_chan *port, u32 nsec) | ||
118 | { | ||
119 | udelay((nsec + 500) / 1000); | ||
120 | } | ||
121 | |||
122 | static bool | ||
123 | i2c_raise_scl(struct nouveau_i2c_chan *port) | ||
124 | { | ||
125 | u32 timeout = T_TIMEOUT / T_RISEFALL; | ||
126 | |||
127 | i2c_drive_scl(port, 1); | ||
128 | do { | ||
129 | i2c_delay(port, T_RISEFALL); | ||
130 | } while (!i2c_sense_scl(port) && --timeout); | ||
131 | |||
132 | return timeout != 0; | ||
133 | } | ||
134 | |||
135 | static int | ||
136 | i2c_start(struct nouveau_i2c_chan *port) | ||
137 | { | ||
138 | int ret = 0; | ||
139 | |||
140 | port->state = i2c_sense_scl(port); | ||
141 | port->state |= i2c_sense_sda(port) << 1; | ||
142 | if (port->state != 3) { | ||
143 | i2c_drive_scl(port, 0); | ||
144 | i2c_drive_sda(port, 1); | ||
145 | if (!i2c_raise_scl(port)) | ||
146 | ret = -EBUSY; | ||
147 | } | ||
148 | |||
149 | i2c_drive_sda(port, 0); | ||
150 | i2c_delay(port, T_HOLD); | ||
151 | i2c_drive_scl(port, 0); | ||
152 | i2c_delay(port, T_HOLD); | ||
153 | return ret; | ||
154 | } | ||
155 | |||
156 | static void | ||
157 | i2c_stop(struct nouveau_i2c_chan *port) | ||
158 | { | ||
159 | i2c_drive_scl(port, 0); | ||
160 | i2c_drive_sda(port, 0); | ||
161 | i2c_delay(port, T_RISEFALL); | ||
162 | |||
163 | i2c_drive_scl(port, 1); | ||
164 | i2c_delay(port, T_HOLD); | ||
165 | i2c_drive_sda(port, 1); | ||
166 | i2c_delay(port, T_HOLD); | ||
167 | } | ||
168 | |||
169 | static int | ||
170 | i2c_bitw(struct nouveau_i2c_chan *port, int sda) | ||
171 | { | ||
172 | i2c_drive_sda(port, sda); | ||
173 | i2c_delay(port, T_RISEFALL); | ||
174 | |||
175 | if (!i2c_raise_scl(port)) | ||
176 | return -ETIMEDOUT; | ||
177 | i2c_delay(port, T_HOLD); | ||
178 | |||
179 | i2c_drive_scl(port, 0); | ||
180 | i2c_delay(port, T_HOLD); | ||
181 | return 0; | ||
182 | } | ||
183 | |||
184 | static int | ||
185 | i2c_bitr(struct nouveau_i2c_chan *port) | ||
186 | { | ||
187 | int sda; | ||
188 | |||
189 | i2c_drive_sda(port, 1); | ||
190 | i2c_delay(port, T_RISEFALL); | ||
191 | |||
192 | if (!i2c_raise_scl(port)) | ||
193 | return -ETIMEDOUT; | ||
194 | i2c_delay(port, T_HOLD); | ||
195 | |||
196 | sda = i2c_sense_sda(port); | ||
197 | |||
198 | i2c_drive_scl(port, 0); | ||
199 | i2c_delay(port, T_HOLD); | ||
200 | return sda; | ||
201 | } | ||
202 | |||
203 | static int | ||
204 | i2c_get_byte(struct nouveau_i2c_chan *port, u8 *byte, bool last) | ||
205 | { | ||
206 | int i, bit; | ||
207 | |||
208 | *byte = 0; | ||
209 | for (i = 7; i >= 0; i--) { | ||
210 | bit = i2c_bitr(port); | ||
211 | if (bit < 0) | ||
212 | return bit; | ||
213 | *byte |= bit << i; | ||
214 | } | ||
215 | |||
216 | return i2c_bitw(port, last ? 1 : 0); | ||
217 | } | ||
218 | |||
219 | static int | ||
220 | i2c_put_byte(struct nouveau_i2c_chan *port, u8 byte) | ||
221 | { | ||
222 | int i, ret; | ||
223 | for (i = 7; i >= 0; i--) { | ||
224 | ret = i2c_bitw(port, !!(byte & (1 << i))); | ||
225 | if (ret < 0) | ||
226 | return ret; | ||
227 | } | ||
228 | |||
229 | ret = i2c_bitr(port); | ||
230 | if (ret == 1) /* nack */ | ||
231 | ret = -EIO; | ||
232 | return ret; | ||
233 | } | ||
234 | |||
235 | static int | ||
236 | i2c_addr(struct nouveau_i2c_chan *port, struct i2c_msg *msg) | ||
237 | { | ||
238 | u32 addr = msg->addr << 1; | ||
239 | if (msg->flags & I2C_M_RD) | ||
240 | addr |= 1; | ||
241 | return i2c_put_byte(port, addr); | ||
242 | } | ||
243 | |||
244 | static int | ||
245 | i2c_bit_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) | ||
246 | { | ||
247 | struct nouveau_i2c_chan *port = (struct nouveau_i2c_chan *)adap; | ||
248 | struct i2c_msg *msg = msgs; | ||
249 | int ret = 0, mcnt = num; | ||
250 | |||
251 | while (!ret && mcnt--) { | ||
252 | u8 remaining = msg->len; | ||
253 | u8 *ptr = msg->buf; | ||
254 | |||
255 | ret = i2c_start(port); | ||
256 | if (ret == 0) | ||
257 | ret = i2c_addr(port, msg); | ||
258 | |||
259 | if (msg->flags & I2C_M_RD) { | ||
260 | while (!ret && remaining--) | ||
261 | ret = i2c_get_byte(port, ptr++, !remaining); | ||
262 | } else { | ||
263 | while (!ret && remaining--) | ||
264 | ret = i2c_put_byte(port, *ptr++); | ||
265 | } | ||
266 | |||
267 | msg++; | ||
268 | } | ||
269 | |||
270 | i2c_stop(port); | ||
271 | return (ret < 0) ? ret : num; | ||
272 | } | ||
273 | |||
274 | static u32 | ||
275 | i2c_bit_func(struct i2c_adapter *adap) | ||
276 | { | ||
277 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; | ||
278 | } | ||
279 | |||
280 | const struct i2c_algorithm nouveau_i2c_bit_algo = { | ||
281 | .master_xfer = i2c_bit_xfer, | ||
282 | .functionality = i2c_bit_func | ||
283 | }; | ||
284 | |||
285 | static const uint32_t nv50_i2c_port[] = { | 112 | static const uint32_t nv50_i2c_port[] = { |
286 | 0x00e138, 0x00e150, 0x00e168, 0x00e180, | 113 | 0x00e138, 0x00e150, 0x00e168, 0x00e180, |
287 | 0x00e254, 0x00e274, 0x00e764, 0x00e780, | 114 | 0x00e254, 0x00e274, 0x00e764, 0x00e780, |
@@ -384,12 +211,10 @@ nouveau_i2c_init(struct drm_device *dev) | |||
384 | case 0: /* NV04:NV50 */ | 211 | case 0: /* NV04:NV50 */ |
385 | port->drive = entry[0]; | 212 | port->drive = entry[0]; |
386 | port->sense = entry[1]; | 213 | port->sense = entry[1]; |
387 | port->adapter.algo = &nouveau_i2c_bit_algo; | ||
388 | break; | 214 | break; |
389 | case 4: /* NV4E */ | 215 | case 4: /* NV4E */ |
390 | port->drive = 0x600800 + entry[1]; | 216 | port->drive = 0x600800 + entry[1]; |
391 | port->sense = port->drive; | 217 | port->sense = port->drive; |
392 | port->adapter.algo = &nouveau_i2c_bit_algo; | ||
393 | break; | 218 | break; |
394 | case 5: /* NV50- */ | 219 | case 5: /* NV50- */ |
395 | port->drive = entry[0] & 0x0f; | 220 | port->drive = entry[0] & 0x0f; |
@@ -402,7 +227,6 @@ nouveau_i2c_init(struct drm_device *dev) | |||
402 | port->drive = 0x00d014 + (port->drive * 0x20); | 227 | port->drive = 0x00d014 + (port->drive * 0x20); |
403 | port->sense = port->drive; | 228 | port->sense = port->drive; |
404 | } | 229 | } |
405 | port->adapter.algo = &nouveau_i2c_bit_algo; | ||
406 | break; | 230 | break; |
407 | case 6: /* NV50- DP AUX */ | 231 | case 6: /* NV50- DP AUX */ |
408 | port->drive = entry[0]; | 232 | port->drive = entry[0]; |
@@ -413,7 +237,7 @@ nouveau_i2c_init(struct drm_device *dev) | |||
413 | break; | 237 | break; |
414 | } | 238 | } |
415 | 239 | ||
416 | if (!port->adapter.algo) { | 240 | if (!port->adapter.algo && !port->drive) { |
417 | NV_ERROR(dev, "I2C%d: type %d index %x/%x unknown\n", | 241 | NV_ERROR(dev, "I2C%d: type %d index %x/%x unknown\n", |
418 | i, port->type, port->drive, port->sense); | 242 | i, port->type, port->drive, port->sense); |
419 | kfree(port); | 243 | kfree(port); |
@@ -429,7 +253,26 @@ nouveau_i2c_init(struct drm_device *dev) | |||
429 | port->dcb = ROM32(entry[0]); | 253 | port->dcb = ROM32(entry[0]); |
430 | i2c_set_adapdata(&port->adapter, i2c); | 254 | i2c_set_adapdata(&port->adapter, i2c); |
431 | 255 | ||
432 | ret = i2c_add_adapter(&port->adapter); | 256 | if (port->adapter.algo != &nouveau_dp_i2c_algo) { |
257 | port->adapter.algo_data = &port->bit; | ||
258 | port->bit.udelay = 10; | ||
259 | port->bit.timeout = usecs_to_jiffies(2200); | ||
260 | port->bit.data = port; | ||
261 | port->bit.setsda = i2c_drive_sda; | ||
262 | port->bit.setscl = i2c_drive_scl; | ||
263 | port->bit.getsda = i2c_sense_sda; | ||
264 | port->bit.getscl = i2c_sense_scl; | ||
265 | |||
266 | i2c_drive_scl(port, 0); | ||
267 | i2c_drive_sda(port, 1); | ||
268 | i2c_drive_scl(port, 1); | ||
269 | |||
270 | ret = i2c_bit_add_bus(&port->adapter); | ||
271 | } else { | ||
272 | port->adapter.algo = &nouveau_dp_i2c_algo; | ||
273 | ret = i2c_add_adapter(&port->adapter); | ||
274 | } | ||
275 | |||
433 | if (ret) { | 276 | if (ret) { |
434 | NV_ERROR(dev, "I2C%d: failed register: %d\n", i, ret); | 277 | NV_ERROR(dev, "I2C%d: failed register: %d\n", i, ret); |
435 | kfree(port); | 278 | kfree(port); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.h b/drivers/gpu/drm/nouveau/nouveau_i2c.h index 4d2e4e9031be..1d083893a4d7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_i2c.h +++ b/drivers/gpu/drm/nouveau/nouveau_i2c.h | |||
@@ -34,6 +34,7 @@ | |||
34 | struct nouveau_i2c_chan { | 34 | struct nouveau_i2c_chan { |
35 | struct i2c_adapter adapter; | 35 | struct i2c_adapter adapter; |
36 | struct drm_device *dev; | 36 | struct drm_device *dev; |
37 | struct i2c_algo_bit_data bit; | ||
37 | struct list_head head; | 38 | struct list_head head; |
38 | u8 index; | 39 | u8 index; |
39 | u8 type; | 40 | u8 type; |
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index e70dd382a009..046fb1bd8619 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -1431,7 +1431,10 @@ void devm_regulator_put(struct regulator *regulator) | |||
1431 | 1431 | ||
1432 | rc = devres_destroy(regulator->dev, devm_regulator_release, | 1432 | rc = devres_destroy(regulator->dev, devm_regulator_release, |
1433 | devm_regulator_match, regulator); | 1433 | devm_regulator_match, regulator); |
1434 | WARN_ON(rc); | 1434 | if (rc == 0) |
1435 | regulator_put(regulator); | ||
1436 | else | ||
1437 | WARN_ON(rc); | ||
1435 | } | 1438 | } |
1436 | EXPORT_SYMBOL_GPL(devm_regulator_put); | 1439 | EXPORT_SYMBOL_GPL(devm_regulator_put); |
1437 | 1440 | ||
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 96579296f04d..17a58c56eebf 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c | |||
@@ -684,7 +684,7 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev, | |||
684 | } | 684 | } |
685 | 685 | ||
686 | new_val++; | 686 | new_val++; |
687 | } while (desc->min + desc->step + new_val <= desc->max); | 687 | } while (desc->min + desc->step * new_val <= desc->max); |
688 | 688 | ||
689 | new_idx = tmp_idx; | 689 | new_idx = tmp_idx; |
690 | new_val = tmp_val; | 690 | new_val = tmp_val; |
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index cb4529c40d74..b7f5173ff9e9 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c | |||
@@ -365,7 +365,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, | |||
365 | struct fb_info *fb_info; | 365 | struct fb_info *fb_info; |
366 | int fb_size; | 366 | int fb_size; |
367 | int val; | 367 | int val; |
368 | int ret; | 368 | int ret = 0; |
369 | 369 | ||
370 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 370 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
371 | if (info == NULL) { | 371 | if (info == NULL) { |
@@ -458,26 +458,31 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, | |||
458 | xenfb_init_shared_page(info, fb_info); | 458 | xenfb_init_shared_page(info, fb_info); |
459 | 459 | ||
460 | ret = xenfb_connect_backend(dev, info); | 460 | ret = xenfb_connect_backend(dev, info); |
461 | if (ret < 0) | 461 | if (ret < 0) { |
462 | goto error; | 462 | xenbus_dev_fatal(dev, ret, "xenfb_connect_backend"); |
463 | goto error_fb; | ||
464 | } | ||
463 | 465 | ||
464 | ret = register_framebuffer(fb_info); | 466 | ret = register_framebuffer(fb_info); |
465 | if (ret) { | 467 | if (ret) { |
466 | fb_deferred_io_cleanup(fb_info); | ||
467 | fb_dealloc_cmap(&fb_info->cmap); | ||
468 | framebuffer_release(fb_info); | ||
469 | xenbus_dev_fatal(dev, ret, "register_framebuffer"); | 468 | xenbus_dev_fatal(dev, ret, "register_framebuffer"); |
470 | goto error; | 469 | goto error_fb; |
471 | } | 470 | } |
472 | info->fb_info = fb_info; | 471 | info->fb_info = fb_info; |
473 | 472 | ||
474 | xenfb_make_preferred_console(); | 473 | xenfb_make_preferred_console(); |
475 | return 0; | 474 | return 0; |
476 | 475 | ||
477 | error_nomem: | 476 | error_fb: |
478 | ret = -ENOMEM; | 477 | fb_deferred_io_cleanup(fb_info); |
479 | xenbus_dev_fatal(dev, ret, "allocating device memory"); | 478 | fb_dealloc_cmap(&fb_info->cmap); |
480 | error: | 479 | framebuffer_release(fb_info); |
480 | error_nomem: | ||
481 | if (!ret) { | ||
482 | ret = -ENOMEM; | ||
483 | xenbus_dev_fatal(dev, ret, "allocating device memory"); | ||
484 | } | ||
485 | error: | ||
481 | xenfb_remove(dev); | 486 | xenfb_remove(dev); |
482 | return ret; | 487 | return ret; |
483 | } | 488 | } |
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index 94243136f6bf..ea20c51d24c7 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig | |||
@@ -183,15 +183,17 @@ config XEN_ACPI_PROCESSOR | |||
183 | depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ | 183 | depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ |
184 | default m | 184 | default m |
185 | help | 185 | help |
186 | This ACPI processor uploads Power Management information to the Xen hypervisor. | 186 | This ACPI processor uploads Power Management information to the Xen |
187 | 187 | hypervisor. | |
188 | To do that the driver parses the Power Management data and uploads said | 188 | |
189 | information to the Xen hypervisor. Then the Xen hypervisor can select the | 189 | To do that the driver parses the Power Management data and uploads |
190 | proper Cx and Pxx states. It also registers itslef as the SMM so that | 190 | said information to the Xen hypervisor. Then the Xen hypervisor can |
191 | other drivers (such as ACPI cpufreq scaling driver) will not load. | 191 | select the proper Cx and Pxx states. It also registers itslef as the |
192 | 192 | SMM so that other drivers (such as ACPI cpufreq scaling driver) will | |
193 | To compile this driver as a module, choose M here: the | 193 | not load. |
194 | module will be called xen_acpi_processor If you do not know what to choose, | 194 | |
195 | select M here. If the CPUFREQ drivers are built in, select Y here. | 195 | To compile this driver as a module, choose M here: the module will be |
196 | called xen_acpi_processor If you do not know what to choose, select | ||
197 | M here. If the CPUFREQ drivers are built in, select Y here. | ||
196 | 198 | ||
197 | endmenu | 199 | endmenu |
diff --git a/mm/percpu.c b/mm/percpu.c index f47af9123af7..f921fdfb5430 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -1132,20 +1132,20 @@ static void pcpu_dump_alloc_info(const char *lvl, | |||
1132 | for (alloc_end += gi->nr_units / upa; | 1132 | for (alloc_end += gi->nr_units / upa; |
1133 | alloc < alloc_end; alloc++) { | 1133 | alloc < alloc_end; alloc++) { |
1134 | if (!(alloc % apl)) { | 1134 | if (!(alloc % apl)) { |
1135 | printk("\n"); | 1135 | printk(KERN_CONT "\n"); |
1136 | printk("%spcpu-alloc: ", lvl); | 1136 | printk("%spcpu-alloc: ", lvl); |
1137 | } | 1137 | } |
1138 | printk("[%0*d] ", group_width, group); | 1138 | printk(KERN_CONT "[%0*d] ", group_width, group); |
1139 | 1139 | ||
1140 | for (unit_end += upa; unit < unit_end; unit++) | 1140 | for (unit_end += upa; unit < unit_end; unit++) |
1141 | if (gi->cpu_map[unit] != NR_CPUS) | 1141 | if (gi->cpu_map[unit] != NR_CPUS) |
1142 | printk("%0*d ", cpu_width, | 1142 | printk(KERN_CONT "%0*d ", cpu_width, |
1143 | gi->cpu_map[unit]); | 1143 | gi->cpu_map[unit]); |
1144 | else | 1144 | else |
1145 | printk("%s ", empty_str); | 1145 | printk(KERN_CONT "%s ", empty_str); |
1146 | } | 1146 | } |
1147 | } | 1147 | } |
1148 | printk("\n"); | 1148 | printk(KERN_CONT "\n"); |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | /** | 1151 | /** |