Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
smp: Allow on_each_cpu() to be called while early_boot_irqs_disabled status to init/main.c
lockdep: Move early boot local IRQ enable/disable status to init/main.c

+22 -40
+1 -1
arch/x86/xen/enlighten.c
··· 1194 1194 per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; 1195 1195 1196 1196 local_irq_disable(); 1197 - early_boot_irqs_off(); 1197 + early_boot_irqs_disabled = true; 1198 1198 1199 1199 memblock_init(); 1200 1200
+2
include/linux/kernel.h
··· 243 243 extern unsigned long get_taint(void); 244 244 extern int root_mountflags; 245 245 246 + extern bool early_boot_irqs_disabled; 247 + 246 248 /* Values used for system_state */ 247 249 extern enum system_states { 248 250 SYSTEM_BOOTING,
-8
include/linux/lockdep.h
··· 436 436 #endif /* CONFIG_LOCKDEP */ 437 437 438 438 #ifdef CONFIG_TRACE_IRQFLAGS 439 - extern void early_boot_irqs_off(void); 440 - extern void early_boot_irqs_on(void); 441 439 extern void print_irqtrace_events(struct task_struct *curr); 442 440 #else 443 - static inline void early_boot_irqs_off(void) 444 - { 445 - } 446 - static inline void early_boot_irqs_on(void) 447 - { 448 - } 449 441 static inline void print_irqtrace_events(struct task_struct *curr) 450 442 { 451 443 }
+11 -2
init/main.c
··· 96 96 extern void tc_init(void); 97 97 #endif 98 98 99 + /* 100 + * Debug helper: via this flag we know that we are in 'early bootup code' 101 + * where only the boot processor is running with IRQ disabled. This means 102 + * two things - IRQ must not be enabled before the flag is cleared and some 103 + * operations which are not allowed with IRQ disabled are allowed while the 104 + * flag is set. 105 + */ 106 + bool early_boot_irqs_disabled __read_mostly; 107 + 99 108 enum system_states system_state __read_mostly; 100 109 EXPORT_SYMBOL(system_state); 101 110 ··· 563 554 cgroup_init_early(); 564 555 565 556 local_irq_disable(); 566 - early_boot_irqs_off(); 557 + early_boot_irqs_disabled = true; 567 558 568 559 /* 569 560 * Interrupts are still disabled. Do necessary setups, then ··· 630 621 if (!irqs_disabled()) 631 622 printk(KERN_CRIT "start_kernel(): bug: interrupts were " 632 623 "enabled early\n"); 633 - early_boot_irqs_on(); 624 + early_boot_irqs_disabled = false; 634 625 local_irq_enable(); 635 626 636 627 /* Interrupts are enabled now so all GFP allocations are safe. */
+1 -17
kernel/lockdep.c
··· 2292 2292 } 2293 2293 2294 2294 /* 2295 - * Debugging helper: via this flag we know that we are in 2296 - * 'early bootup code', and will warn about any invalid irqs-on event: 2297 - */ 2298 - static int early_boot_irqs_enabled; 2299 - 2300 - void early_boot_irqs_off(void) 2301 - { 2302 - early_boot_irqs_enabled = 0; 2303 - } 2304 - 2305 - void early_boot_irqs_on(void) 2306 - { 2307 - early_boot_irqs_enabled = 1; 2308 - } 2309 - 2310 - /* 2311 2295 * Hardirqs will be enabled: 2312 2296 */ 2313 2297 void trace_hardirqs_on_caller(unsigned long ip) ··· 2303 2319 if (unlikely(!debug_locks || current->lockdep_recursion)) 2304 2320 return; 2305 2321 2306 - if (DEBUG_LOCKS_WARN_ON(unlikely(!early_boot_irqs_enabled))) 2322 + if (DEBUG_LOCKS_WARN_ON(unlikely(early_boot_irqs_disabled))) 2307 2323 return; 2308 2324 2309 2325 if (unlikely(curr->hardirqs_enabled)) {
+7 -4
kernel/smp.c
··· 459 459 * can't happen. 460 460 */ 461 461 WARN_ON_ONCE(cpu_online(this_cpu) && irqs_disabled() 462 - && !oops_in_progress); 462 + && !oops_in_progress && !early_boot_irqs_disabled); 463 463 464 464 /* So, what's a CPU they want? Ignoring this one. */ 465 465 cpu = cpumask_first_and(mask, cpu_online_mask); ··· 572 572 #endif /* USE_GENERIC_SMP_HELPERS */ 573 573 574 574 /* 575 - * Call a function on all processors 575 + * Call a function on all processors. May be used during early boot while 576 + * early_boot_irqs_disabled is set. Use local_irq_save/restore() instead 577 + * of local_irq_disable/enable(). 576 578 */ 577 579 int on_each_cpu(void (*func) (void *info), void *info, int wait) 578 580 { 581 + unsigned long flags; 579 582 int ret = 0; 580 583 581 584 preempt_disable(); 582 585 ret = smp_call_function(func, info, wait); 583 - local_irq_disable(); 586 + local_irq_save(flags); 584 587 func(info); 585 - local_irq_enable(); 588 + local_irq_restore(flags); 586 589 preempt_enable(); 587 590 return ret; 588 591 }
-8
kernel/trace/trace_irqsoff.c
··· 453 453 * Stubs: 454 454 */ 455 455 456 - void early_boot_irqs_off(void) 457 - { 458 - } 459 - 460 - void early_boot_irqs_on(void) 461 - { 462 - } 463 - 464 456 void trace_softirqs_on(unsigned long ip) 465 457 { 466 458 }