5 Automatically created from "patches.kernel.org/patch-2.6.18" by xen-port-patches.py
7 Acked-by: jbeulich@novell.com
9 --- sle11-2009-05-14.orig/arch/x86/Kconfig 2009-02-05 10:20:53.000000000 +0100
10 +++ sle11-2009-05-14/arch/x86/Kconfig 2009-04-20 11:36:10.000000000 +0200
11 @@ -44,7 +44,6 @@ config GENERIC_LOCKBREAK
17 config GENERIC_CMOS_UPDATE
19 --- sle11-2009-05-14.orig/arch/x86/kernel/Makefile 2008-12-01 11:14:33.000000000 +0100
20 +++ sle11-2009-05-14/arch/x86/kernel/Makefile 2009-04-20 11:36:10.000000000 +0200
21 @@ -124,5 +124,5 @@ ifeq ($(CONFIG_X86_64),y)
22 pci-dma_64-$(CONFIG_XEN) += pci-dma_32.o
25 -disabled-obj-$(CONFIG_XEN) := i8259_$(BITS).o reboot.o smpboot_$(BITS).o
26 +disabled-obj-$(CONFIG_XEN) := i8253.o i8259_$(BITS).o reboot.o smpboot_$(BITS).o tsc_$(BITS).o
27 %/head_$(BITS).o %/head_$(BITS).s: $(if $(CONFIG_XEN),EXTRA_AFLAGS,dummy) :=
28 --- sle11-2009-05-14.orig/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:01:13.000000000 +0200
29 +++ sle11-2009-05-14/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:01:46.000000000 +0200
30 @@ -388,8 +388,10 @@ ENTRY(sysenter_entry_pv)
32 movl $__USER_CS,4(%esp)
34 + CFI_ADJUST_CFA_OFFSET -4
35 /* +5*4 is SS:ESP,EFLAGS,CS:EIP. +8 is esp0 setting. */
36 pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp)
37 + CFI_ADJUST_CFA_OFFSET 4
39 * Load the potential sixth argument from user stack.
40 * Careful about security.
41 --- sle11-2009-05-14.orig/arch/x86/kernel/setup64-xen.c 2009-05-14 11:01:13.000000000 +0200
42 +++ sle11-2009-05-14/arch/x86/kernel/setup64-xen.c 2009-04-20 11:36:10.000000000 +0200
43 @@ -363,5 +363,7 @@ void __cpuinit cpu_init (void)
47 - raw_local_save_flags(kernel_eflags);
48 + asm ("pushfq; popq %0" : "=rm" (kernel_eflags));
49 + if (raw_irqs_disabled())
50 + kernel_eflags &= ~X86_EFLAGS_IF;
52 --- sle11-2009-05-14.orig/arch/x86/kernel/time_32-xen.c 2009-03-18 12:51:05.000000000 +0100
53 +++ sle11-2009-05-14/arch/x86/kernel/time_32-xen.c 2009-04-20 11:36:10.000000000 +0200
56 #if defined (__i386__)
57 #include <asm/i8259.h>
58 +#include <asm/i8253.h>
59 +DEFINE_SPINLOCK(i8253_lock);
60 +EXPORT_SYMBOL(i8253_lock);
65 int pit_latch_buggy; /* extern */
67 #if defined(__x86_64__)
68 @@ -97,10 +102,6 @@ extern unsigned long wall_jiffies;
69 DEFINE_SPINLOCK(rtc_lock);
70 EXPORT_SYMBOL(rtc_lock);
72 -extern struct init_timer_opts timer_tsc_init;
73 -extern struct timer_opts timer_tsc;
74 -#define timer_none timer_tsc
76 /* These are peridically updated in shared_info, and then copied here. */
77 struct shadow_time_info {
78 u64 tsc_timestamp; /* TSC at last update of time vals. */
79 @@ -229,14 +230,6 @@ static inline u64 scale_delta(u64 delta,
83 -#if 0 /* defined (__i386__) */
84 -int read_current_timer(unsigned long *timer_val)
91 void init_cpu_khz(void)
93 u64 __cpu_khz = 1000000ULL << 32;
94 @@ -256,6 +249,7 @@ static u64 get_nsec_offset(struct shadow
95 return scale_delta(delta, shadow->tsc_to_nsec_mul, shadow->tsc_shift);
99 static unsigned long get_usec_offset(struct shadow_time_info *shadow)
102 @@ -263,6 +257,7 @@ static unsigned long get_usec_offset(str
103 delta = now - shadow->tsc_timestamp;
104 return scale_delta(delta, shadow->tsc_to_usec_mul, shadow->tsc_shift);
108 static void __update_wallclock(time_t sec, long nsec)
110 @@ -377,6 +372,8 @@ void rtc_cmos_write(unsigned char val, u
112 EXPORT_SYMBOL(rtc_cmos_write);
114 +#ifdef CONFIG_X86_64
117 * This version of gettimeofday has microsecond resolution
118 * and better than microsecond precision on fast x86 machines with TSC.
119 @@ -512,6 +509,8 @@ int do_settimeofday(struct timespec *tv)
121 EXPORT_SYMBOL(do_settimeofday);
125 static void sync_xen_wallclock(unsigned long dummy);
126 static DEFINE_TIMER(sync_xen_wallclock_timer, sync_xen_wallclock, 0, 0);
127 static void sync_xen_wallclock(unsigned long dummy)
128 @@ -563,11 +562,15 @@ static int set_rtc_mmss(unsigned long no
132 +#ifdef CONFIG_X86_64
133 /* monotonic_clock(): returns # of nanoseconds passed since time_init()
134 * Note: This function is required to return accurate
135 * time even in the absence of multiple timer ticks.
137 unsigned long long monotonic_clock(void)
139 +unsigned long long sched_clock(void)
142 unsigned int cpu = get_cpu();
143 struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
144 @@ -587,9 +590,9 @@ unsigned long long monotonic_clock(void)
148 +#ifdef CONFIG_X86_64
149 EXPORT_SYMBOL(monotonic_clock);
152 unsigned long long sched_clock(void)
154 return monotonic_clock();
155 @@ -759,6 +762,89 @@ irqreturn_t timer_interrupt(int irq, voi
159 +#ifndef CONFIG_X86_64
164 + printk(KERN_INFO "Xen reported: %u.%03u MHz processor.\n",
165 + cpu_khz / 1000, cpu_khz % 1000);
170 +#include <linux/clocksource.h>
172 +void mark_tsc_unstable(void)
174 +#ifndef CONFIG_XEN /* XXX Should tell the hypervisor about this fact. */
178 +EXPORT_SYMBOL_GPL(mark_tsc_unstable);
180 +static cycle_t xen_clocksource_read(void)
183 + static cycle_t last_ret;
184 +#ifndef CONFIG_64BIT
185 + cycle_t last = cmpxchg64(&last_ret, 0, 0);
187 + cycle_t last = last_ret;
188 +#define cmpxchg64 cmpxchg
190 + cycle_t ret = sched_clock();
192 + if (unlikely((s64)(ret - last) < 0)) {
193 + if (last - ret > permitted_clock_jitter
194 + && printk_ratelimit()) {
195 + unsigned int cpu = get_cpu();
196 + struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
198 + printk(KERN_WARNING "clocksource/%u: "
199 + "Time went backwards: "
200 + "ret=%Lx delta=%Ld shadow=%Lx offset=%Lx\n",
201 + cpu, ret, ret - last, shadow->system_timestamp,
202 + get_nsec_offset(shadow));
209 + cycle_t cur = cmpxchg64(&last_ret, last, ret);
211 + if (cur == last || (s64)(ret - cur) < 0)
216 + return sched_clock();
220 +static struct clocksource clocksource_xen = {
223 + .read = xen_clocksource_read,
224 + .mask = CLOCKSOURCE_MASK(64),
225 + .mult = 1 << XEN_SHIFT, /* time directly in nanoseconds */
226 + .shift = XEN_SHIFT,
227 + .is_continuous = 1,
230 +static int __init init_xen_clocksource(void)
232 + clocksource_xen.mult = clocksource_khz2mult(cpu_khz,
233 + clocksource_xen.shift);
235 + return clocksource_register(&clocksource_xen);
238 +module_init(init_xen_clocksource);
242 static void init_missing_ticks_accounting(unsigned int cpu)
244 struct vcpu_register_runstate_memory_area area;
245 @@ -947,11 +1033,11 @@ void __init time_init(void)
249 +#ifdef CONFIG_X86_64
251 printk(KERN_INFO "Xen reported: %u.%03u MHz processor.\n",
252 cpu_khz / 1000, cpu_khz % 1000);
254 -#if defined(__x86_64__)
255 vxtime.mode = VXTIME_TSC;
256 vxtime.quot = (1000000L << 32) / vxtime_hz;
257 vxtime.tsc_quot = (1000L << 32) / cpu_khz;
258 --- sle11-2009-05-14.orig/drivers/oprofile/oprofile_files.c 2009-02-16 16:01:39.000000000 +0100
259 +++ sle11-2009-05-14/drivers/oprofile/oprofile_files.c 2009-04-20 11:36:10.000000000 +0200
260 @@ -217,7 +217,7 @@ static ssize_t adomain_read(struct file
264 -static struct file_operations active_domain_ops = {
265 +static const struct file_operations active_domain_ops = {
266 .read = adomain_read,
267 .write = adomain_write,
269 @@ -310,7 +310,7 @@ static ssize_t pdomain_read(struct file
273 -static struct file_operations passive_domain_ops = {
274 +static const struct file_operations passive_domain_ops = {
275 .read = pdomain_read,
276 .write = pdomain_write,
278 --- sle11-2009-05-14.orig/drivers/xen/blktap/blktap.c 2009-04-20 11:35:40.000000000 +0200
279 +++ sle11-2009-05-14/drivers/xen/blktap/blktap.c 2009-04-20 11:36:10.000000000 +0200
280 @@ -931,7 +931,7 @@ static int req_increase(void)
282 static void mmap_req_del(int mmap)
284 - BUG_ON(!spin_is_locked(&pending_free_lock));
285 + assert_spin_locked(&pending_free_lock);
287 kfree(pending_reqs[mmap]);
288 pending_reqs[mmap] = NULL;
289 --- sle11-2009-05-14.orig/drivers/xen/core/smpboot.c 2009-05-14 11:01:13.000000000 +0200
290 +++ sle11-2009-05-14/drivers/xen/core/smpboot.c 2009-04-28 16:02:07.000000000 +0200
291 @@ -48,10 +48,6 @@ cpumask_t cpu_initialized_map;
292 struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned;
293 EXPORT_SYMBOL(cpu_data);
295 -#ifdef CONFIG_HOTPLUG_CPU
296 -DEFINE_PER_CPU(int, cpu_state) = { 0 };
299 static DEFINE_PER_CPU(int, resched_irq);
300 static DEFINE_PER_CPU(int, callfunc_irq);
301 static char resched_name[NR_CPUS][15];
302 --- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgtable_64.h 2008-12-15 11:13:45.000000000 +0100
303 +++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-04-20 11:36:10.000000000 +0200
304 @@ -394,7 +394,6 @@ static inline int pmd_large(pmd_t pte) {
308 - * Never use these in the common code.
310 #define pgd_page(pgd) ((unsigned long) __va(pgd_val(pgd) & PTE_MASK))
311 #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
312 --- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/processor_32.h 2009-05-14 11:01:13.000000000 +0200
313 +++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/processor_32.h 2009-04-20 11:36:10.000000000 +0200
315 #include <xen/interface/physdev.h>
317 /* flag for disabling the tsc */
318 -extern int tsc_disable;
319 +#define tsc_disable 0
323 --- sle11-2009-05-14.orig/include/asm-x86/thread_info.h 2009-05-14 11:01:13.000000000 +0200
324 +++ sle11-2009-05-14/include/asm-x86/thread_info.h 2009-04-20 11:36:10.000000000 +0200
325 @@ -142,12 +142,16 @@ struct thread_info {
326 (_TIF_SIGPENDING|_TIF_MCE_NOTIFY|_TIF_NOTIFY_RESUME|_TIF_PERFMON_WORK)
328 /* flags to check in __switch_to() */
330 #define _TIF_WORK_CTXSW \
331 (_TIF_IO_BITMAP|_TIF_DEBUGCTLMSR|_TIF_DS_AREA_MSR|_TIF_BTS_TRACE_TS| \
332 _TIF_NOTSC|_TIF_PERFMON_CTXSW)
334 #define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW
335 #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG)
337 +#define _TIF_WORK_CTXSW _TIF_DEBUG
340 #define PREEMPT_ACTIVE 0x10000000