diff options
-rw-r--r-- | MAINTAINERS | 7 | ||||
-rw-r--r-- | arch/x86/include/asm/memblock.h | 2 | ||||
-rw-r--r-- | arch/x86/mm/memblock.c | 4 | ||||
-rw-r--r-- | arch/x86/platform/efi/efi.c | 29 | ||||
-rw-r--r-- | fs/timerfd.c | 5 | ||||
-rw-r--r-- | include/linux/clocksource.h | 1 | ||||
-rw-r--r-- | include/linux/smp.h | 5 | ||||
-rw-r--r-- | init/main.c | 1 | ||||
-rw-r--r-- | kernel/smp.c | 5 | ||||
-rw-r--r-- | kernel/time/clocksource.c | 24 | ||||
-rw-r--r-- | kernel/trace/trace_printk.c | 5 | ||||
-rw-r--r-- | tools/perf/Makefile | 2 |
12 files changed, 61 insertions, 29 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 502f2dd761eb..b12b8c13f53a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -7007,6 +7007,13 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86. | |||
7007 | S: Maintained | 7007 | S: Maintained |
7008 | F: drivers/platform/x86 | 7008 | F: drivers/platform/x86 |
7009 | 7009 | ||
7010 | X86 MCE INFRASTRUCTURE | ||
7011 | M: Tony Luck <tony.luck@intel.com> | ||
7012 | M: Borislav Petkov <bp@amd64.org> | ||
7013 | L: linux-edac@vger.kernel.org | ||
7014 | S: Maintained | ||
7015 | F: arch/x86/kernel/cpu/mcheck/* | ||
7016 | |||
7010 | XEN HYPERVISOR INTERFACE | 7017 | XEN HYPERVISOR INTERFACE |
7011 | M: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 7018 | M: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> |
7012 | M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 7019 | M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
diff --git a/arch/x86/include/asm/memblock.h b/arch/x86/include/asm/memblock.h index 19ae14ba6978..0cd3800f33b9 100644 --- a/arch/x86/include/asm/memblock.h +++ b/arch/x86/include/asm/memblock.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #define ARCH_DISCARD_MEMBLOCK | 4 | #define ARCH_DISCARD_MEMBLOCK |
5 | 5 | ||
6 | u64 memblock_x86_find_in_range_size(u64 start, u64 *sizep, u64 align); | 6 | u64 memblock_x86_find_in_range_size(u64 start, u64 *sizep, u64 align); |
7 | void memblock_x86_to_bootmem(u64 start, u64 end); | ||
8 | 7 | ||
9 | void memblock_x86_reserve_range(u64 start, u64 end, char *name); | 8 | void memblock_x86_reserve_range(u64 start, u64 end, char *name); |
10 | void memblock_x86_free_range(u64 start, u64 end); | 9 | void memblock_x86_free_range(u64 start, u64 end); |
@@ -19,5 +18,6 @@ u64 memblock_x86_hole_size(u64 start, u64 end); | |||
19 | u64 memblock_x86_find_in_range_node(int nid, u64 start, u64 end, u64 size, u64 align); | 18 | u64 memblock_x86_find_in_range_node(int nid, u64 start, u64 end, u64 size, u64 align); |
20 | u64 memblock_x86_free_memory_in_range(u64 addr, u64 limit); | 19 | u64 memblock_x86_free_memory_in_range(u64 addr, u64 limit); |
21 | u64 memblock_x86_memory_in_range(u64 addr, u64 limit); | 20 | u64 memblock_x86_memory_in_range(u64 addr, u64 limit); |
21 | bool memblock_x86_check_reserved_size(u64 *addrp, u64 *sizep, u64 align); | ||
22 | 22 | ||
23 | #endif | 23 | #endif |
diff --git a/arch/x86/mm/memblock.c b/arch/x86/mm/memblock.c index aa1169392b83..992da5ec5a64 100644 --- a/arch/x86/mm/memblock.c +++ b/arch/x86/mm/memblock.c | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <linux/range.h> | 8 | #include <linux/range.h> |
9 | 9 | ||
10 | /* Check for already reserved areas */ | 10 | /* Check for already reserved areas */ |
11 | static bool __init check_with_memblock_reserved_size(u64 *addrp, u64 *sizep, u64 align) | 11 | bool __init memblock_x86_check_reserved_size(u64 *addrp, u64 *sizep, u64 align) |
12 | { | 12 | { |
13 | struct memblock_region *r; | 13 | struct memblock_region *r; |
14 | u64 addr = *addrp, last; | 14 | u64 addr = *addrp, last; |
@@ -59,7 +59,7 @@ u64 __init memblock_x86_find_in_range_size(u64 start, u64 *sizep, u64 align) | |||
59 | if (addr >= ei_last) | 59 | if (addr >= ei_last) |
60 | continue; | 60 | continue; |
61 | *sizep = ei_last - addr; | 61 | *sizep = ei_last - addr; |
62 | while (check_with_memblock_reserved_size(&addr, sizep, align)) | 62 | while (memblock_x86_check_reserved_size(&addr, sizep, align)) |
63 | ; | 63 | ; |
64 | 64 | ||
65 | if (*sizep) | 65 | if (*sizep) |
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 0d3a4fa34560..474356b98ede 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
@@ -310,14 +310,31 @@ void __init efi_reserve_boot_services(void) | |||
310 | 310 | ||
311 | for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { | 311 | for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { |
312 | efi_memory_desc_t *md = p; | 312 | efi_memory_desc_t *md = p; |
313 | unsigned long long start = md->phys_addr; | 313 | u64 start = md->phys_addr; |
314 | unsigned long long size = md->num_pages << EFI_PAGE_SHIFT; | 314 | u64 size = md->num_pages << EFI_PAGE_SHIFT; |
315 | 315 | ||
316 | if (md->type != EFI_BOOT_SERVICES_CODE && | 316 | if (md->type != EFI_BOOT_SERVICES_CODE && |
317 | md->type != EFI_BOOT_SERVICES_DATA) | 317 | md->type != EFI_BOOT_SERVICES_DATA) |
318 | continue; | 318 | continue; |
319 | 319 | /* Only reserve where possible: | |
320 | memblock_x86_reserve_range(start, start + size, "EFI Boot"); | 320 | * - Not within any already allocated areas |
321 | * - Not over any memory area (really needed, if above?) | ||
322 | * - Not within any part of the kernel | ||
323 | * - Not the bios reserved area | ||
324 | */ | ||
325 | if ((start+size >= virt_to_phys(_text) | ||
326 | && start <= virt_to_phys(_end)) || | ||
327 | !e820_all_mapped(start, start+size, E820_RAM) || | ||
328 | memblock_x86_check_reserved_size(&start, &size, | ||
329 | 1<<EFI_PAGE_SHIFT)) { | ||
330 | /* Could not reserve, skip it */ | ||
331 | md->num_pages = 0; | ||
332 | memblock_dbg(PFX "Could not reserve boot range " | ||
333 | "[0x%010llx-0x%010llx]\n", | ||
334 | start, start+size-1); | ||
335 | } else | ||
336 | memblock_x86_reserve_range(start, start+size, | ||
337 | "EFI Boot"); | ||
321 | } | 338 | } |
322 | } | 339 | } |
323 | 340 | ||
@@ -334,6 +351,10 @@ static void __init efi_free_boot_services(void) | |||
334 | md->type != EFI_BOOT_SERVICES_DATA) | 351 | md->type != EFI_BOOT_SERVICES_DATA) |
335 | continue; | 352 | continue; |
336 | 353 | ||
354 | /* Could not reserve boot area */ | ||
355 | if (!size) | ||
356 | continue; | ||
357 | |||
337 | free_bootmem_late(start, size); | 358 | free_bootmem_late(start, size); |
338 | } | 359 | } |
339 | } | 360 | } |
diff --git a/fs/timerfd.c b/fs/timerfd.c index f67acbdda5e8..dffeb3795af1 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c | |||
@@ -61,7 +61,9 @@ static enum hrtimer_restart timerfd_tmrproc(struct hrtimer *htmr) | |||
61 | 61 | ||
62 | /* | 62 | /* |
63 | * Called when the clock was set to cancel the timers in the cancel | 63 | * Called when the clock was set to cancel the timers in the cancel |
64 | * list. | 64 | * list. This will wake up processes waiting on these timers. The |
65 | * wake-up requires ctx->ticks to be non zero, therefore we increment | ||
66 | * it before calling wake_up_locked(). | ||
65 | */ | 67 | */ |
66 | void timerfd_clock_was_set(void) | 68 | void timerfd_clock_was_set(void) |
67 | { | 69 | { |
@@ -76,6 +78,7 @@ void timerfd_clock_was_set(void) | |||
76 | spin_lock_irqsave(&ctx->wqh.lock, flags); | 78 | spin_lock_irqsave(&ctx->wqh.lock, flags); |
77 | if (ctx->moffs.tv64 != moffs.tv64) { | 79 | if (ctx->moffs.tv64 != moffs.tv64) { |
78 | ctx->moffs.tv64 = KTIME_MAX; | 80 | ctx->moffs.tv64 = KTIME_MAX; |
81 | ctx->ticks++; | ||
79 | wake_up_locked(&ctx->wqh); | 82 | wake_up_locked(&ctx->wqh); |
80 | } | 83 | } |
81 | spin_unlock_irqrestore(&ctx->wqh.lock, flags); | 84 | spin_unlock_irqrestore(&ctx->wqh.lock, flags); |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index d4646b48dc4a..18a1baf31f2d 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -188,6 +188,7 @@ struct clocksource { | |||
188 | #ifdef CONFIG_CLOCKSOURCE_WATCHDOG | 188 | #ifdef CONFIG_CLOCKSOURCE_WATCHDOG |
189 | /* Watchdog related data, used by the framework */ | 189 | /* Watchdog related data, used by the framework */ |
190 | struct list_head wd_list; | 190 | struct list_head wd_list; |
191 | cycle_t cs_last; | ||
191 | cycle_t wd_last; | 192 | cycle_t wd_last; |
192 | #endif | 193 | #endif |
193 | } ____cacheline_aligned; | 194 | } ____cacheline_aligned; |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 7ad824d510a2..8cc38d3bab0c 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -85,12 +85,15 @@ int smp_call_function_any(const struct cpumask *mask, | |||
85 | * Generic and arch helpers | 85 | * Generic and arch helpers |
86 | */ | 86 | */ |
87 | #ifdef CONFIG_USE_GENERIC_SMP_HELPERS | 87 | #ifdef CONFIG_USE_GENERIC_SMP_HELPERS |
88 | void __init call_function_init(void); | ||
88 | void generic_smp_call_function_single_interrupt(void); | 89 | void generic_smp_call_function_single_interrupt(void); |
89 | void generic_smp_call_function_interrupt(void); | 90 | void generic_smp_call_function_interrupt(void); |
90 | void ipi_call_lock(void); | 91 | void ipi_call_lock(void); |
91 | void ipi_call_unlock(void); | 92 | void ipi_call_unlock(void); |
92 | void ipi_call_lock_irq(void); | 93 | void ipi_call_lock_irq(void); |
93 | void ipi_call_unlock_irq(void); | 94 | void ipi_call_unlock_irq(void); |
95 | #else | ||
96 | static inline void call_function_init(void) { } | ||
94 | #endif | 97 | #endif |
95 | 98 | ||
96 | /* | 99 | /* |
@@ -134,7 +137,7 @@ static inline void smp_send_reschedule(int cpu) { } | |||
134 | #define smp_prepare_boot_cpu() do {} while (0) | 137 | #define smp_prepare_boot_cpu() do {} while (0) |
135 | #define smp_call_function_many(mask, func, info, wait) \ | 138 | #define smp_call_function_many(mask, func, info, wait) \ |
136 | (up_smp_call_function(func, info)) | 139 | (up_smp_call_function(func, info)) |
137 | static inline void init_call_single_data(void) { } | 140 | static inline void call_function_init(void) { } |
138 | 141 | ||
139 | static inline int | 142 | static inline int |
140 | smp_call_function_any(const struct cpumask *mask, smp_call_func_t func, | 143 | smp_call_function_any(const struct cpumask *mask, smp_call_func_t func, |
diff --git a/init/main.c b/init/main.c index cafba67c13bf..d7211faed2ad 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -542,6 +542,7 @@ asmlinkage void __init start_kernel(void) | |||
542 | timekeeping_init(); | 542 | timekeeping_init(); |
543 | time_init(); | 543 | time_init(); |
544 | profile_init(); | 544 | profile_init(); |
545 | call_function_init(); | ||
545 | if (!irqs_disabled()) | 546 | if (!irqs_disabled()) |
546 | printk(KERN_CRIT "start_kernel(): bug: interrupts were " | 547 | printk(KERN_CRIT "start_kernel(): bug: interrupts were " |
547 | "enabled early\n"); | 548 | "enabled early\n"); |
diff --git a/kernel/smp.c b/kernel/smp.c index 73a195193558..fb67dfa8394e 100644 --- a/kernel/smp.c +++ b/kernel/smp.c | |||
@@ -74,7 +74,7 @@ static struct notifier_block __cpuinitdata hotplug_cfd_notifier = { | |||
74 | .notifier_call = hotplug_cfd, | 74 | .notifier_call = hotplug_cfd, |
75 | }; | 75 | }; |
76 | 76 | ||
77 | static int __cpuinit init_call_single_data(void) | 77 | void __init call_function_init(void) |
78 | { | 78 | { |
79 | void *cpu = (void *)(long)smp_processor_id(); | 79 | void *cpu = (void *)(long)smp_processor_id(); |
80 | int i; | 80 | int i; |
@@ -88,10 +88,7 @@ static int __cpuinit init_call_single_data(void) | |||
88 | 88 | ||
89 | hotplug_cfd(&hotplug_cfd_notifier, CPU_UP_PREPARE, cpu); | 89 | hotplug_cfd(&hotplug_cfd_notifier, CPU_UP_PREPARE, cpu); |
90 | register_cpu_notifier(&hotplug_cfd_notifier); | 90 | register_cpu_notifier(&hotplug_cfd_notifier); |
91 | |||
92 | return 0; | ||
93 | } | 91 | } |
94 | early_initcall(init_call_single_data); | ||
95 | 92 | ||
96 | /* | 93 | /* |
97 | * csd_lock/csd_unlock used to serialize access to per-cpu csd resources | 94 | * csd_lock/csd_unlock used to serialize access to per-cpu csd resources |
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 1c95fd677328..e0980f0d9a0a 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
@@ -185,7 +185,6 @@ static struct clocksource *watchdog; | |||
185 | static struct timer_list watchdog_timer; | 185 | static struct timer_list watchdog_timer; |
186 | static DECLARE_WORK(watchdog_work, clocksource_watchdog_work); | 186 | static DECLARE_WORK(watchdog_work, clocksource_watchdog_work); |
187 | static DEFINE_SPINLOCK(watchdog_lock); | 187 | static DEFINE_SPINLOCK(watchdog_lock); |
188 | static cycle_t watchdog_last; | ||
189 | static int watchdog_running; | 188 | static int watchdog_running; |
190 | 189 | ||
191 | static int clocksource_watchdog_kthread(void *data); | 190 | static int clocksource_watchdog_kthread(void *data); |
@@ -254,11 +253,6 @@ static void clocksource_watchdog(unsigned long data) | |||
254 | if (!watchdog_running) | 253 | if (!watchdog_running) |
255 | goto out; | 254 | goto out; |
256 | 255 | ||
257 | wdnow = watchdog->read(watchdog); | ||
258 | wd_nsec = clocksource_cyc2ns((wdnow - watchdog_last) & watchdog->mask, | ||
259 | watchdog->mult, watchdog->shift); | ||
260 | watchdog_last = wdnow; | ||
261 | |||
262 | list_for_each_entry(cs, &watchdog_list, wd_list) { | 256 | list_for_each_entry(cs, &watchdog_list, wd_list) { |
263 | 257 | ||
264 | /* Clocksource already marked unstable? */ | 258 | /* Clocksource already marked unstable? */ |
@@ -268,19 +262,28 @@ static void clocksource_watchdog(unsigned long data) | |||
268 | continue; | 262 | continue; |
269 | } | 263 | } |
270 | 264 | ||
265 | local_irq_disable(); | ||
271 | csnow = cs->read(cs); | 266 | csnow = cs->read(cs); |
267 | wdnow = watchdog->read(watchdog); | ||
268 | local_irq_enable(); | ||
272 | 269 | ||
273 | /* Clocksource initialized ? */ | 270 | /* Clocksource initialized ? */ |
274 | if (!(cs->flags & CLOCK_SOURCE_WATCHDOG)) { | 271 | if (!(cs->flags & CLOCK_SOURCE_WATCHDOG)) { |
275 | cs->flags |= CLOCK_SOURCE_WATCHDOG; | 272 | cs->flags |= CLOCK_SOURCE_WATCHDOG; |
276 | cs->wd_last = csnow; | 273 | cs->wd_last = wdnow; |
274 | cs->cs_last = csnow; | ||
277 | continue; | 275 | continue; |
278 | } | 276 | } |
279 | 277 | ||
280 | /* Check the deviation from the watchdog clocksource. */ | 278 | wd_nsec = clocksource_cyc2ns((wdnow - cs->wd_last) & watchdog->mask, |
281 | cs_nsec = clocksource_cyc2ns((csnow - cs->wd_last) & | 279 | watchdog->mult, watchdog->shift); |
280 | |||
281 | cs_nsec = clocksource_cyc2ns((csnow - cs->cs_last) & | ||
282 | cs->mask, cs->mult, cs->shift); | 282 | cs->mask, cs->mult, cs->shift); |
283 | cs->wd_last = csnow; | 283 | cs->cs_last = csnow; |
284 | cs->wd_last = wdnow; | ||
285 | |||
286 | /* Check the deviation from the watchdog clocksource. */ | ||
284 | if (abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD) { | 287 | if (abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD) { |
285 | clocksource_unstable(cs, cs_nsec - wd_nsec); | 288 | clocksource_unstable(cs, cs_nsec - wd_nsec); |
286 | continue; | 289 | continue; |
@@ -318,7 +321,6 @@ static inline void clocksource_start_watchdog(void) | |||
318 | return; | 321 | return; |
319 | init_timer(&watchdog_timer); | 322 | init_timer(&watchdog_timer); |
320 | watchdog_timer.function = clocksource_watchdog; | 323 | watchdog_timer.function = clocksource_watchdog; |
321 | watchdog_last = watchdog->read(watchdog); | ||
322 | watchdog_timer.expires = jiffies + WATCHDOG_INTERVAL; | 324 | watchdog_timer.expires = jiffies + WATCHDOG_INTERVAL; |
323 | add_timer_on(&watchdog_timer, cpumask_first(cpu_online_mask)); | 325 | add_timer_on(&watchdog_timer, cpumask_first(cpu_online_mask)); |
324 | watchdog_running = 1; | 326 | watchdog_running = 1; |
diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c index dff763b7baf1..1f06468a10d7 100644 --- a/kernel/trace/trace_printk.c +++ b/kernel/trace/trace_printk.c | |||
@@ -240,13 +240,10 @@ static const char **find_next(void *v, loff_t *pos) | |||
240 | const char **fmt = v; | 240 | const char **fmt = v; |
241 | int start_index; | 241 | int start_index; |
242 | 242 | ||
243 | if (!fmt) | ||
244 | fmt = __start___trace_bprintk_fmt + *pos; | ||
245 | |||
246 | start_index = __stop___trace_bprintk_fmt - __start___trace_bprintk_fmt; | 243 | start_index = __stop___trace_bprintk_fmt - __start___trace_bprintk_fmt; |
247 | 244 | ||
248 | if (*pos < start_index) | 245 | if (*pos < start_index) |
249 | return fmt; | 246 | return __start___trace_bprintk_fmt + *pos; |
250 | 247 | ||
251 | return find_next_mod_format(start_index, v, fmt, pos); | 248 | return find_next_mod_format(start_index, v, fmt, pos); |
252 | } | 249 | } |
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 032ba6398a5c..940257b5774e 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -633,7 +633,7 @@ prefix_SQ = $(subst ','\'',$(prefix)) | |||
633 | 633 | ||
634 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) | 634 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) |
635 | 635 | ||
636 | LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive $(EXTLIBS) | 636 | LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group |
637 | 637 | ||
638 | ALL_CFLAGS += $(BASIC_CFLAGS) | 638 | ALL_CFLAGS += $(BASIC_CFLAGS) |
639 | ALL_CFLAGS += $(ARCH_CFLAGS) | 639 | ALL_CFLAGS += $(ARCH_CFLAGS) |