- Update Xen patches to c/s 1011.
[opensuse:kernel-source.git] / patches.xen / xen3-patch-2.6.23
1 From: www.kernel.org
2 Subject: Update to 2.6.23
3 Patch-mainline: 2.6.23
4
5 Automatically created from "patches.kernel.org/patch-2.6.23" by xen-port-patches.py
6
7 Acked-by: jbeulich@novell.com
8
9 --- sle11sp1-2010-03-29.orig/arch/x86/Kbuild    2010-03-29 09:00:35.000000000 +0200
10 +++ sle11sp1-2010-03-29/arch/x86/Kbuild 2009-11-06 10:51:07.000000000 +0100
11 @@ -2,7 +2,7 @@
12  obj-$(CONFIG_KVM) += kvm/
13  
14  # Xen paravirtualization support
15 -obj-$(CONFIG_XEN) += xen/
16 +obj-$(CONFIG_PARAVIRT_XEN) += xen/
17  
18  # lguest paravirtualization support
19  obj-$(CONFIG_LGUEST_GUEST) += lguest/
20 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/acpi/sleep_32-xen.c        2008-04-15 09:29:41.000000000 +0200
21 +++ sle11sp1-2010-03-29/arch/x86/kernel/acpi/sleep_32-xen.c     2009-11-06 10:51:07.000000000 +0100
22 @@ -15,7 +15,7 @@
23  #ifndef CONFIG_ACPI_PV_SLEEP
24  /* address in low memory of the wakeup routine. */
25  unsigned long acpi_wakeup_address = 0;
26 -unsigned long acpi_video_flags;
27 +unsigned long acpi_realmode_flags;
28  extern char wakeup_start, wakeup_end;
29  
30  extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
31 @@ -74,9 +74,11 @@ static int __init acpi_sleep_setup(char 
32  {
33         while ((str != NULL) && (*str != '\0')) {
34                 if (strncmp(str, "s3_bios", 7) == 0)
35 -                       acpi_video_flags = 1;
36 +                       acpi_realmode_flags |= 1;
37                 if (strncmp(str, "s3_mode", 7) == 0)
38 -                       acpi_video_flags |= 2;
39 +                       acpi_realmode_flags |= 2;
40 +               if (strncmp(str, "s3_beep", 7) == 0)
41 +                       acpi_realmode_flags |= 4;
42                 str = strchr(str, ',');
43                 if (str != NULL)
44                         str += strspn(str, ", \t");
45 @@ -86,9 +88,11 @@ static int __init acpi_sleep_setup(char 
46  
47  __setup("acpi_sleep=", acpi_sleep_setup);
48  
49 +/* Ouch, we want to delete this. We already have better version in userspace, in
50 +   s2ram from suspend.sf.net project */
51  static __init int reset_videomode_after_s3(struct dmi_system_id *d)
52  {
53 -       acpi_video_flags |= 2;
54 +       acpi_realmode_flags |= 2;
55         return 0;
56  }
57  
58 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/asm-offsets_32.c   2009-11-06 10:49:47.000000000 +0100
59 +++ sle11sp1-2010-03-29/arch/x86/kernel/asm-offsets_32.c        2009-11-06 10:51:07.000000000 +0100
60 @@ -20,7 +20,9 @@
61  #include <asm/elf.h>
62  #include <asm/suspend.h>
63  
64 +#if defined(CONFIG_XEN) || defined(CONFIG_PARAVIRT_XEN)
65  #include <xen/interface/xen.h>
66 +#endif
67  
68  #include <linux/lguest.h>
69  #include "../../../drivers/lguest/lg.h"
70 @@ -123,7 +125,7 @@ void foo(void)
71         OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0);
72  #endif
73  
74 -#ifdef CONFIG_XEN
75 +#ifdef CONFIG_PARAVIRT_XEN
76         BLANK();
77         OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
78         OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);
79 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/cpu/common-xen.c   2009-11-06 10:49:47.000000000 +0100
80 +++ sle11sp1-2010-03-29/arch/x86/kernel/cpu/common-xen.c        2009-11-06 10:51:07.000000000 +0100
81 @@ -362,6 +362,8 @@ static void __cpuinit generic_identify(s
82                         if ( xlvl >= 0x80000004 )
83                                 get_model_name(c); /* Default name */
84                 }
85 +
86 +               init_scattered_cpuid_features(c);
87         }
88  
89         early_intel_workaround(c);
90 @@ -613,7 +615,6 @@ extern int nsc_init_cpu(void);
91  extern int amd_init_cpu(void);
92  extern int centaur_init_cpu(void);
93  extern int transmeta_init_cpu(void);
94 -extern int rise_init_cpu(void);
95  extern int nexgen_init_cpu(void);
96  extern int umc_init_cpu(void);
97  
98 @@ -625,7 +626,6 @@ void __init early_cpu_init(void)
99         amd_init_cpu();
100         centaur_init_cpu();
101         transmeta_init_cpu();
102 -       rise_init_cpu();
103         nexgen_init_cpu();
104         umc_init_cpu();
105         early_cpu_detect();
106 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/cpu/mtrr/main-xen.c        2009-11-06 10:49:47.000000000 +0100
107 +++ sle11sp1-2010-03-29/arch/x86/kernel/cpu/mtrr/main-xen.c     2009-11-06 10:51:07.000000000 +0100
108 @@ -167,7 +167,7 @@ mtrr_del(int reg, unsigned long base, un
109  EXPORT_SYMBOL(mtrr_add);
110  EXPORT_SYMBOL(mtrr_del);
111  
112 -__init void mtrr_bp_init(void)
113 +void __init mtrr_bp_init(void)
114  {
115  }
116  
117 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/e820_32-xen.c      2009-11-06 10:49:47.000000000 +0100
118 +++ sle11sp1-2010-03-29/arch/x86/kernel/e820_32-xen.c   2009-11-06 10:51:07.000000000 +0100
119 @@ -10,6 +10,7 @@
120  #include <linux/efi.h>
121  #include <linux/pfn.h>
122  #include <linux/uaccess.h>
123 +#include <linux/suspend.h>
124  
125  #include <asm/pgtable.h>
126  #include <asm/page.h>
127 @@ -343,6 +344,37 @@ static int __init request_standard_resou
128  
129  subsys_initcall(request_standard_resources);
130  
131 +#if defined(CONFIG_PM) && defined(CONFIG_HIBERNATION)
132 +/**
133 + * e820_mark_nosave_regions - Find the ranges of physical addresses that do not
134 + * correspond to e820 RAM areas and mark the corresponding pages as nosave for
135 + * hibernation.
136 + *
137 + * This function requires the e820 map to be sorted and without any
138 + * overlapping entries and assumes the first e820 area to be RAM.
139 + */
140 +void __init e820_mark_nosave_regions(void)
141 +{
142 +       int i;
143 +       unsigned long pfn;
144 +
145 +       pfn = PFN_DOWN(e820.map[0].addr + e820.map[0].size);
146 +       for (i = 1; i < e820.nr_map; i++) {
147 +               struct e820entry *ei = &e820.map[i];
148 +
149 +               if (pfn < PFN_UP(ei->addr))
150 +                       register_nosave_region(pfn, PFN_UP(ei->addr));
151 +
152 +               pfn = PFN_DOWN(ei->addr + ei->size);
153 +               if (ei->type != E820_RAM)
154 +                       register_nosave_region(PFN_UP(ei->addr), pfn);
155 +
156 +               if (pfn >= max_low_pfn)
157 +                       break;
158 +       }
159 +}
160 +#endif
161 +
162  void __init add_memory_region(unsigned long long start,
163                               unsigned long long size, int type)
164  {
165 @@ -791,7 +823,7 @@ void __init print_memory_map(char *who)
166                 case E820_NVS:
167                                 printk("(ACPI NVS)\n");
168                                 break;
169 -               default:        printk("type %lu\n", e820.map[i].type);
170 +               default:        printk("type %u\n", e820.map[i].type);
171                                 break;
172                 }
173         }
174 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/entry_32.S 2009-12-04 10:44:46.000000000 +0100
175 +++ sle11sp1-2010-03-29/arch/x86/kernel/entry_32.S      2009-11-06 10:51:07.000000000 +0100
176 @@ -1050,7 +1050,7 @@ ENTRY(kernel_thread_helper)
177         CFI_ENDPROC
178  ENDPROC(kernel_thread_helper)
179  
180 -#ifdef CONFIG_XEN
181 +#ifdef CONFIG_PARAVIRT_XEN
182  /* Xen doesn't set %esp to be precisely what the normal sysenter
183     entrypoint expects, so fix it up before using the normal path. */
184  ENTRY(xen_sysenter_target)
185 @@ -1143,7 +1143,7 @@ ENTRY(xen_failsafe_callback)
186  .previous
187  ENDPROC(xen_failsafe_callback)
188  
189 -#endif /* CONFIG_XEN */
190 +#endif /* CONFIG_PARAVIRT_XEN */
191  
192  #ifdef CONFIG_FUNCTION_TRACER
193  #ifdef CONFIG_DYNAMIC_FTRACE
194 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/entry_32-xen.S     2009-11-06 10:49:47.000000000 +0100
195 +++ sle11sp1-2010-03-29/arch/x86/kernel/entry_32-xen.S  2009-11-06 10:51:07.000000000 +0100
196 @@ -452,9 +452,6 @@ restore_nocheck_notrace:
197  1:     INTERRUPT_RETURN
198  .section .fixup,"ax"
199  iret_exc:
200 -#ifndef CONFIG_XEN
201 -       ENABLE_INTERRUPTS(CLBR_NONE)
202 -#endif
203         pushl $0                        # no error code
204         pushl $do_iret_error
205         jmp error_code
206 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/head_32-xen.S      2009-11-06 10:49:47.000000000 +0100
207 +++ sle11sp1-2010-03-29/arch/x86/kernel/head_32-xen.S   2009-11-06 10:51:07.000000000 +0100
208 @@ -86,7 +86,10 @@ ENTRY(_stext)
209  /*
210   * BSS section
211   */
212 -.section ".bss.page_aligned","w"
213 +.section ".bss.page_aligned","wa"
214 +       .align PAGE_SIZE_asm
215 +ENTRY(swapper_pg_pmd)
216 +       .fill 1024,4,0
217  ENTRY(empty_zero_page)
218         .fill 4096,1,0
219  
220 @@ -136,25 +139,25 @@ ENTRY(empty_zero_page)
221  #endif /* CONFIG_XEN_COMPAT <= 0x030002 */
222  
223  
224 -       ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz, "linux")       
225 -       ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz, "2.6")
226 -       ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz, "xen-3.0")
227 -       ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      .long,  __PAGE_OFFSET)
228 +       ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz "linux")
229 +       ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz "2.6")
230 +       ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz "xen-3.0")
231 +       ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      .long __PAGE_OFFSET)
232  #if CONFIG_XEN_COMPAT <= 0x030002
233 -       ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .long,  __PAGE_OFFSET)
234 +       ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .long __PAGE_OFFSET)
235  #else
236 -       ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .long,  0)
237 +       ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .long 0)
238  #endif
239 -       ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .long,  startup_32)
240 -       ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .long,  hypercall_page)
241 -       ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW,   .long,  HYPERVISOR_VIRT_START)
242 -       ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
243 +       ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .long startup_32)
244 +       ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .long hypercall_page)
245 +       ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW,   .long HYPERVISOR_VIRT_START)
246 +       ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
247  #ifdef CONFIG_X86_PAE
248 -       ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "yes")
249 -       ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad,  _PAGE_PRESENT,_PAGE_PRESENT)
250 +       ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "yes")
251 +       ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad _PAGE_PRESENT, _PAGE_PRESENT)
252  #else
253 -       ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "no")
254 -       ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .long,  _PAGE_PRESENT,_PAGE_PRESENT)
255 +       ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "no")
256 +       ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .long _PAGE_PRESENT, _PAGE_PRESENT)
257  #endif
258 -       ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
259 -       ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long,  1)
260 +       ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
261 +       ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1)
262 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/io_apic_32-xen.c   2009-11-06 10:49:47.000000000 +0100
263 +++ sle11sp1-2010-03-29/arch/x86/kernel/io_apic_32-xen.c        2009-11-06 10:51:07.000000000 +0100
264 @@ -402,14 +402,6 @@ static void set_ioapic_affinity_irq(unsi
265  # include <linux/slab.h>               /* kmalloc() */
266  # include <linux/timer.h>      /* time_after() */
267   
268 -#ifdef CONFIG_BALANCED_IRQ_DEBUG
269 -#  define TDprintk(x...) do { printk("<%ld:%s:%d>: ", jiffies, __FILE__, __LINE__); printk(x); } while (0)
270 -#  define Dprintk(x...) do { TDprintk(x); } while (0)
271 -# else
272 -#  define TDprintk(x...) 
273 -#  define Dprintk(x...) 
274 -# endif
275 -
276  #define IRQBALANCE_CHECK_ARCH -999
277  #define MAX_BALANCED_IRQ_INTERVAL      (5*HZ)
278  #define MIN_BALANCED_IRQ_INTERVAL      (HZ/2)
279 @@ -492,7 +484,7 @@ static inline void balance_irq(int cpu, 
280  static inline void rotate_irqs_among_cpus(unsigned long useful_load_threshold)
281  {
282         int i, j;
283 -       Dprintk("Rotating IRQs among CPUs.\n");
284 +
285         for_each_online_cpu(i) {
286                 for (j = 0; j < NR_IRQS; j++) {
287                         if (!irq_desc[j].action)
288 @@ -609,19 +601,11 @@ tryanothercpu:
289         max_loaded = tmp_loaded;        /* processor */
290         imbalance = (max_cpu_irq - min_cpu_irq) / 2;
291         
292 -       Dprintk("max_loaded cpu = %d\n", max_loaded);
293 -       Dprintk("min_loaded cpu = %d\n", min_loaded);
294 -       Dprintk("max_cpu_irq load = %ld\n", max_cpu_irq);
295 -       Dprintk("min_cpu_irq load = %ld\n", min_cpu_irq);
296 -       Dprintk("load imbalance = %lu\n", imbalance);
297 -
298         /* if imbalance is less than approx 10% of max load, then
299          * observe diminishing returns action. - quit
300          */
301 -       if (imbalance < (max_cpu_irq >> 3)) {
302 -               Dprintk("Imbalance too trivial\n");
303 +       if (imbalance < (max_cpu_irq >> 3))
304                 goto not_worth_the_effort;
305 -       }
306  
307  tryanotherirq:
308         /* if we select an IRQ to move that can't go where we want, then
309 @@ -678,9 +662,6 @@ tryanotherirq:
310         cpus_and(tmp, target_cpu_mask, allowed_mask);
311  
312         if (!cpus_empty(tmp)) {
313 -
314 -               Dprintk("irq = %d moved to cpu = %d\n",
315 -                               selected_irq, min_loaded);
316                 /* mark for change destination */
317                 set_pending_irq(selected_irq, cpumask_of_cpu(min_loaded));
318  
319 @@ -700,7 +681,6 @@ not_worth_the_effort:
320          */
321         balanced_irq_interval = min((long)MAX_BALANCED_IRQ_INTERVAL,
322                 balanced_irq_interval + BALANCED_IRQ_MORE_DELTA);       
323 -       Dprintk("IRQ worth rotating not found\n");
324         return;
325  }
326  
327 @@ -716,6 +696,7 @@ static int balanced_irq(void *unused)
328                 set_pending_irq(i, cpumask_of_cpu(0));
329         }
330  
331 +       set_freezable();
332         for ( ; ; ) {
333                 time_remaining = schedule_timeout_interruptible(time_remaining);
334                 try_to_freeze();
335 @@ -825,14 +806,6 @@ static int pirq_entries [MAX_PIRQS];
336  static int pirqs_enabled;
337  int skip_ioapic_setup;
338  
339 -static int __init ioapic_setup(char *str)
340 -{
341 -       skip_ioapic_setup = 1;
342 -       return 1;
343 -}
344 -
345 -__setup("noapic", ioapic_setup);
346 -
347  static int __init ioapic_pirq_setup(char *str)
348  {
349         int i, max;
350 @@ -1323,12 +1296,15 @@ static struct irq_chip ioapic_chip;
351  static void ioapic_register_intr(int irq, int vector, unsigned long trigger)
352  {
353         if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
354 -                       trigger == IOAPIC_LEVEL)
355 +           trigger == IOAPIC_LEVEL) {
356 +               irq_desc[irq].status |= IRQ_LEVEL;
357                 set_irq_chip_and_handler_name(irq, &ioapic_chip,
358                                          handle_fasteoi_irq, "fasteoi");
359 -       else
360 +       } else {
361 +               irq_desc[irq].status &= ~IRQ_LEVEL;
362                 set_irq_chip_and_handler_name(irq, &ioapic_chip,
363                                          handle_edge_irq, "edge");
364 +       }
365         set_intr_gate(vector, interrupt[irq]);
366  }
367  #else
368 @@ -1957,7 +1933,7 @@ __setup("no_timer_check", notimercheck);
369   *     - if this function detects that timer IRQs are defunct, then we fall
370   *       back to ISA timer IRQs
371   */
372 -int __init timer_irq_works(void)
373 +static int __init timer_irq_works(void)
374  {
375         unsigned long t1 = jiffies;
376  
377 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/irq_32-xen.c       2009-11-06 10:49:47.000000000 +0100
378 +++ sle11sp1-2010-03-29/arch/x86/kernel/irq_32-xen.c    2009-11-06 10:51:07.000000000 +0100
379 @@ -21,7 +21,7 @@
380  #include <asm/apic.h>
381  #include <asm/uaccess.h>
382  
383 -DEFINE_PER_CPU(irq_cpustat_t, irq_stat) ____cacheline_internodealigned_in_smp;
384 +DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
385  EXPORT_PER_CPU_SYMBOL(irq_stat);
386  
387  DEFINE_PER_CPU(struct pt_regs *, irq_regs);
388 @@ -149,15 +149,11 @@ fastcall unsigned int do_IRQ(struct pt_r
389  
390  #ifdef CONFIG_4KSTACKS
391  
392 -/*
393 - * These should really be __section__(".bss.page_aligned") as well, but
394 - * gcc's 3.0 and earlier don't handle that correctly.
395 - */
396  static char softirq_stack[NR_CPUS * THREAD_SIZE]
397 -               __attribute__((__aligned__(THREAD_SIZE)));
398 +               __attribute__((__section__(".bss.page_aligned")));
399  
400  static char hardirq_stack[NR_CPUS * THREAD_SIZE]
401 -               __attribute__((__aligned__(THREAD_SIZE)));
402 +               __attribute__((__section__(".bss.page_aligned")));
403  
404  /*
405   * allocate per-cpu stacks for hardirq and for softirq processing
406 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/microcode-xen.c    2009-11-06 10:49:47.000000000 +0100
407 +++ sle11sp1-2010-03-29/arch/x86/kernel/microcode-xen.c 2009-11-06 10:51:07.000000000 +0100
408 @@ -33,6 +33,7 @@
409  #include <linux/miscdevice.h>
410  #include <linux/spinlock.h>
411  #include <linux/mm.h>
412 +#include <linux/fs.h>
413  #include <linux/mutex.h>
414  #include <linux/cpu.h>
415  #include <linux/firmware.h>
416 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/pci-dma-xen.c      2009-11-06 10:49:47.000000000 +0100
417 +++ sle11sp1-2010-03-29/arch/x86/kernel/pci-dma-xen.c   2009-11-06 10:51:07.000000000 +0100
418 @@ -24,7 +24,7 @@
419  #include <asm/bug.h>
420  
421  #ifdef __x86_64__
422 -#include <asm/proto.h>
423 +#include <asm/iommu.h>
424  
425  int iommu_merge __read_mostly = 0;
426  EXPORT_SYMBOL(iommu_merge);
427 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/process_32-xen.c   2009-11-06 10:49:47.000000000 +0100
428 +++ sle11sp1-2010-03-29/arch/x86/kernel/process_32-xen.c        2009-11-06 10:51:07.000000000 +0100
429 @@ -241,6 +241,7 @@ early_param("idle", idle_setup);
430  void show_regs(struct pt_regs * regs)
431  {
432         unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
433 +       unsigned long d0, d1, d2, d3, d6, d7;
434  
435         printk("\n");
436         printk("Pid: %d, comm: %20s\n", current->pid, current->comm);
437 @@ -265,6 +266,17 @@ void show_regs(struct pt_regs * regs)
438         cr3 = read_cr3();
439         cr4 = read_cr4_safe();
440         printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", cr0, cr2, cr3, cr4);
441 +
442 +       get_debugreg(d0, 0);
443 +       get_debugreg(d1, 1);
444 +       get_debugreg(d2, 2);
445 +       get_debugreg(d3, 3);
446 +       printk("DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n",
447 +                       d0, d1, d2, d3);
448 +       get_debugreg(d6, 6);
449 +       get_debugreg(d7, 7);
450 +       printk("DR6: %08lx DR7: %08lx\n", d6, d7);
451 +
452         show_trace(NULL, regs, &regs->esp);
453  }
454  
455 @@ -473,7 +485,30 @@ int dump_task_regs(struct task_struct *t
456         return 1;
457  }
458  
459 -static noinline void __switch_to_xtra(struct task_struct *next_p)
460 +#ifdef CONFIG_SECCOMP
461 +void hard_disable_TSC(void)
462 +{
463 +       write_cr4(read_cr4() | X86_CR4_TSD);
464 +}
465 +void disable_TSC(void)
466 +{
467 +       preempt_disable();
468 +       if (!test_and_set_thread_flag(TIF_NOTSC))
469 +               /*
470 +                * Must flip the CPU state synchronously with
471 +                * TIF_NOTSC in the current running context.
472 +                */
473 +               hard_disable_TSC();
474 +       preempt_enable();
475 +}
476 +void hard_enable_TSC(void)
477 +{
478 +       write_cr4(read_cr4() & ~X86_CR4_TSD);
479 +}
480 +#endif /* CONFIG_SECCOMP */
481 +
482 +static noinline void
483 +__switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p)
484  {
485         struct thread_struct *next;
486  
487 @@ -488,33 +523,17 @@ static noinline void __switch_to_xtra(st
488                 set_debugreg(next->debugreg[6], 6);
489                 set_debugreg(next->debugreg[7], 7);
490         }
491 -}
492  
493 -/*
494 - * This function selects if the context switch from prev to next
495 - * has to tweak the TSC disable bit in the cr4.
496 - */
497 -static inline void disable_tsc(struct task_struct *prev_p,
498 -                              struct task_struct *next_p)
499 -{
500 -       struct thread_info *prev, *next;
501 -
502 -       /*
503 -        * gcc should eliminate the ->thread_info dereference if
504 -        * has_secure_computing returns 0 at compile time (SECCOMP=n).
505 -        */
506 -       prev = task_thread_info(prev_p);
507 -       next = task_thread_info(next_p);
508 -
509 -       if (has_secure_computing(prev) || has_secure_computing(next)) {
510 -               /* slow path here */
511 -               if (has_secure_computing(prev) &&
512 -                   !has_secure_computing(next)) {
513 -                       write_cr4(read_cr4() & ~X86_CR4_TSD);
514 -               } else if (!has_secure_computing(prev) &&
515 -                          has_secure_computing(next))
516 -                       write_cr4(read_cr4() | X86_CR4_TSD);
517 +#ifdef CONFIG_SECCOMP
518 +       if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
519 +           test_tsk_thread_flag(next_p, TIF_NOTSC)) {
520 +               /* prev and next are different */
521 +               if (test_tsk_thread_flag(next_p, TIF_NOTSC))
522 +                       hard_disable_TSC();
523 +               else
524 +                       hard_enable_TSC();
525         }
526 +#endif
527  }
528  
529  /*
530 @@ -649,10 +668,9 @@ struct task_struct fastcall * __switch_t
531         /*
532          * Now maybe handle debug registers
533          */
534 -       if (unlikely(task_thread_info(next_p)->flags & _TIF_WORK_CTXSW))
535 -               __switch_to_xtra(next_p);
536 -
537 -       disable_tsc(prev_p, next_p);
538 +       if (unlikely(task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV ||
539 +                    task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT))
540 +               __switch_to_xtra(prev_p, next_p);
541  
542         /*
543          * Leave lazy mode, flushing any hypercalls made here.
544 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/setup_32-xen.c     2009-11-06 10:46:41.000000000 +0100
545 +++ sle11sp1-2010-03-29/arch/x86/kernel/setup_32-xen.c  2009-11-06 10:51:07.000000000 +0100
546 @@ -114,19 +114,10 @@ static unsigned int highmem_pages = -1;
547  /*
548   * Setup options
549   */
550 -struct drive_info_struct { char dummy[32]; } drive_info;
551 -#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || \
552 -    defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
553 -EXPORT_SYMBOL(drive_info);
554 -#endif
555  struct screen_info screen_info;
556  EXPORT_SYMBOL(screen_info);
557  struct apm_info apm_info;
558  EXPORT_SYMBOL(apm_info);
559 -struct sys_desc_table_struct {
560 -       unsigned short length;
561 -       unsigned char table[0];
562 -};
563  struct edid_info edid_info;
564  EXPORT_SYMBOL_GPL(edid_info);
565  #ifndef CONFIG_XEN
566 @@ -149,7 +140,7 @@ unsigned long saved_videomode;
567  
568  static char __initdata command_line[COMMAND_LINE_SIZE];
569  
570 -unsigned char __initdata boot_params[PARAM_SIZE];
571 +struct boot_params __initdata boot_params;
572  
573  /*
574   * Point at the empty zero page to start with. We map the real shared_info
575 @@ -316,18 +307,18 @@ unsigned long __init find_max_low_pfn(vo
576                 printk(KERN_WARNING "Warning only %ldMB will be used.\n",
577                                         MAXMEM>>20);
578                 if (max_pfn > MAX_NONPAE_PFN)
579 -                       printk(KERN_WARNING "Use a PAE enabled kernel.\n");
580 +                       printk(KERN_WARNING "Use a HIGHMEM64G enabled kernel.\n");
581                 else
582                         printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n");
583                 max_pfn = MAXMEM_PFN;
584  #else /* !CONFIG_HIGHMEM */
585 -#ifndef CONFIG_X86_PAE
586 +#ifndef CONFIG_HIGHMEM64G
587                 if (max_pfn > MAX_NONPAE_PFN) {
588                         max_pfn = MAX_NONPAE_PFN;
589                         printk(KERN_WARNING "Warning only 4GB will be used.\n");
590 -                       printk(KERN_WARNING "Use a PAE enabled kernel.\n");
591 +                       printk(KERN_WARNING "Use a HIGHMEM64G enabled kernel.\n");
592                 }
593 -#endif /* !CONFIG_X86_PAE */
594 +#endif /* !CONFIG_HIGHMEM64G */
595  #endif /* !CONFIG_HIGHMEM */
596         } else {
597                 if (highmem_pages == -1)
598 @@ -516,7 +507,7 @@ void __init setup_bootmem_allocator(void
599   *
600   * This should all compile down to nothing when NUMA is off.
601   */
602 -void __init remapped_pgdat_init(void)
603 +static void __init remapped_pgdat_init(void)
604  {
605         int nid;
606  
607 @@ -591,7 +582,6 @@ void __init setup_arch(char **cmdline_p)
608            properly.  Setting ROOT_DEV to default to /dev/ram0 breaks initrd.
609         */
610         ROOT_DEV = MKDEV(UNNAMED_MAJOR,0);
611 -       drive_info = DRIVE_INFO;
612         screen_info = SCREEN_INFO;
613         copy_edid();
614         apm_info.bios = APM_BIOS_INFO;
615 @@ -769,6 +759,8 @@ void __init setup_arch(char **cmdline_p)
616          * NOTE: at this point the bootmem allocator is fully available.
617          */
618  
619 +       paravirt_post_allocator_init();
620 +
621         if (is_initial_xendomain())
622                 dmi_scan_machine();
623  
624 @@ -816,6 +808,7 @@ void __init setup_arch(char **cmdline_p)
625  #endif
626  
627         e820_register_memory();
628 +       e820_mark_nosave_regions();
629  
630         if (is_initial_xendomain()) {
631  #ifdef CONFIG_VT
632 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/smp_32-xen.c       2009-11-06 10:49:47.000000000 +0100
633 +++ sle11sp1-2010-03-29/arch/x86/kernel/smp_32-xen.c    2009-11-06 10:51:07.000000000 +0100
634 @@ -22,6 +22,7 @@
635  
636  #include <asm/mtrr.h>
637  #include <asm/tlbflush.h>
638 +#include <asm/mmu_context.h>
639  #if 0
640  #include <mach_apic.h>
641  #endif
642 @@ -217,13 +218,13 @@ static unsigned long flush_va;
643  static DEFINE_SPINLOCK(tlbstate_lock);
644  
645  /*
646 - * We cannot call mmdrop() because we are in interrupt context, 
647 + * We cannot call mmdrop() because we are in interrupt context,
648   * instead update mm->cpu_vm_mask.
649   *
650   * We need to reload %cr3 since the page tables may be going
651   * away from under us..
652   */
653 -static inline void leave_mm (unsigned long cpu)
654 +void leave_mm(unsigned long cpu)
655  {
656         if (per_cpu(cpu_tlbstate, cpu).state == TLBSTATE_OK)
657                 BUG();
658 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/time-xen.c 2010-03-01 14:30:29.000000000 +0100
659 +++ sle11sp1-2010-03-29/arch/x86/kernel/time-xen.c      2010-02-09 16:51:56.000000000 +0100
660 @@ -75,11 +75,12 @@
661  #include <xen/evtchn.h>
662  #include <xen/interface/vcpu.h>
663  
664 -#ifdef CONFIG_X86_32
665  #include <asm/i8253.h>
666  DEFINE_SPINLOCK(i8253_lock);
667  EXPORT_SYMBOL(i8253_lock);
668 -#else
669 +
670 +#ifdef CONFIG_X86_64
671 +#include <asm/vsyscall.h>
672  volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES;
673  #endif
674  
675 @@ -757,56 +758,10 @@ unsigned long read_persistent_clock(void
676         return retval;
677  }
678  
679 -static void sync_cmos_clock(unsigned long dummy);
680 -
681 -static DEFINE_TIMER(sync_cmos_timer, sync_cmos_clock, 0, 0);
682 -int no_sync_cmos_clock;
683 -
684 -static void sync_cmos_clock(unsigned long dummy)
685 -{
686 -       struct timeval now, next;
687 -       int fail = 1;
688 -
689 -       /*
690 -        * If we have an externally synchronized Linux clock, then update
691 -        * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
692 -        * called as close as possible to 500 ms before the new second starts.
693 -        * This code is run on a timer.  If the clock is set, that timer
694 -        * may not expire at the correct time.  Thus, we adjust...
695 -        */
696 -       if (!ntp_synced())
697 -               /*
698 -                * Not synced, exit, do not restart a timer (if one is
699 -                * running, let it run out).
700 -                */
701 -               return;
702 -
703 -       do_gettimeofday(&now);
704 -       if (now.tv_usec >= USEC_AFTER - ((unsigned) TICK_SIZE) / 2 &&
705 -           now.tv_usec <= USEC_BEFORE + ((unsigned) TICK_SIZE) / 2)
706 -               fail = set_rtc_mmss(now.tv_sec);
707 -
708 -       next.tv_usec = USEC_AFTER - now.tv_usec;
709 -       if (next.tv_usec <= 0)
710 -               next.tv_usec += USEC_PER_SEC;
711 -
712 -       if (!fail)
713 -               next.tv_sec = 659;
714 -       else
715 -               next.tv_sec = 0;
716 -
717 -       if (next.tv_usec >= USEC_PER_SEC) {
718 -               next.tv_sec++;
719 -               next.tv_usec -= USEC_PER_SEC;
720 -       }
721 -       mod_timer(&sync_cmos_timer, jiffies + timeval_to_jiffies(&next));
722 -}
723 -
724 -void notify_arch_cmos_timer(void)
725 +int update_persistent_clock(struct timespec now)
726  {
727 -       if (!no_sync_cmos_clock)
728 -               mod_timer(&sync_cmos_timer, jiffies + 1);
729         mod_timer(&sync_xen_wallclock_timer, jiffies + 1);
730 +       return set_rtc_mmss(now.tv_sec);
731  }
732  
733  extern void (*late_time_init)(void);
734 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/traps_32-xen.c     2009-11-06 10:49:47.000000000 +0100
735 +++ sle11sp1-2010-03-29/arch/x86/kernel/traps_32-xen.c  2009-11-06 10:51:07.000000000 +0100
736 @@ -41,6 +41,10 @@
737  #include <linux/mca.h>
738  #endif
739  
740 +#if defined(CONFIG_EDAC)
741 +#include <linux/edac.h>
742 +#endif
743 +
744  #include <asm/processor.h>
745  #include <asm/system.h>
746  #include <asm/io.h>
747 @@ -102,36 +106,45 @@ asmlinkage void machine_check(void);
748  int kstack_depth_to_print = 24;
749  static unsigned int code_bytes = 64;
750  
751 -static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
752 +static inline int valid_stack_ptr(struct thread_info *tinfo, void *p, unsigned size)
753  {
754         return  p > (void *)tinfo &&
755 -               p < (void *)tinfo + THREAD_SIZE - 3;
756 +               p <= (void *)tinfo + THREAD_SIZE - size;
757  }
758  
759 +/* The form of the top of the frame on the stack */
760 +struct stack_frame {
761 +       struct stack_frame *next_frame;
762 +       unsigned long return_address;
763 +};
764 +
765  static inline unsigned long print_context_stack(struct thread_info *tinfo,
766                                 unsigned long *stack, unsigned long ebp,
767                                 struct stacktrace_ops *ops, void *data)
768  {
769 -       unsigned long addr;
770 -
771  #ifdef CONFIG_FRAME_POINTER
772 -       while (valid_stack_ptr(tinfo, (void *)ebp)) {
773 -               unsigned long new_ebp;
774 -               addr = *(unsigned long *)(ebp + 4);
775 +       struct stack_frame *frame = (struct stack_frame *)ebp;
776 +       while (valid_stack_ptr(tinfo, frame, sizeof(*frame))) {
777 +               struct stack_frame *next;
778 +               unsigned long addr;
779 +
780 +               addr = frame->return_address;
781                 ops->address(data, addr);
782                 /*
783                  * break out of recursive entries (such as
784                  * end_of_stack_stop_unwind_function). Also,
785                  * we can never allow a frame pointer to
786                  * move downwards!
787 -                */
788 -               new_ebp = *(unsigned long *)ebp;
789 -               if (new_ebp <= ebp)
790 +                */
791 +               next = frame->next_frame;
792 +               if (next <= frame)
793                         break;
794 -               ebp = new_ebp;
795 +               frame = next;
796         }
797  #else
798 -       while (valid_stack_ptr(tinfo, stack)) {
799 +       while (valid_stack_ptr(tinfo, stack, sizeof(*stack))) {
800 +               unsigned long addr;
801 +
802                 addr = *stack++;
803                 if (__kernel_text_address(addr))
804                         ops->address(data, addr);
805 @@ -154,7 +167,7 @@ void dump_trace(struct task_struct *task
806         if (!stack) {
807                 unsigned long dummy;
808                 stack = &dummy;
809 -               if (task && task != current)
810 +               if (task != current)
811                         stack = (unsigned long *)task->thread.esp;
812         }
813  
814 @@ -213,6 +226,7 @@ static void print_trace_address(void *da
815  {
816         printk("%s [<%08lx>] ", (char *)data, addr);
817         print_symbol("%s\n", addr);
818 +       touch_nmi_watchdog();
819  }
820  
821  static struct stacktrace_ops print_trace_ops = {
822 @@ -396,7 +410,7 @@ void die(const char * str, struct pt_reg
823                 unsigned long esp;
824                 unsigned short ss;
825  
826 -               report_bug(regs->eip);
827 +               report_bug(regs->eip, regs);
828  
829                 printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
830  #ifdef CONFIG_PREEMPT
831 @@ -439,6 +453,7 @@ void die(const char * str, struct pt_reg
832  
833         bust_spinlocks(0);
834         die.lock_owner = -1;
835 +       add_taint(TAINT_DIE);
836         spin_unlock_irqrestore(&die.lock, flags);
837  
838         if (!regs)
839 @@ -523,10 +538,12 @@ fastcall void do_##name(struct pt_regs *
840         do_trap(trapnr, signr, str, 0, regs, error_code, NULL); \
841  }
842  
843 -#define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \
844 +#define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr, irq) \
845  fastcall void do_##name(struct pt_regs * regs, long error_code) \
846  { \
847         siginfo_t info; \
848 +       if (irq) \
849 +               local_irq_enable(); \
850         info.si_signo = signr; \
851         info.si_errno = 0; \
852         info.si_code = sicode; \
853 @@ -566,13 +583,13 @@ DO_VM86_ERROR( 3, SIGTRAP, "int3", int3)
854  #endif
855  DO_VM86_ERROR( 4, SIGSEGV, "overflow", overflow)
856  DO_VM86_ERROR( 5, SIGSEGV, "bounds", bounds)
857 -DO_ERROR_INFO( 6, SIGILL,  "invalid opcode", invalid_op, ILL_ILLOPN, regs->eip)
858 +DO_ERROR_INFO( 6, SIGILL,  "invalid opcode", invalid_op, ILL_ILLOPN, regs->eip, 0)
859  DO_ERROR( 9, SIGFPE,  "coprocessor segment overrun", coprocessor_segment_overrun)
860  DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS)
861  DO_ERROR(11, SIGBUS,  "segment not present", segment_not_present)
862  DO_ERROR(12, SIGBUS,  "stack segment", stack_segment)
863 -DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
864 -DO_ERROR_INFO(32, SIGSEGV, "iret exception", iret_error, ILL_BADSTK, 0)
865 +DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0, 0)
866 +DO_ERROR_INFO(32, SIGSEGV, "iret exception", iret_error, ILL_BADSTK, 0, 1)
867  
868  fastcall void __kprobes do_general_protection(struct pt_regs * regs,
869                                               long error_code)
870 @@ -585,6 +602,13 @@ fastcall void __kprobes do_general_prote
871  
872         current->thread.error_code = error_code;
873         current->thread.trap_no = 13;
874 +       if (show_unhandled_signals && unhandled_signal(current, SIGSEGV) &&
875 +           printk_ratelimit())
876 +               printk(KERN_INFO
877 +                   "%s[%d] general protection eip:%lx esp:%lx error:%lx\n",
878 +                   current->comm, current->pid,
879 +                   regs->eip, regs->esp, error_code);
880 +
881         force_sig(SIGSEGV, current);
882         return;
883  
884 @@ -610,6 +634,14 @@ mem_parity_error(unsigned char reason, s
885         printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x on "
886                 "CPU %d.\n", reason, smp_processor_id());
887         printk(KERN_EMERG "You have some hardware problem, likely on the PCI bus.\n");
888 +
889 +#if defined(CONFIG_EDAC)
890 +       if(edac_handler_set()) {
891 +               edac_atomic_assert_error();
892 +               return;
893 +       }
894 +#endif
895 +
896         if (panic_on_unrecovered_nmi)
897                  panic("NMI: Not continuing");
898  
899 @@ -720,6 +752,8 @@ static __kprobes void default_do_nmi(str
900         reassert_nmi();
901  }
902  
903 +static int ignore_nmis;
904 +
905  fastcall __kprobes void do_nmi(struct pt_regs * regs, long error_code)
906  {
907         int cpu;
908 @@ -730,11 +764,24 @@ fastcall __kprobes void do_nmi(struct pt
909  
910         ++nmi_count(cpu);
911  
912 -       default_do_nmi(regs);
913 +       if (!ignore_nmis)
914 +               default_do_nmi(regs);
915  
916         nmi_exit();
917  }
918  
919 +void stop_nmi(void)
920 +{
921 +       acpi_nmi_disable();
922 +       ignore_nmis++;
923 +}
924 +
925 +void restart_nmi(void)
926 +{
927 +       ignore_nmis--;
928 +       acpi_nmi_enable();
929 +}
930 +
931  #ifdef CONFIG_KPROBES
932  fastcall void __kprobes do_int3(struct pt_regs *regs, long error_code)
933  {
934 @@ -1023,6 +1070,7 @@ asmlinkage void math_state_restore(void)
935         thread->status |= TS_USEDFPU;   /* So we fnsave on switch_to() */
936         tsk->fpu_counter++;
937  }
938 +EXPORT_SYMBOL_GPL(math_state_restore);
939  
940  #ifndef CONFIG_MATH_EMULATION
941  
942 --- sle11sp1-2010-03-29.orig/arch/x86/mach-xen/setup.c  2009-11-06 10:45:48.000000000 +0100
943 +++ sle11sp1-2010-03-29/arch/x86/mach-xen/setup.c       2009-11-06 10:51:07.000000000 +0100
944 @@ -12,6 +12,7 @@
945  #include <asm/e820.h>
946  #include <asm/setup.h>
947  #include <asm/fixmap.h>
948 +#include <asm/pgtable.h>
949  
950  #include <xen/interface/callback.h>
951  #include <xen/interface/memory.h>
952 @@ -101,7 +102,7 @@ void __init pre_setup_arch_hook(void)
953  
954         init_mm.pgd = swapper_pg_dir = (pgd_t *)xen_start_info->pt_base;
955  
956 -       setup_xen_features();
957 +       xen_setup_features();
958  
959         if (HYPERVISOR_xen_version(XENVER_platform_parameters, &pp) == 0) {
960                 hypervisor_virt_start = pp.virt_start;
961 @@ -157,4 +158,18 @@ void __init machine_specific_arch_setup(
962                 HYPERVISOR_nmi_op(XENNMI_register_callback, &cb);
963         }
964  #endif
965 +
966 +       /* Do an early initialization of the fixmap area */
967 +       {
968 +               extern pte_t swapper_pg_pmd[PTRS_PER_PTE];
969 +               unsigned long addr = __fix_to_virt(FIX_EARLYCON_MEM_BASE);
970 +               pgd_t *pgd = (pgd_t *)xen_start_info->pt_base;
971 +               pud_t *pud = pud_offset(pgd + pgd_index(addr), addr);
972 +               pmd_t *pmd = pmd_offset(pud, addr);
973 +
974 +               swapper_pg_dir = pgd;
975 +               init_mm.pgd    = pgd;
976 +               make_lowmem_page_readonly(swapper_pg_pmd, XENFEAT_writable_page_tables);
977 +               set_pmd(pmd, __pmd(__pa_symbol(swapper_pg_pmd) | _PAGE_TABLE));
978 +       }
979  }
980 --- sle11sp1-2010-03-29.orig/arch/x86/mm/fault_32-xen.c 2009-11-06 10:49:47.000000000 +0100
981 +++ sle11sp1-2010-03-29/arch/x86/mm/fault_32-xen.c      2009-11-06 10:51:07.000000000 +0100
982 @@ -346,7 +346,10 @@ static inline pmd_t *vmalloc_sync_one(pg
983         pmd_k = pmd_offset(pud_k, address);
984         if (!pmd_present(*pmd_k))
985                 return NULL;
986 -       if (!pmd_present(*pmd))
987 +       if (!pmd_present(*pmd)) {
988 +               bool lazy = x86_read_percpu(xen_lazy_mmu);
989 +
990 +               x86_write_percpu(xen_lazy_mmu, false);
991  #if CONFIG_XEN_COMPAT > 0x030002
992                 set_pmd(pmd, *pmd_k);
993  #else
994 @@ -356,7 +359,8 @@ static inline pmd_t *vmalloc_sync_one(pg
995                  */
996                 set_pmd(pmd, __pmd(pmd_val(*pmd_k)));
997  #endif
998 -       else
999 +               x86_write_percpu(xen_lazy_mmu, lazy);
1000 +       } else
1001                 BUG_ON(pmd_page(*pmd) != pmd_page(*pmd_k));
1002         return pmd_k;
1003  }
1004 @@ -388,6 +392,8 @@ static inline int vmalloc_fault(unsigned
1005         return 0;
1006  }
1007  
1008 +int show_unhandled_signals = 1;
1009 +
1010  /*
1011   * This routine handles page faults.  It determines the address,
1012   * and the problem, and then passes it off to one of the appropriate
1013 @@ -408,6 +414,7 @@ fastcall void __kprobes do_page_fault(st
1014         struct vm_area_struct * vma;
1015         unsigned long address;
1016         int write, si_code;
1017 +       int fault;
1018  
1019         /* get the address */
1020          address = read_cr2();
1021 @@ -541,20 +548,18 @@ good_area:
1022          * make sure we exit gracefully rather than endlessly redo
1023          * the fault.
1024          */
1025 -       switch (handle_mm_fault(mm, vma, address, write)) {
1026 -               case VM_FAULT_MINOR:
1027 -                       tsk->min_flt++;
1028 -                       break;
1029 -               case VM_FAULT_MAJOR:
1030 -                       tsk->maj_flt++;
1031 -                       break;
1032 -               case VM_FAULT_SIGBUS:
1033 -                       goto do_sigbus;
1034 -               case VM_FAULT_OOM:
1035 +       fault = handle_mm_fault(mm, vma, address, write);
1036 +       if (unlikely(fault & VM_FAULT_ERROR)) {
1037 +               if (fault & VM_FAULT_OOM)
1038                         goto out_of_memory;
1039 -               default:
1040 -                       BUG();
1041 +               else if (fault & VM_FAULT_SIGBUS)
1042 +                       goto do_sigbus;
1043 +               BUG();
1044         }
1045 +       if (fault & VM_FAULT_MAJOR)
1046 +               tsk->maj_flt++;
1047 +       else
1048 +               tsk->min_flt++;
1049  
1050         /*
1051          * Did it hit the DOS screen memory VA from vm86 mode?
1052 @@ -589,6 +594,14 @@ bad_area_nosemaphore:
1053                 if (is_prefetch(regs, address, error_code))
1054                         return;
1055  
1056 +               if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
1057 +                   printk_ratelimit()) {
1058 +                       printk("%s%s[%d]: segfault at %08lx eip %08lx "
1059 +                           "esp %08lx error %lx\n",
1060 +                           tsk->pid > 1 ? KERN_INFO : KERN_EMERG,
1061 +                           tsk->comm, tsk->pid, address, regs->eip,
1062 +                           regs->esp, error_code);
1063 +               }
1064                 tsk->thread.cr2 = address;
1065                 /* Kernel addresses are always protection faults */
1066                 tsk->thread.error_code = error_code | (address >= TASK_SIZE);
1067 --- sle11sp1-2010-03-29.orig/arch/x86/mm/highmem_32-xen.c       2009-11-06 10:49:47.000000000 +0100
1068 +++ sle11sp1-2010-03-29/arch/x86/mm/highmem_32-xen.c    2009-11-06 10:51:07.000000000 +0100
1069 @@ -34,17 +34,16 @@ void *kmap_atomic_prot(struct page *page
1070         /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
1071         pagefault_disable();
1072  
1073 -       idx = type + KM_TYPE_NR*smp_processor_id();
1074 -       BUG_ON(!pte_none(*(kmap_pte-idx)));
1075 -
1076         if (!PageHighMem(page))
1077                 return page_address(page);
1078  
1079 +       idx = type + KM_TYPE_NR*smp_processor_id();
1080         vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
1081 +       BUG_ON(!pte_none(*(kmap_pte-idx)));
1082         set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot));
1083         /*arch_flush_lazy_mmu_mode();*/
1084  
1085 -       return (void*) vaddr;
1086 +       return (void *)vaddr;
1087  }
1088  
1089  void *kmap_atomic(struct page *page, enum km_type type)
1090 --- sle11sp1-2010-03-29.orig/arch/x86/mm/init_32-xen.c  2009-11-06 10:49:47.000000000 +0100
1091 +++ sle11sp1-2010-03-29/arch/x86/mm/init_32-xen.c       2009-11-06 10:51:07.000000000 +0100
1092 @@ -96,7 +96,7 @@ static pte_t * __init one_page_table_ini
1093  #endif
1094                 pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
1095  
1096 -               paravirt_alloc_pt(__pa(page_table) >> PAGE_SHIFT);
1097 +               paravirt_alloc_pt(&init_mm, __pa(page_table) >> PAGE_SHIFT);
1098                 make_lowmem_page_readonly(page_table,
1099                                           XENFEAT_writable_page_tables);
1100                 set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE));
1101 @@ -453,7 +453,7 @@ static void __init pagetable_init (void)
1102         xen_pagetable_setup_done(pgd_base);
1103  }
1104  
1105 -#if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI_SLEEP)
1106 +#if defined(CONFIG_HIBERNATION) || defined(CONFIG_ACPI)
1107  /*
1108   * Swap suspend & friends need this for resume because things like the intel-agp
1109   * driver might have split up a kernel 4MB mapping.
1110 @@ -492,9 +492,13 @@ void zap_low_mappings (void)
1111         flush_tlb_all();
1112  }
1113  
1114 +int nx_enabled = 0;
1115 +
1116 +#ifdef CONFIG_X86_PAE
1117 +
1118  static int disable_nx __initdata = 0;
1119  u64 __supported_pte_mask __read_mostly = ~_PAGE_NX;
1120 -EXPORT_SYMBOL(__supported_pte_mask);
1121 +EXPORT_SYMBOL_GPL(__supported_pte_mask);
1122  
1123  /*
1124   * noexec = on|off
1125 @@ -521,9 +525,6 @@ static int __init noexec_setup(char *str
1126  }
1127  early_param("noexec", noexec_setup);
1128  
1129 -int nx_enabled = 0;
1130 -#ifdef CONFIG_X86_PAE
1131 -
1132  static void __init set_nx(void)
1133  {
1134         unsigned int v[4], l, h;
1135 @@ -770,7 +771,7 @@ void __init mem_init(void)
1136         zap_low_mappings();
1137  #endif
1138  
1139 -       set_bit(PG_pinned, &virt_to_page(init_mm.pgd)->flags);
1140 +       SetPagePinned(virt_to_page(init_mm.pgd));
1141  }
1142  
1143  #ifdef CONFIG_MEMORY_HOTPLUG
1144 @@ -802,8 +803,7 @@ void __init pgtable_cache_init(void)
1145                                         PTRS_PER_PMD*sizeof(pmd_t),
1146                                         PTRS_PER_PMD*sizeof(pmd_t),
1147                                         SLAB_PANIC,
1148 -                                       pmd_ctor,
1149 -                                       NULL);
1150 +                                       pmd_ctor);
1151                 if (!SHARED_KERNEL_PMD) {
1152                         /* If we're in PAE mode and have a non-shared
1153                            kernel pmd, then the pgd size must be a
1154 --- sle11sp1-2010-03-29.orig/arch/x86/mm/ioremap_32-xen.c       2009-11-06 10:49:47.000000000 +0100
1155 +++ sle11sp1-2010-03-29/arch/x86/mm/ioremap_32-xen.c    2009-11-06 10:51:07.000000000 +0100
1156 @@ -363,9 +363,8 @@ void iounmap(volatile void __iomem *addr
1157  
1158         /* Reset the direct mapping. Can block */
1159         if ((p->flags >> 20) && is_local_lowmem(p->phys_addr)) {
1160 -               /* p->size includes the guard page, but cpa doesn't like that */
1161                 change_page_attr(virt_to_page(bus_to_virt(p->phys_addr)),
1162 -                                (p->size - PAGE_SIZE) >> PAGE_SHIFT,
1163 +                                get_vm_area_size(p) >> PAGE_SHIFT,
1164                                  PAGE_KERNEL);
1165                 global_flush_tlb();
1166         } 
1167 --- sle11sp1-2010-03-29.orig/arch/x86/mm/pgtable_32-xen.c       2009-11-06 10:49:47.000000000 +0100
1168 +++ sle11sp1-2010-03-29/arch/x86/mm/pgtable_32-xen.c    2009-11-06 10:51:07.000000000 +0100
1169 @@ -198,7 +198,7 @@ void pte_free(struct page *pte)
1170                                 va, pfn_pte(pfn, PAGE_KERNEL), 0))
1171                                 BUG();
1172         } else
1173 -               clear_bit(PG_pinned, &pte->flags);
1174 +               ClearPagePinned(pte);
1175  
1176         ClearPageForeign(pte);
1177         init_page_count(pte);
1178 @@ -248,7 +248,7 @@ static inline void pgd_list_del(pgd_t *p
1179  
1180  #if (PTRS_PER_PMD == 1)
1181  /* Non-PAE pgd constructor */
1182 -void pgd_ctor(void *pgd)
1183 +static void pgd_ctor(void *pgd)
1184  {
1185         unsigned long flags;
1186  
1187 @@ -271,7 +271,7 @@ void pgd_ctor(void *pgd)
1188  }
1189  #else  /* PTRS_PER_PMD > 1 */
1190  /* PAE pgd constructor */
1191 -void pgd_ctor(void *pgd)
1192 +static void pgd_ctor(void *pgd)
1193  {
1194         /* PAE, kernel PMD may be shared */
1195  
1196 @@ -285,7 +285,7 @@ void pgd_ctor(void *pgd)
1197  }
1198  #endif /* PTRS_PER_PMD */
1199  
1200 -void pgd_dtor(void *pgd)
1201 +static void pgd_dtor(void *pgd)
1202  {
1203         unsigned long flags; /* can be called from interrupt context */
1204  
1205 @@ -637,9 +637,9 @@ static inline unsigned int pgd_walk_set_
1206  
1207         if (PageHighMem(page)) {
1208                 if (pgprot_val(flags) & _PAGE_RW)
1209 -                       clear_bit(PG_pinned, &page->flags);
1210 +                       ClearPagePinned(page);
1211                 else
1212 -                       set_bit(PG_pinned, &page->flags);
1213 +                       SetPagePinned(page);
1214         } else {
1215                 MULTI_update_va_mapping(per_cpu(pb_mcl, cpu) + seq,
1216                                 (unsigned long)__va(pfn << PAGE_SHIFT),
1217 @@ -709,19 +709,19 @@ static void __pgd_pin(pgd_t *pgd)
1218         pgd_walk(pgd, PAGE_KERNEL_RO);
1219         kmap_flush_unused();
1220         xen_pgd_pin(__pa(pgd));
1221 -       set_bit(PG_pinned, &virt_to_page(pgd)->flags);
1222 +       SetPagePinned(virt_to_page(pgd));
1223  }
1224  
1225  static void __pgd_unpin(pgd_t *pgd)
1226  {
1227         xen_pgd_unpin(__pa(pgd));
1228         pgd_walk(pgd, PAGE_KERNEL);
1229 -       clear_bit(PG_pinned, &virt_to_page(pgd)->flags);
1230 +       ClearPagePinned(virt_to_page(pgd));
1231  }
1232  
1233  static void pgd_test_and_unpin(pgd_t *pgd)
1234  {
1235 -       if (test_bit(PG_pinned, &virt_to_page(pgd)->flags))
1236 +       if (PagePinned(virt_to_page(pgd)))
1237                 __pgd_unpin(pgd);
1238  }
1239  
1240 @@ -759,7 +759,7 @@ void mm_pin_all(void)
1241          */
1242         spin_lock_irqsave(&pgd_lock, flags);
1243         for (page = pgd_list; page; page = (struct page *)page->index) {
1244 -               if (!test_bit(PG_pinned, &page->flags))
1245 +               if (!PagePinned(page))
1246                         __pgd_pin((pgd_t *)page_address(page));
1247         }
1248         spin_unlock_irqrestore(&pgd_lock, flags);
1249 @@ -767,7 +767,7 @@ void mm_pin_all(void)
1250  
1251  void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm)
1252  {
1253 -       if (!test_bit(PG_pinned, &virt_to_page(mm->pgd)->flags))
1254 +       if (!PagePinned(virt_to_page(mm->pgd)))
1255                 mm_pin(mm);
1256  }
1257  
1258 @@ -793,7 +793,7 @@ void arch_exit_mmap(struct mm_struct *mm
1259  
1260         task_unlock(tsk);
1261  
1262 -       if (test_bit(PG_pinned, &virt_to_page(mm->pgd)->flags) &&
1263 +       if (PagePinned(virt_to_page(mm->pgd)) &&
1264             (atomic_read(&mm->mm_count) == 1) &&
1265             !mm->context.has_foreign_mappings)
1266                 mm_unpin(mm);
1267 --- sle11sp1-2010-03-29.orig/arch/x86/pci/irq-xen.c     2009-11-06 10:46:27.000000000 +0100
1268 +++ sle11sp1-2010-03-29/arch/x86/pci/irq-xen.c  2009-11-06 10:51:07.000000000 +0100
1269 @@ -142,8 +142,9 @@ static void __init pirq_peer_trick(void)
1270         for(i = 1; i < 256; i++) {
1271                 if (!busmap[i] || pci_find_bus(0, i))
1272                         continue;
1273 -               if (pci_scan_bus(i, &pci_root_ops, NULL))
1274 -                       printk(KERN_INFO "PCI: Discovered primary peer bus %02x [IRQ]\n", i);
1275 +               if (pci_scan_bus_with_sysdata(i))
1276 +                       printk(KERN_INFO "PCI: Discovered primary peer "
1277 +                              "bus %02x [IRQ]\n", i);
1278         }
1279         pcibios_last_bus = -1;
1280  }
1281 @@ -553,6 +554,7 @@ static __init int intel_router_probe(str
1282                 case PCI_DEVICE_ID_INTEL_ICH9_3:
1283                 case PCI_DEVICE_ID_INTEL_ICH9_4:
1284                 case PCI_DEVICE_ID_INTEL_ICH9_5:
1285 +               case PCI_DEVICE_ID_INTEL_TOLAPAI_0:
1286                         r->name = "PIIX/ICH";
1287                         r->get = pirq_piix_get;
1288                         r->set = pirq_piix_set;
1289 --- sle11sp1-2010-03-29.orig/arch/x86/xen/Kconfig       2010-03-29 09:00:35.000000000 +0200
1290 +++ sle11sp1-2010-03-29/arch/x86/xen/Kconfig    2009-11-20 11:01:03.000000000 +0100
1291 @@ -2,7 +2,7 @@
1292  # This Kconfig describes xen options
1293  #
1294  
1295 -config XEN
1296 +config PARAVIRT_XEN
1297         bool "Xen guest support"
1298         select PARAVIRT_ALL
1299         select PARAVIRT_CLOCK
1300 --- sle11sp1-2010-03-29.orig/arch/x86/xen/xen-head.S    2010-03-29 09:00:35.000000000 +0200
1301 +++ sle11sp1-2010-03-29/arch/x86/xen/xen-head.S 2009-11-06 10:51:07.000000000 +0100
1302 @@ -1,7 +1,7 @@
1303  /* Xen-specific pieces of head.S, intended to be included in the right
1304         place in head.S */
1305  
1306 -#ifdef CONFIG_XEN
1307 +#ifdef CONFIG_PARAVIRT_XEN
1308  
1309  #include <linux/elfnote.h>
1310  #include <linux/init.h>
1311 @@ -52,4 +52,4 @@ ENTRY(hypercall_page)
1312         ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW,   _ASM_PTR __HYPERVISOR_VIRT_START)
1313         ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   _ASM_PTR 0)
1314  
1315 -#endif /*CONFIG_XEN */
1316 +#endif /* CONFIG_PARAVIRT_XEN */
1317 --- sle11sp1-2010-03-29.orig/arch/x86/ia32/ia32entry-xen.S      2009-11-06 10:49:47.000000000 +0100
1318 +++ sle11sp1-2010-03-29/arch/x86/ia32/ia32entry-xen.S   2009-11-06 10:51:07.000000000 +0100
1319 @@ -105,7 +105,7 @@ ENTRY(ia32_sysenter_target)
1320         movl    $VSYSCALL32_SYSEXIT,8(%rsp)
1321         movq    %rax,(%rsp)
1322         cld
1323 -       SAVE_ARGS 0,0,0
1324 +       SAVE_ARGS 0,0,1
1325         /* no need to do an access_ok check here because rbp has been
1326            32bit zero extended */ 
1327  1:     movl    (%rbp),%r9d
1328 @@ -244,7 +244,7 @@ ia32_badarg:
1329   */                            
1330  
1331  ENTRY(ia32_syscall)
1332 -       CFI_STARTPROC   simple
1333 +       CFI_STARTPROC32 simple
1334         CFI_SIGNAL_FRAME
1335         CFI_DEF_CFA     rsp,SS+8-RIP+16
1336         /*CFI_REL_OFFSET        ss,SS-RIP+16*/
1337 @@ -280,6 +280,7 @@ ia32_sysret:
1338  
1339  ia32_tracesys:                  
1340         SAVE_REST
1341 +       CLEAR_RREGS
1342         movq $-ENOSYS,RAX(%rsp) /* really needed? */
1343         movq %rsp,%rdi        /* &pt_regs -> arg1 */
1344         call syscall_trace_enter
1345 @@ -476,7 +477,7 @@ ia32_sys_call_table:
1346         .quad sys_init_module
1347         .quad sys_delete_module
1348         .quad quiet_ni_syscall          /* 130  get_kernel_syms */
1349 -       .quad sys_quotactl
1350 +       .quad sys32_quotactl
1351         .quad sys_getpgid
1352         .quad sys_fchdir
1353         .quad quiet_ni_syscall  /* bdflush */
1354 @@ -669,4 +670,5 @@ ia32_sys_call_table:
1355         .quad compat_sys_signalfd
1356         .quad compat_sys_timerfd
1357         .quad sys_eventfd
1358 +       .quad sys32_fallocate
1359  ia32_syscall_end:
1360 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/acpi/sleep_64-xen.c        2009-11-06 10:49:47.000000000 +0100
1361 +++ sle11sp1-2010-03-29/arch/x86/kernel/acpi/sleep_64-xen.c     2009-11-06 10:51:07.000000000 +0100
1362 @@ -51,12 +51,10 @@
1363                                Low-Level Sleep Support
1364     -------------------------------------------------------------------------- */
1365  
1366 -#ifdef CONFIG_ACPI_SLEEP
1367 -
1368  #ifndef CONFIG_ACPI_PV_SLEEP
1369  /* address in low memory of the wakeup routine. */
1370  unsigned long acpi_wakeup_address = 0;
1371 -unsigned long acpi_video_flags;
1372 +unsigned long acpi_realmode_flags;
1373  extern char wakeup_start, wakeup_end;
1374  
1375  extern unsigned long acpi_copy_wakeup_routine(unsigned long);
1376 @@ -109,9 +107,11 @@ static int __init acpi_sleep_setup(char 
1377  {
1378         while ((str != NULL) && (*str != '\0')) {
1379                 if (strncmp(str, "s3_bios", 7) == 0)
1380 -                       acpi_video_flags = 1;
1381 +                       acpi_realmode_flags |= 1;
1382                 if (strncmp(str, "s3_mode", 7) == 0)
1383 -                       acpi_video_flags |= 2;
1384 +                       acpi_realmode_flags |= 2;
1385 +               if (strncmp(str, "s3_beep", 7) == 0)
1386 +                       acpi_realmode_flags |= 4;
1387                 str = strchr(str, ',');
1388                 if (str != NULL)
1389                         str += strspn(str, ", \t");
1390 @@ -123,8 +123,6 @@ static int __init acpi_sleep_setup(char 
1391  __setup("acpi_sleep=", acpi_sleep_setup);
1392  #endif                         /* CONFIG_ACPI_PV_SLEEP */
1393  
1394 -#endif                         /*CONFIG_ACPI_SLEEP */
1395 -
1396  void acpi_pci_link_exit(void)
1397  {
1398  }
1399 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/apic_64-xen.c      2009-11-06 10:49:47.000000000 +0100
1400 +++ sle11sp1-2010-03-29/arch/x86/kernel/apic_64-xen.c   2009-11-06 10:51:07.000000000 +0100
1401 @@ -50,7 +50,7 @@ void ack_bad_irq(unsigned int irq)
1402          * holds up an irq slot - in excessive cases (when multiple
1403          * unexpected vectors occur) that might lock up the APIC
1404          * completely.
1405 -        * But don't ack when the APIC is disabled. -AK
1406 +        * But don't ack when the APIC is disabled. -AK
1407          */
1408         if (!disable_apic)
1409                 ack_APIC_irq();
1410 @@ -132,20 +132,6 @@ asmlinkage void smp_spurious_interrupt(v
1411         if (v & (1 << (SPURIOUS_APIC_VECTOR & 0x1f)))
1412                 ack_APIC_irq();
1413  
1414 -#if 0
1415 -       static unsigned long last_warning; 
1416 -       static unsigned long skipped; 
1417 -
1418 -       /* see sw-dev-man vol 3, chapter 7.4.13.5 */
1419 -       if (time_before(last_warning+30*HZ,jiffies)) { 
1420 -               printk(KERN_INFO "spurious APIC interrupt on CPU#%d, %ld skipped.\n",
1421 -                      smp_processor_id(), skipped);
1422 -               last_warning = jiffies; 
1423 -               skipped = 0;
1424 -       } else { 
1425 -               skipped++; 
1426 -       } 
1427 -#endif 
1428         irq_exit();
1429  }
1430  
1431 @@ -177,7 +163,7 @@ asmlinkage void smp_error_interrupt(void
1432            7: Illegal register address
1433         */
1434         printk (KERN_DEBUG "APIC error on CPU%d: %02x(%02x)\n",
1435 -               smp_processor_id(), v , v1);
1436 +               smp_processor_id(), v , v1);
1437         irq_exit();
1438  }
1439  
1440 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/e820_64-xen.c      2009-12-04 10:57:54.000000000 +0100
1441 +++ sle11sp1-2010-03-29/arch/x86/kernel/e820_64-xen.c   2009-12-04 11:00:18.000000000 +0100
1442 @@ -224,37 +224,6 @@ unsigned long __init e820_end_of_ram(voi
1443  }
1444  
1445  /*
1446 - * Find the hole size in the range.
1447 - */
1448 -unsigned long __init e820_hole_size(unsigned long start, unsigned long end)
1449 -{
1450 -       unsigned long ram = 0;
1451 -       int i;
1452 -
1453 -       for (i = 0; i < e820.nr_map; i++) {
1454 -               struct e820entry *ei = &e820.map[i];
1455 -               unsigned long last, addr;
1456 -
1457 -               if (ei->type != E820_RAM ||
1458 -                   ei->addr+ei->size <= start ||
1459 -                   ei->addr >= end)
1460 -                       continue;
1461 -
1462 -               addr = round_up(ei->addr, PAGE_SIZE);
1463 -               if (addr < start)
1464 -                       addr = start;
1465 -
1466 -               last = round_down(ei->addr + ei->size, PAGE_SIZE);
1467 -               if (last >= end)
1468 -                       last = end;
1469 -
1470 -               if (last > addr)
1471 -                       ram += last - addr;
1472 -       }
1473 -       return ((end - start) - ram);
1474 -}
1475 -
1476 -/*
1477   * Mark e820 reserved areas as busy for the resource manager.
1478   */
1479  void __init e820_reserve_resources(struct e820entry *e820, int nr_map)
1480 @@ -327,54 +296,66 @@ void __init e820_mark_nosave_regions(voi
1481  }
1482  #endif
1483  
1484 +/*
1485 + * Finds an active region in the address range from start_pfn to end_pfn and
1486 + * returns its range in ei_startpfn and ei_endpfn for the e820 entry.
1487 + */
1488 +static int __init e820_find_active_region(const struct e820entry *ei,
1489 +                                         unsigned long start_pfn,
1490 +                                         unsigned long end_pfn,
1491 +                                         unsigned long *ei_startpfn,
1492 +                                         unsigned long *ei_endpfn)
1493 +{
1494 +#ifdef CONFIG_XEN
1495 +       if (end_pfn > xen_start_info->nr_pages)
1496 +               end_pfn = xen_start_info->nr_pages;
1497 +#endif
1498 +
1499 +       *ei_startpfn = round_up(ei->addr, PAGE_SIZE) >> PAGE_SHIFT;
1500 +       *ei_endpfn = round_down(ei->addr + ei->size, PAGE_SIZE) >> PAGE_SHIFT;
1501 +
1502 +       /* Skip map entries smaller than a page */
1503 +       if (*ei_startpfn >= *ei_endpfn)
1504 +               return 0;
1505 +
1506 +       /* Check if end_pfn_map should be updated */
1507 +       if (ei->type != E820_RAM && *ei_endpfn > end_pfn_map)
1508 +               end_pfn_map = *ei_endpfn;
1509 +
1510 +       /* Skip if map is outside the node */
1511 +       if (ei->type != E820_RAM || *ei_endpfn <= start_pfn ||
1512 +                                   *ei_startpfn >= end_pfn)
1513 +               return 0;
1514 +
1515 +       /* Check for overlaps */
1516 +       if (*ei_startpfn < start_pfn)
1517 +               *ei_startpfn = start_pfn;
1518 +       if (*ei_endpfn > end_pfn)
1519 +               *ei_endpfn = end_pfn;
1520 +
1521 +       /* Obey end_user_pfn to save on memmap */
1522 +       if (*ei_startpfn >= end_user_pfn)
1523 +               return 0;
1524 +       if (*ei_endpfn > end_user_pfn)
1525 +               *ei_endpfn = end_user_pfn;
1526 +
1527 +       return 1;
1528 +}
1529 +
1530  /* Walk the e820 map and register active regions within a node */
1531  void __init
1532  e820_register_active_regions(int nid, unsigned long start_pfn,
1533                                                         unsigned long end_pfn)
1534  {
1535 +       unsigned long ei_startpfn;
1536 +       unsigned long ei_endpfn;
1537         int i;
1538 -       unsigned long ei_startpfn, ei_endpfn;
1539 -       for (i = 0; i < e820.nr_map; i++) {
1540 -               struct e820entry *ei = &e820.map[i];
1541 -               ei_startpfn = round_up(ei->addr, PAGE_SIZE) >> PAGE_SHIFT;
1542 -               ei_endpfn = round_down(ei->addr + ei->size, PAGE_SIZE)
1543 -                                                               >> PAGE_SHIFT;
1544 -
1545 -               /* Skip map entries smaller than a page */
1546 -               if (ei_startpfn >= ei_endpfn)
1547 -                       continue;
1548 -
1549 -               /* Check if end_pfn_map should be updated */
1550 -               if (ei->type != E820_RAM && ei_endpfn > end_pfn_map)
1551 -                       end_pfn_map = ei_endpfn;
1552 -
1553 -               /* Skip if map is outside the node */
1554 -               if (ei->type != E820_RAM ||
1555 -                               ei_endpfn <= start_pfn ||
1556 -                               ei_startpfn >= end_pfn)
1557 -                       continue;
1558 -
1559 -               /* Check for overlaps */
1560 -               if (ei_startpfn < start_pfn)
1561 -                       ei_startpfn = start_pfn;
1562 -               if (ei_endpfn > end_pfn)
1563 -                       ei_endpfn = end_pfn;
1564 -
1565 -               /* Obey end_user_pfn to save on memmap */
1566 -               if (ei_startpfn >= end_user_pfn)
1567 -                       continue;
1568 -               if (ei_endpfn > end_user_pfn)
1569 -                       ei_endpfn = end_user_pfn;
1570 -
1571 -#ifdef CONFIG_XEN
1572 -               if (ei_startpfn >= xen_start_info->nr_pages)
1573 -                       continue;
1574 -               if (ei_endpfn > xen_start_info->nr_pages)
1575 -                       ei_endpfn = xen_start_info->nr_pages;
1576 -#endif
1577  
1578 -               add_active_range(nid, ei_startpfn, ei_endpfn);
1579 -       }
1580 +       for (i = 0; i < e820.nr_map; i++)
1581 +               if (e820_find_active_region(&e820.map[i],
1582 +                                           start_pfn, end_pfn,
1583 +                                           &ei_startpfn, &ei_endpfn))
1584 +                       add_active_range(nid, ei_startpfn, ei_endpfn);
1585  #ifdef CONFIG_XEN
1586         BUG_ON(nid);
1587         add_active_range(nid, end_pfn, end_pfn);
1588 @@ -399,12 +380,35 @@ void __init add_memory_region(unsigned l
1589         e820.nr_map++;
1590  }
1591  
1592 +/*
1593 + * Find the hole size (in bytes) in the memory range.
1594 + * @start: starting address of the memory range to scan
1595 + * @end: ending address of the memory range to scan
1596 + */
1597 +unsigned long __init e820_hole_size(unsigned long start, unsigned long end)
1598 +{
1599 +       unsigned long start_pfn = start >> PAGE_SHIFT;
1600 +       unsigned long end_pfn = end >> PAGE_SHIFT;
1601 +       unsigned long ei_startpfn;
1602 +       unsigned long ei_endpfn;
1603 +       unsigned long ram = 0;
1604 +       int i;
1605 +
1606 +       for (i = 0; i < e820.nr_map; i++) {
1607 +               if (e820_find_active_region(&e820.map[i],
1608 +                                           start_pfn, end_pfn,
1609 +                                           &ei_startpfn, &ei_endpfn))
1610 +                       ram += ei_endpfn - ei_startpfn;
1611 +       }
1612 +       return end - start - (ram << PAGE_SHIFT);
1613 +}
1614 +
1615  void __init e820_print_map(char *who)
1616  {
1617         int i;
1618  
1619         for (i = 0; i < e820.nr_map; i++) {
1620 -               printk(" %s: %016Lx - %016Lx ", who,
1621 +               printk(KERN_INFO " %s: %016Lx - %016Lx ", who,
1622                         (unsigned long long) e820.map[i].addr,
1623                         (unsigned long long) (e820.map[i].addr + e820.map[i].size));
1624                 switch (e820.map[i].type) {
1625 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/early_printk-xen.c 2009-11-06 10:49:47.000000000 +0100
1626 +++ sle11sp1-2010-03-29/arch/x86/kernel/early_printk-xen.c      2009-11-06 10:51:07.000000000 +0100
1627 @@ -174,6 +174,7 @@ static __init void early_serial_init(cha
1628   * mappings. Someone should fix this for domain 0. For now, use fake serial.
1629   */
1630  #define early_vga_console early_serial_console
1631 +#define xenboot_console early_serial_console
1632  
1633  #endif
1634  
1635 @@ -261,20 +262,22 @@ static int __init setup_early_printk(cha
1636         } else if (!strncmp(buf, "ttyS", 4)) {
1637                 early_serial_init(buf);
1638                 early_console = &early_serial_console;
1639 -       } else if (!strncmp(buf, "vga", 3)
1640 +       } else if (!strncmp(buf, "vga", 3)) {
1641  #ifndef CONFIG_XEN
1642                    && SCREEN_INFO.orig_video_isVGA == 1) {
1643                 max_xpos = SCREEN_INFO.orig_video_cols;
1644                 max_ypos = SCREEN_INFO.orig_video_lines;
1645                 current_ypos = SCREEN_INFO.orig_y;
1646 -#else
1647 -                  || !strncmp(buf, "xen", 3)) {
1648  #endif
1649                 early_console = &early_vga_console;
1650         } else if (!strncmp(buf, "simnow", 6)) {
1651                 simnow_init(buf + 6);
1652                 early_console = &simnow_console;
1653                 keep_early = 1;
1654 +#ifdef CONFIG_XEN
1655 +       } else if (!strncmp(buf, "xen", 3)) {
1656 +               early_console = &xenboot_console;
1657 +#endif
1658         }
1659  
1660         if (keep_early)
1661 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/entry_64-xen.S     2009-11-06 10:49:47.000000000 +0100
1662 +++ sle11sp1-2010-03-29/arch/x86/kernel/entry_64-xen.S  2009-11-06 10:51:07.000000000 +0100
1663 @@ -310,7 +310,7 @@ sysret_signal:
1664         TRACE_IRQS_ON
1665  /*     sti */
1666          XEN_UNBLOCK_EVENTS(%rsi)        
1667 -       testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
1668 +       testl $(_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx
1669         jz    1f
1670  
1671         /* Really a signal */
1672 @@ -409,7 +409,7 @@ int_very_careful:
1673         jmp int_restore_rest
1674         
1675  int_signal:
1676 -       testl $(_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_SINGLESTEP),%edx
1677 +       testl $(_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx
1678         jz 1f
1679         movq %rsp,%rdi          # &ptregs -> arg1
1680         xorl %esi,%esi          # oldset -> arg2
1681 @@ -552,7 +552,7 @@ retint_careful:
1682         jmp retint_check
1683         
1684  retint_signal:
1685 -       testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
1686 +       testl $(_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY),%edx
1687         jz    retint_restore_args
1688         TRACE_IRQS_ON
1689          XEN_UNBLOCK_EVENTS(%rsi)
1690 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/head_64-xen.S      2009-11-06 10:49:47.000000000 +0100
1691 +++ sle11sp1-2010-03-29/arch/x86/kernel/head_64-xen.S   2009-11-06 10:51:07.000000000 +0100
1692 @@ -23,7 +23,7 @@
1693  #include <asm/dwarf2.h>
1694  #include <xen/interface/elfnote.h>
1695  
1696 -       .section .bootstrap.text, "ax", @progbits
1697 +       .section .text.head, "ax", @progbits
1698         .code64
1699         .globl startup_64
1700  startup_64:
1701 @@ -39,7 +39,7 @@ startup_64:
1702  
1703  #define NEXT_PAGE(name) \
1704         .balign PAGE_SIZE; \
1705 -       phys_##name = . - .bootstrap.text; \
1706 +       phys_##name = . - .text.head; \
1707  ENTRY(name)
1708  
1709  NEXT_PAGE(init_level4_pgt)
1710 @@ -63,6 +63,12 @@ NEXT_PAGE(level3_kernel_pgt)
1711  NEXT_PAGE(level3_user_pgt)
1712          .fill  512,8,0
1713  
1714 +NEXT_PAGE(level2_fixmap_pgt)
1715 +       .fill   512,8,0
1716 +
1717 +NEXT_PAGE(level1_fixmap_pgt)
1718 +       .fill   512,8,0
1719 +
1720  NEXT_PAGE(hypercall_page)
1721         CFI_STARTPROC
1722         .rept 0x1000 / 0x20
1723 @@ -169,18 +175,18 @@ ENTRY(empty_zero_page)
1724         .byte   0
1725  #endif /* CONFIG_XEN_COMPAT <= 0x030002 */
1726         
1727 -       ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz, "linux")
1728 -       ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz, "2.6")
1729 -       ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz, "xen-3.0")
1730 -       ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      .quad,  __START_KERNEL_map)
1731 +       ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz "linux")
1732 +       ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz "2.6")
1733 +       ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz "xen-3.0")
1734 +       ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      .quad __START_KERNEL_map)
1735  #if CONFIG_XEN_COMPAT <= 0x030002
1736 -       ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .quad,  __START_KERNEL_map)
1737 +       ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .quad __START_KERNEL_map)
1738  #else
1739 -       ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .quad,  0)
1740 +       ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .quad 0)
1741  #endif
1742 -       ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .quad,  startup_64)
1743 -       ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad,  hypercall_page)
1744 -       ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad,  _PAGE_PRESENT,_PAGE_PRESENT)
1745 -       ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
1746 -       ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
1747 -       ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long,  1)
1748 +       ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .quad startup_64)
1749 +       ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad hypercall_page)
1750 +       ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad _PAGE_PRESENT, _PAGE_PRESENT)
1751 +       ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
1752 +       ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
1753 +       ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1)
1754 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/head64-xen.c       2009-11-06 10:49:47.000000000 +0100
1755 +++ sle11sp1-2010-03-29/arch/x86/kernel/head64-xen.c    2009-11-06 10:51:07.000000000 +0100
1756 @@ -90,7 +90,7 @@ void __init x86_64_start_kernel(char * r
1757         unsigned long machine_to_phys_nr_ents;
1758         int i;
1759  
1760 -       setup_xen_features();
1761 +       xen_setup_features();
1762  
1763         xen_start_info = (struct start_info *)real_mode_data;
1764         if (!xen_feature(XENFEAT_auto_translated_physmap))
1765 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/io_apic_64-xen.c   2009-11-06 10:49:47.000000000 +0100
1766 +++ sle11sp1-2010-03-29/arch/x86/kernel/io_apic_64-xen.c        2009-11-06 10:51:07.000000000 +0100
1767 @@ -165,7 +165,9 @@ static inline void io_apic_write(unsigne
1768  #endif
1769  }
1770  
1771 -#ifndef CONFIG_XEN
1772 +#ifdef CONFIG_XEN
1773 +#define io_apic_modify io_apic_write
1774 +#else
1775  /*
1776   * Re-write a value: to be used for read-modify-write
1777   * cycles where the read already set up the index register.
1778 @@ -175,8 +177,32 @@ static inline void io_apic_modify(unsign
1779         struct io_apic __iomem *io_apic = io_apic_base(apic);
1780         writel(value, &io_apic->data);
1781  }
1782 -#else
1783 -#define io_apic_modify io_apic_write
1784 +
1785 +static int io_apic_level_ack_pending(unsigned int irq)
1786 +{
1787 +       struct irq_pin_list *entry;
1788 +       unsigned long flags;
1789 +       int pending = 0;
1790 +
1791 +       spin_lock_irqsave(&ioapic_lock, flags);
1792 +       entry = irq_2_pin + irq;
1793 +       for (;;) {
1794 +               unsigned int reg;
1795 +               int pin;
1796 +
1797 +               pin = entry->pin;
1798 +               if (pin == -1)
1799 +                       break;
1800 +               reg = io_apic_read(entry->apic, 0x10 + pin*2);
1801 +               /* Is the remote IRR bit set? */
1802 +               pending |= (reg >> 14) & 1;
1803 +               if (!entry->next)
1804 +                       break;
1805 +               entry = irq_2_pin + entry->next;
1806 +       }
1807 +       spin_unlock_irqrestore(&ioapic_lock, flags);
1808 +       return pending;
1809 +}
1810  #endif
1811  
1812  /*
1813 @@ -406,14 +432,12 @@ static void clear_IO_APIC (void)
1814  int skip_ioapic_setup;
1815  int ioapic_force;
1816  
1817 -/* dummy parsing: see setup.c */
1818 -
1819 -static int __init disable_ioapic_setup(char *str)
1820 +static int __init parse_noapic(char *str)
1821  {
1822 -       skip_ioapic_setup = 1;
1823 +       disable_ioapic_setup();
1824         return 0;
1825  }
1826 -early_param("noapic", disable_ioapic_setup);
1827 +early_param("noapic", parse_noapic);
1828  
1829  /* Actually the next is obsolete, but keep it for paranoid reasons -AK */
1830  static int __init disable_timer_pin_setup(char *arg)
1831 @@ -765,12 +789,15 @@ static struct irq_chip ioapic_chip;
1832  
1833  static void ioapic_register_intr(int irq, unsigned long trigger)
1834  {
1835 -       if (trigger)
1836 +       if (trigger) {
1837 +               irq_desc[irq].status |= IRQ_LEVEL;
1838                 set_irq_chip_and_handler_name(irq, &ioapic_chip,
1839                                               handle_fasteoi_irq, "fasteoi");
1840 -       else
1841 +       } else {
1842 +               irq_desc[irq].status &= ~IRQ_LEVEL;
1843                 set_irq_chip_and_handler_name(irq, &ioapic_chip,
1844                                               handle_edge_irq, "edge");
1845 +       }
1846  }
1847  #else
1848  #define ioapic_register_intr(irq, trigger) evtchn_register_pirq(irq)
1849 @@ -1419,9 +1446,37 @@ static void ack_apic_level(unsigned int 
1850         ack_APIC_irq();
1851  
1852         /* Now we can move and renable the irq */
1853 -       move_masked_irq(irq);
1854 -       if (unlikely(do_unmask_irq))
1855 +       if (unlikely(do_unmask_irq)) {
1856 +               /* Only migrate the irq if the ack has been received.
1857 +                *
1858 +                * On rare occasions the broadcast level triggered ack gets
1859 +                * delayed going to ioapics, and if we reprogram the
1860 +                * vector while Remote IRR is still set the irq will never
1861 +                * fire again.
1862 +                *
1863 +                * To prevent this scenario we read the Remote IRR bit
1864 +                * of the ioapic.  This has two effects.
1865 +                * - On any sane system the read of the ioapic will
1866 +                *   flush writes (and acks) going to the ioapic from
1867 +                *   this cpu.
1868 +                * - We get to see if the ACK has actually been delivered.
1869 +                *
1870 +                * Based on failed experiments of reprogramming the
1871 +                * ioapic entry from outside of irq context starting
1872 +                * with masking the ioapic entry and then polling until
1873 +                * Remote IRR was clear before reprogramming the
1874 +                * ioapic I don't trust the Remote IRR bit to be
1875 +                * completey accurate.
1876 +                *
1877 +                * However there appears to be no other way to plug
1878 +                * this race, so if the Remote IRR bit is not
1879 +                * accurate and is causing problems then it is a hardware bug
1880 +                * and you can go talk to the chipset vendor about it.
1881 +                */
1882 +               if (!io_apic_level_ack_pending(irq))
1883 +                       move_masked_irq(irq);
1884                 unmask_IO_APIC_irq(irq);
1885 +       }
1886  }
1887  
1888  static struct irq_chip ioapic_chip __read_mostly = {
1889 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/ldt_64-xen.c       2009-11-06 10:49:47.000000000 +0100
1890 +++ sle11sp1-2010-03-29/arch/x86/kernel/ldt_64-xen.c    2009-11-06 10:51:07.000000000 +0100
1891 @@ -114,6 +114,8 @@ int init_new_context(struct task_struct 
1892         memset(&mm->context, 0, sizeof(mm->context));
1893         init_MUTEX(&mm->context.sem);
1894         old_mm = current->mm;
1895 +       if (old_mm)
1896 +               mm->context.vdso = old_mm->context.vdso;
1897         if (old_mm && old_mm->context.size > 0) {
1898                 down(&old_mm->context.sem);
1899                 retval = copy_ldt(&mm->context, &old_mm->context);
1900 @@ -146,7 +148,7 @@ void destroy_context(struct mm_struct *m
1901                         kfree(mm->context.ldt);
1902                 mm->context.size = 0;
1903         }
1904 -       if (!mm->context.pinned) {
1905 +       if (!PagePinned(virt_to_page(mm->pgd))) {
1906                 spin_lock(&mm_unpinned_lock);
1907                 list_del(&mm->context.unpinned);
1908                 spin_unlock(&mm_unpinned_lock);
1909 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/mpparse_64-xen.c   2009-11-06 10:49:47.000000000 +0100
1910 +++ sle11sp1-2010-03-29/arch/x86/kernel/mpparse_64-xen.c        2009-11-06 10:51:07.000000000 +0100
1911 @@ -32,7 +32,6 @@
1912  
1913  /* Have we found an MP table */
1914  int smp_found_config;
1915 -unsigned int __initdata maxcpus = NR_CPUS;
1916  
1917  /*
1918   * Various Linux-internal data structures created from the
1919 @@ -657,6 +656,20 @@ static int mp_find_ioapic(int gsi)
1920         return -1;
1921  }
1922  
1923 +static u8 uniq_ioapic_id(u8 id)
1924 +{
1925 +       int i;
1926 +       DECLARE_BITMAP(used, 256);
1927 +       bitmap_zero(used, 256);
1928 +       for (i = 0; i < nr_ioapics; i++) {
1929 +               struct mpc_config_ioapic *ia = &mp_ioapics[i];
1930 +               __set_bit(ia->mpc_apicid, used);
1931 +       }
1932 +       if (!test_bit(id, used))
1933 +               return id;
1934 +       return find_first_zero_bit(used, 256);
1935 +}
1936 +
1937  void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base)
1938  {
1939         int idx = 0;
1940 @@ -664,7 +677,7 @@ void __init mp_register_ioapic(u8 id, u3
1941         if (bad_ioapic(address))
1942                 return;
1943  
1944 -       idx = nr_ioapics++;
1945 +       idx = nr_ioapics;
1946  
1947         mp_ioapics[idx].mpc_type = MP_IOAPIC;
1948         mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE;
1949 @@ -673,7 +686,7 @@ void __init mp_register_ioapic(u8 id, u3
1950  #ifndef CONFIG_XEN
1951         set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
1952  #endif
1953 -       mp_ioapics[idx].mpc_apicid = id;
1954 +       mp_ioapics[idx].mpc_apicid = uniq_ioapic_id(id);
1955         mp_ioapics[idx].mpc_apicver = 0;
1956         
1957         /* 
1958 @@ -690,6 +703,8 @@ void __init mp_register_ioapic(u8 id, u3
1959                 mp_ioapics[idx].mpc_apicaddr,
1960                 mp_ioapic_routing[idx].gsi_start,
1961                 mp_ioapic_routing[idx].gsi_end);
1962 +
1963 +       nr_ioapics++;
1964  }
1965  
1966  void __init
1967 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/process_64-xen.c   2009-11-06 10:49:47.000000000 +0100
1968 +++ sle11sp1-2010-03-29/arch/x86/kernel/process_64-xen.c        2009-11-06 10:51:07.000000000 +0100
1969 @@ -26,6 +26,7 @@
1970  #include <linux/sched.h>
1971  #include <linux/kernel.h>
1972  #include <linux/mm.h>
1973 +#include <linux/fs.h>
1974  #include <linux/elfcore.h>
1975  #include <linux/smp.h>
1976  #include <linux/slab.h>
1977 @@ -249,6 +250,7 @@ early_param("idle", idle_setup);
1978  void __show_regs(struct pt_regs * regs)
1979  {
1980         unsigned long fs, gs, shadowgs;
1981 +       unsigned long d0, d1, d2, d3, d6, d7;
1982         unsigned int fsindex,gsindex;
1983         unsigned int ds,cs,es; 
1984  
1985 @@ -288,6 +290,14 @@ void __show_regs(struct pt_regs * regs)
1986                fs,fsindex,gs,gsindex,shadowgs); 
1987         printk("CS:  %04x DS: %04x ES: %04x\n", cs, ds, es); 
1988  
1989 +       get_debugreg(d0, 0);
1990 +       get_debugreg(d1, 1);
1991 +       get_debugreg(d2, 2);
1992 +       printk("DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2);
1993 +       get_debugreg(d3, 3);
1994 +       get_debugreg(d6, 6);
1995 +       get_debugreg(d7, 7);
1996 +       printk("DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7);
1997  }
1998  
1999  void show_regs(struct pt_regs *regs)
2000 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/setup_64-xen.c     2009-11-06 10:49:47.000000000 +0100
2001 +++ sle11sp1-2010-03-29/arch/x86/kernel/setup_64-xen.c  2009-11-06 10:51:07.000000000 +0100
2002 @@ -828,6 +828,8 @@ static void __cpuinit init_amd(struct cp
2003         level = cpuid_eax(1);
2004         if (c->x86 == 15 && ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58))
2005                 set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability);
2006 +       if (c->x86 == 0x10)
2007 +               set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability);
2008  
2009         /* Enable workaround for FXSAVE leak */
2010         if (c->x86 >= 6)
2011 @@ -853,8 +855,14 @@ static void __cpuinit init_amd(struct cp
2012         if (c->extended_cpuid_level >= 0x80000008)
2013                 amd_detect_cmp(c);
2014  
2015 -       /* Fix cpuid4 emulation for more */
2016 -       num_cache_leaves = 3;
2017 +       if (c->extended_cpuid_level >= 0x80000006 &&
2018 +               (cpuid_edx(0x80000006) & 0xf000))
2019 +               num_cache_leaves = 4;
2020 +       else
2021 +               num_cache_leaves = 3;
2022 +
2023 +       if (c->x86 == 0xf || c->x86 == 0x10 || c->x86 == 0x11)
2024 +               set_bit(X86_FEATURE_K8, &c->x86_capability);
2025  
2026         /* RDTSC can be speculated around */
2027         clear_bit(X86_FEATURE_SYNC_RDTSC, &c->x86_capability);
2028 @@ -1099,6 +1107,8 @@ void __cpuinit identify_cpu(struct cpuin
2029                         c->x86_capability[2] = cpuid_edx(0x80860001);
2030         }
2031  
2032 +       init_scattered_cpuid_features(c);
2033 +
2034  #ifndef CONFIG_XEN
2035         c->apicid = phys_pkg_id(0);
2036  #endif
2037 @@ -1186,7 +1196,7 @@ static int show_cpuinfo(struct seq_file 
2038                 "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
2039                 "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
2040                 "pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx",
2041 -               "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", NULL,
2042 +               "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", "pbe",
2043  
2044                 /* AMD-defined */
2045                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2046 @@ -1202,10 +1212,11 @@ static int show_cpuinfo(struct seq_file 
2047                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2048  
2049                 /* Other (Linux-defined) */
2050 -               "cxmmx", NULL, "cyrix_arr", "centaur_mcr", NULL,
2051 -               "constant_tsc", NULL, NULL,
2052 -               "up", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2053 -               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2054 +               "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr",
2055 +               NULL, NULL, NULL, NULL,
2056 +               "constant_tsc", "up", NULL, "arch_perfmon",
2057 +               "pebs", "bts", NULL, "sync_rdtsc",
2058 +               "rep_good", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2059                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2060  
2061                 /* Intel-defined (#2) */
2062 @@ -1216,7 +1227,7 @@ static int show_cpuinfo(struct seq_file 
2063  
2064                 /* VIA/Cyrix/Centaur-defined */
2065                 NULL, NULL, "rng", "rng_en", NULL, NULL, "ace", "ace_en",
2066 -               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2067 +               "ace2", "ace2_en", "phe", "phe_en", "pmm", "pmm_en", NULL, NULL,
2068                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2069                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2070  
2071 @@ -1227,6 +1238,12 @@ static int show_cpuinfo(struct seq_file 
2072                 "osvw", "ibs", NULL, NULL, NULL, NULL,
2073                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2074                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2075 +
2076 +               /* Auxiliary (Linux-defined) */
2077 +               "ida", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2078 +               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2079 +               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2080 +               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
2081         };
2082         static char *x86_power_flags[] = { 
2083                 "ts",   /* temperature sensor */
2084 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/setup64-xen.c      2009-11-06 10:49:47.000000000 +0100
2085 +++ sle11sp1-2010-03-29/arch/x86/kernel/setup64-xen.c   2009-11-06 10:51:07.000000000 +0100
2086 @@ -125,11 +125,14 @@ void __init setup_per_cpu_areas(void)
2087  } 
2088  
2089  #ifdef CONFIG_XEN
2090 -static void switch_pt(void)
2091 +static void __init_refok switch_pt(int cpu)
2092  {
2093 +       if (cpu == 0)
2094 +               xen_init_pt();
2095         xen_pt_switch(__pa_symbol(init_level4_pgt));
2096         xen_new_user_pt(__pa_symbol(__user_pgd(init_level4_pgt)));
2097  }
2098 +#define switch_pt() switch_pt(cpu)
2099  
2100  static void __cpuinit cpu_gdt_init(const struct desc_ptr *gdt_descr)
2101  {
2102 @@ -185,9 +188,6 @@ void pda_init(int cpu)
2103         pda->mmu_state = 0;
2104  
2105         if (cpu == 0) {
2106 -#ifdef CONFIG_XEN
2107 -               xen_init_pt();
2108 -#endif
2109                 /* others are initialized in smpboot.c */
2110                 pda->pcurrent = &init_task;
2111                 pda->irqstackptr = boot_cpu_stack; 
2112 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/smp_64-xen.c       2009-11-06 10:49:47.000000000 +0100
2113 +++ sle11sp1-2010-03-29/arch/x86/kernel/smp_64-xen.c    2009-11-06 10:51:07.000000000 +0100
2114 @@ -362,7 +362,7 @@ __smp_call_function_single(int cpu, void
2115  }
2116  
2117  /*
2118 - * smp_call_function_single - Run a function on another CPU
2119 + * smp_call_function_single - Run a function on a specific CPU
2120   * @func: The function to run. This must be fast and non-blocking.
2121   * @info: An arbitrary pointer to pass to the function.
2122   * @nonatomic: Currently unused.
2123 @@ -379,17 +379,21 @@ int smp_call_function_single (int cpu, v
2124  {
2125         /* prevent preemption and reschedule on another processor */
2126         int me = get_cpu();
2127 +
2128 +       /* Can deadlock when called with interrupts disabled */
2129 +       WARN_ON(irqs_disabled());
2130 +
2131         if (cpu == me) {
2132 +               local_irq_disable();
2133 +               func(info);
2134 +               local_irq_enable();
2135                 put_cpu();
2136                 return 0;
2137         }
2138  
2139 -       /* Can deadlock when called with interrupts disabled */
2140 -       WARN_ON(irqs_disabled());
2141 -
2142 -       spin_lock_bh(&call_lock);
2143 +       spin_lock(&call_lock);
2144         __smp_call_function_single(cpu, func, info, nonatomic, wait);
2145 -       spin_unlock_bh(&call_lock);
2146 +       spin_unlock(&call_lock);
2147         put_cpu();
2148         return 0;
2149  }
2150 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/traps_64-xen.c     2009-11-06 10:49:47.000000000 +0100
2151 +++ sle11sp1-2010-03-29/arch/x86/kernel/traps_64-xen.c  2009-11-06 10:51:07.000000000 +0100
2152 @@ -34,6 +34,10 @@
2153  #include <linux/bug.h>
2154  #include <linux/kdebug.h>
2155  
2156 +#if defined(CONFIG_EDAC)
2157 +#include <linux/edac.h>
2158 +#endif
2159 +
2160  #include <asm/system.h>
2161  #include <asm/io.h>
2162  #include <asm/atomic.h>
2163 @@ -332,6 +336,7 @@ static int print_trace_stack(void *data,
2164  
2165  static void print_trace_address(void *data, unsigned long addr)
2166  {
2167 +       touch_nmi_watchdog();
2168         printk_address(addr);
2169  }
2170  
2171 @@ -520,6 +525,7 @@ void __kprobes __die(const char * str, s
2172         printk("\n");
2173         notify_die(DIE_OOPS, str, regs, err, current->thread.trap_no, SIGSEGV);
2174         show_registers(regs);
2175 +       add_taint(TAINT_DIE);
2176         /* Executive summary in case the oops scrolled away */
2177         printk(KERN_ALERT "RIP ");
2178         printk_address(regs->rip); 
2179 @@ -533,7 +539,7 @@ void die(const char * str, struct pt_reg
2180         unsigned long flags = oops_begin();
2181  
2182         if (!user_mode(regs))
2183 -               report_bug(regs->rip);
2184 +               report_bug(regs->rip, regs);
2185  
2186         __die(str, regs, err);
2187         oops_end(flags);
2188 @@ -582,7 +588,8 @@ static void __kprobes do_trap(int trapnr
2189                 tsk->thread.error_code = error_code;
2190                 tsk->thread.trap_no = trapnr;
2191  
2192 -               if (exception_trace && unhandled_signal(tsk, signr))
2193 +               if (show_unhandled_signals && unhandled_signal(tsk, signr) &&
2194 +                   printk_ratelimit())
2195                         printk(KERN_INFO
2196                                "%s[%d] trap %s rip:%lx rsp:%lx error:%lx\n",
2197                                tsk->comm, tsk->pid, str,
2198 @@ -686,7 +693,8 @@ asmlinkage void __kprobes do_general_pro
2199                 tsk->thread.error_code = error_code;
2200                 tsk->thread.trap_no = 13;
2201  
2202 -               if (exception_trace && unhandled_signal(tsk, SIGSEGV))
2203 +               if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
2204 +                   printk_ratelimit())
2205                         printk(KERN_INFO
2206                        "%s[%d] general protection rip:%lx rsp:%lx error:%lx\n",
2207                                tsk->comm, tsk->pid,
2208 @@ -721,6 +729,13 @@ mem_parity_error(unsigned char reason, s
2209                 reason);
2210         printk(KERN_EMERG "You have some hardware problem, likely on the PCI bus.\n");
2211  
2212 +#if defined(CONFIG_EDAC)
2213 +       if(edac_handler_set()) {
2214 +               edac_atomic_assert_error();
2215 +               return;
2216 +       }
2217 +#endif
2218 +
2219         if (panic_on_unrecovered_nmi)
2220                 panic("NMI: Not continuing");
2221  
2222 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/vsyscall_64-xen.c  2009-11-06 10:49:47.000000000 +0100
2223 +++ sle11sp1-2010-03-29/arch/x86/kernel/vsyscall_64-xen.c       2009-11-06 10:51:07.000000000 +0100
2224 @@ -42,6 +42,7 @@
2225  #include <asm/segment.h>
2226  #include <asm/desc.h>
2227  #include <asm/topology.h>
2228 +#include <asm/vgtod.h>
2229  
2230  #define __vsyscall(nr) __attribute__ ((unused,__section__(".vsyscall_" #nr)))
2231  #define __syscall_clobber "r11","rcx","memory"
2232 @@ -57,26 +58,9 @@
2233   * - writen by timer interrupt or systcl (/proc/sys/kernel/vsyscall64)
2234   * Try to keep this structure as small as possible to avoid cache line ping pongs
2235   */
2236 -struct vsyscall_gtod_data_t {
2237 -       seqlock_t       lock;
2238 -
2239 -       /* open coded 'struct timespec' */
2240 -       time_t          wall_time_sec;
2241 -       u32             wall_time_nsec;
2242 -
2243 -       int             sysctl_enabled;
2244 -       struct timezone sys_tz;
2245 -       struct { /* extract of a clocksource struct */
2246 -               cycle_t (*vread)(void);
2247 -               cycle_t cycle_last;
2248 -               cycle_t mask;
2249 -               u32     mult;
2250 -               u32     shift;
2251 -       } clock;
2252 -};
2253  int __vgetcpu_mode __section_vgetcpu_mode;
2254  
2255 -struct vsyscall_gtod_data_t __vsyscall_gtod_data __section_vsyscall_gtod_data =
2256 +struct vsyscall_gtod_data __vsyscall_gtod_data __section_vsyscall_gtod_data =
2257  {
2258         .lock = SEQLOCK_UNLOCKED,
2259         .sysctl_enabled = 1,
2260 @@ -96,6 +80,8 @@ void update_vsyscall(struct timespec *wa
2261         vsyscall_gtod_data.wall_time_sec = wall_time->tv_sec;
2262         vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec;
2263         vsyscall_gtod_data.sys_tz = sys_tz;
2264 +       vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec;
2265 +       vsyscall_gtod_data.wall_to_monotonic = wall_to_monotonic;
2266         write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags);
2267  }
2268  
2269 --- sle11sp1-2010-03-29.orig/arch/x86/mm/fault_64-xen.c 2009-11-06 10:49:47.000000000 +0100
2270 +++ sle11sp1-2010-03-29/arch/x86/mm/fault_64-xen.c      2009-11-06 10:51:07.000000000 +0100
2271 @@ -159,7 +159,9 @@ void dump_pagetable(unsigned long addres
2272         pmd_t *pmd;
2273         pte_t *pte;
2274  
2275 -       pgd = __va(read_cr3() & PHYSICAL_PAGE_MASK);
2276 +       pgd = (pgd_t *)read_cr3();
2277 +
2278 +       pgd = __va((unsigned long)pgd & PHYSICAL_PAGE_MASK);
2279         pgd += pgd_index(address);
2280         if (bad_address(pgd)) goto bad;
2281         printk("PGD %lx ", pgd_val(*pgd));
2282 @@ -219,16 +221,6 @@ static int is_errata93(struct pt_regs *r
2283         return 0;
2284  } 
2285  
2286 -int unhandled_signal(struct task_struct *tsk, int sig)
2287 -{
2288 -       if (is_init(tsk))
2289 -               return 1;
2290 -       if (tsk->ptrace & PT_PTRACED)
2291 -               return 0;
2292 -       return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) ||
2293 -               (tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL);
2294 -}
2295 -
2296  static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs,
2297                                  unsigned long error_code)
2298  {
2299 @@ -302,8 +294,8 @@ static int vmalloc_fault(unsigned long a
2300         return 0;
2301  }
2302  
2303 -int page_fault_trace = 0;
2304 -int exception_trace = 1;
2305 +static int page_fault_trace;
2306 +int show_unhandled_signals = 1;
2307  
2308  
2309  #define MEM_VERBOSE 1
2310 @@ -372,7 +364,7 @@ asmlinkage void __kprobes do_page_fault(
2311         struct vm_area_struct * vma;
2312         unsigned long address;
2313         const struct exception_table_entry *fixup;
2314 -       int write;
2315 +       int write, fault;
2316         unsigned long flags;
2317         siginfo_t info;
2318  
2319 @@ -384,7 +376,7 @@ asmlinkage void __kprobes do_page_fault(
2320         prefetchw(&mm->mmap_sem);
2321  
2322         /* get the address */
2323 -       address = current_vcpu_info()->arch.cr2;
2324 +       address = read_cr2();
2325  
2326         info.si_code = SEGV_MAPERR;
2327  
2328 @@ -445,6 +437,13 @@ asmlinkage void __kprobes do_page_fault(
2329         if (unlikely(in_atomic() || !mm))
2330                 goto bad_area_nosemaphore;
2331  
2332 +       /*
2333 +        * User-mode registers count as a user access even for any
2334 +        * potential system fault or CPU buglet.
2335 +        */
2336 +       if (user_mode_vm(regs))
2337 +               error_code |= PF_USER;
2338 +
2339   again:
2340         /* When running in the kernel we expect faults to occur only to
2341          * addresses in user space.  All other faults represent errors in the
2342 @@ -511,19 +510,18 @@ good_area:
2343          * make sure we exit gracefully rather than endlessly redo
2344          * the fault.
2345          */
2346 -       switch (handle_mm_fault(mm, vma, address, write)) {
2347 -       case VM_FAULT_MINOR:
2348 -               tsk->min_flt++;
2349 -               break;
2350 -       case VM_FAULT_MAJOR:
2351 -               tsk->maj_flt++;
2352 -               break;
2353 -       case VM_FAULT_SIGBUS:
2354 -               goto do_sigbus;
2355 -       default:
2356 -               goto out_of_memory;
2357 +       fault = handle_mm_fault(mm, vma, address, write);
2358 +       if (unlikely(fault & VM_FAULT_ERROR)) {
2359 +               if (fault & VM_FAULT_OOM)
2360 +                       goto out_of_memory;
2361 +               else if (fault & VM_FAULT_SIGBUS)
2362 +                       goto do_sigbus;
2363 +               BUG();
2364         }
2365 -
2366 +       if (fault & VM_FAULT_MAJOR)
2367 +               tsk->maj_flt++;
2368 +       else
2369 +               tsk->min_flt++;
2370         up_read(&mm->mmap_sem);
2371         return;
2372  
2373 @@ -556,7 +554,8 @@ bad_area_nosemaphore:
2374                     (address >> 32))
2375                         return;
2376  
2377 -               if (exception_trace && unhandled_signal(tsk, SIGSEGV)) {
2378 +               if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
2379 +                   printk_ratelimit()) {
2380                         printk(
2381                        "%s%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
2382                                         tsk->pid > 1 ? KERN_INFO : KERN_EMERG,
2383 @@ -630,7 +629,7 @@ out_of_memory:
2384         }
2385         printk("VM: killing process %s\n", tsk->comm);
2386         if (error_code & 4)
2387 -               do_exit(SIGKILL);
2388 +               do_group_exit(SIGKILL);
2389         goto no_context;
2390  
2391  do_sigbus:
2392 --- sle11sp1-2010-03-29.orig/arch/x86/mm/init_64-xen.c  2009-11-06 10:49:47.000000000 +0100
2393 +++ sle11sp1-2010-03-29/arch/x86/mm/init_64-xen.c       2009-11-06 10:51:07.000000000 +0100
2394 @@ -66,6 +66,9 @@ int after_bootmem;
2395  DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
2396  extern unsigned long start_pfn;
2397  
2398 +extern pmd_t level2_fixmap_pgt[PTRS_PER_PMD];
2399 +extern pte_t level1_fixmap_pgt[PTRS_PER_PTE];
2400 +
2401  /*
2402   * Use this until direct mapping is established, i.e. before __va() is 
2403   * available in init_memory_mapping().
2404 @@ -362,6 +365,10 @@ __set_fixmap (enum fixed_addresses idx, 
2405                 set_pte_phys(address, phys, prot, 0);
2406                 set_pte_phys(address, phys, prot, 1);
2407                 break;
2408 +       case FIX_EARLYCON_MEM_BASE:
2409 +               xen_l1_entry_update(level1_fixmap_pgt + pte_index(address),
2410 +                                   pfn_pte_ma(phys >> PAGE_SHIFT, prot));
2411 +               break;
2412         default:
2413                 set_pte_phys_ma(address, phys, prot);
2414                 break;
2415 @@ -595,6 +602,19 @@ void __init xen_init_pt(void)
2416         __user_pgd(init_level4_pgt)[pgd_index(VSYSCALL_START)] =
2417                 __pgd(__pa_symbol(level3_user_pgt) | _PAGE_TABLE);
2418  
2419 +       /* Do an early initialization of the fixmap area. */
2420 +       addr = __fix_to_virt(FIX_EARLYCON_MEM_BASE);
2421 +       if (pud_present(level3_kernel_pgt[pud_index(addr)])) {
2422 +               unsigned long adr = page[pud_index(addr)];
2423 +
2424 +               addr_to_page(adr, page);
2425 +               memcpy(level2_fixmap_pgt, page, PAGE_SIZE);
2426 +       }
2427 +       level3_kernel_pgt[pud_index(addr)] =
2428 +               __pud(__pa_symbol(level2_fixmap_pgt) | _PAGE_TABLE);
2429 +       level2_fixmap_pgt[pmd_index(addr)] =
2430 +               __pmd(__pa_symbol(level1_fixmap_pgt) | _PAGE_TABLE);
2431 +
2432         early_make_page_readonly(init_level4_pgt,
2433                                  XENFEAT_writable_page_tables);
2434         early_make_page_readonly(__user_pgd(init_level4_pgt),
2435 @@ -603,6 +623,10 @@ void __init xen_init_pt(void)
2436                                  XENFEAT_writable_page_tables);
2437         early_make_page_readonly(level3_user_pgt,
2438                                  XENFEAT_writable_page_tables);
2439 +       early_make_page_readonly(level2_fixmap_pgt,
2440 +                                XENFEAT_writable_page_tables);
2441 +       early_make_page_readonly(level1_fixmap_pgt,
2442 +                                XENFEAT_writable_page_tables);
2443  
2444         if (!xen_feature(XENFEAT_writable_page_tables)) {
2445                 xen_pgd_pin(__pa_symbol(init_level4_pgt));
2446 @@ -832,7 +856,7 @@ void __init paging_init(void)
2447         sparse_init();
2448         free_area_init_nodes(max_zone_pfns);
2449  
2450 -       init_mm.context.pinned = 1;
2451 +       SetPagePinned(virt_to_page(init_mm.pgd));
2452  }
2453  #endif
2454  
2455 @@ -1142,41 +1166,6 @@ int kern_addr_valid(unsigned long addr) 
2456         return pfn_valid(pte_pfn(*pte));
2457  }
2458  
2459 -#ifdef CONFIG_SYSCTL
2460 -#include <linux/sysctl.h>
2461 -
2462 -extern int exception_trace, page_fault_trace;
2463 -
2464 -static ctl_table debug_table2[] = {
2465 -       {
2466 -               .ctl_name       = 99,
2467 -               .procname       = "exception-trace",
2468 -               .data           = &exception_trace,
2469 -               .maxlen         = sizeof(int),
2470 -               .mode           = 0644,
2471 -               .proc_handler   = proc_dointvec
2472 -       },
2473 -       {}
2474 -}; 
2475 -
2476 -static ctl_table debug_root_table2[] = { 
2477 -       {
2478 -               .ctl_name = CTL_DEBUG,
2479 -               .procname = "debug",
2480 -               .mode = 0555,
2481 -               .child = debug_table2
2482 -       },
2483 -       {}
2484 -}; 
2485 -
2486 -static __init int x8664_sysctl_init(void)
2487 -{ 
2488 -       register_sysctl_table(debug_root_table2);
2489 -       return 0;
2490 -}
2491 -__initcall(x8664_sysctl_init);
2492 -#endif
2493 -
2494  /* A pseudo VMA to allow ptrace access for the vsyscall page.  This only
2495     covers the 64bit vsyscall page now. 32bit has a real VMA now and does
2496     not need special handling anymore. */
2497 @@ -1215,9 +1204,18 @@ int in_gate_area_no_task(unsigned long a
2498  }
2499  
2500  #ifndef CONFIG_XEN
2501 -void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
2502 +void * __init alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
2503  {
2504         return __alloc_bootmem_core(pgdat->bdata, size,
2505                         SMP_CACHE_BYTES, (4UL*1024*1024*1024), 0);
2506  }
2507  #endif
2508 +
2509 +const char *arch_vma_name(struct vm_area_struct *vma)
2510 +{
2511 +       if (vma->vm_mm && vma->vm_start == (long)vma->vm_mm->context.vdso)
2512 +               return "[vdso]";
2513 +       if (vma == &gate_vma)
2514 +               return "[vsyscall]";
2515 +       return NULL;
2516 +}
2517 --- sle11sp1-2010-03-29.orig/arch/x86/mm/pageattr_64-xen.c      2009-11-06 10:49:47.000000000 +0100
2518 +++ sle11sp1-2010-03-29/arch/x86/mm/pageattr_64-xen.c   2009-11-06 10:51:07.000000000 +0100
2519 @@ -171,7 +171,7 @@ void mm_pin(struct mm_struct *mm)
2520         mm_walk(mm, PAGE_KERNEL_RO);
2521         xen_pgd_pin(__pa(mm->pgd)); /* kernel */
2522         xen_pgd_pin(__pa(__user_pgd(mm->pgd))); /* user */
2523 -       mm->context.pinned = 1;
2524 +       SetPagePinned(virt_to_page(mm->pgd));
2525         spin_lock(&mm_unpinned_lock);
2526         list_del(&mm->context.unpinned);
2527         spin_unlock(&mm_unpinned_lock);
2528 @@ -189,7 +189,7 @@ void mm_unpin(struct mm_struct *mm)
2529         xen_pgd_unpin(__pa(mm->pgd));
2530         xen_pgd_unpin(__pa(__user_pgd(mm->pgd)));
2531         mm_walk(mm, PAGE_KERNEL);
2532 -       mm->context.pinned = 0;
2533 +       ClearPagePinned(virt_to_page(mm->pgd));
2534         spin_lock(&mm_unpinned_lock);
2535         list_add(&mm->context.unpinned, &mm_unpinned);
2536         spin_unlock(&mm_unpinned_lock);
2537 @@ -217,7 +217,7 @@ void mm_pin_all(void)
2538  
2539  void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm)
2540  {
2541 -       if (!mm->context.pinned)
2542 +       if (!PagePinned(virt_to_page(mm->pgd)))
2543                 mm_pin(mm);
2544  }
2545  
2546 @@ -243,8 +243,9 @@ void arch_exit_mmap(struct mm_struct *mm
2547  
2548         task_unlock(tsk);
2549  
2550 -       if ( mm->context.pinned && (atomic_read(&mm->mm_count) == 1) &&
2551 -            !mm->context.has_foreign_mappings )
2552 +       if (PagePinned(virt_to_page(mm->pgd))
2553 +           && (atomic_read(&mm->mm_count) == 1)
2554 +           && !mm->context.has_foreign_mappings)
2555                 mm_unpin(mm);
2556  }
2557  
2558 @@ -343,14 +344,13 @@ static void flush_kernel_map(void *arg)
2559         struct page *pg;
2560  
2561         /* When clflush is available always use it because it is
2562 -          much cheaper than WBINVD. Disable clflush for now because
2563 -          the high level code is not ready yet */
2564 +          much cheaper than WBINVD. */
2565 +       /* clflush is still broken. Disable for now. */
2566         if (1 || !cpu_has_clflush)
2567                 asm volatile("wbinvd" ::: "memory");
2568         else list_for_each_entry(pg, l, lru) {
2569                 void *adr = page_address(pg);
2570 -               if (cpu_has_clflush)
2571 -                       cache_flush_page(adr);
2572 +               cache_flush_page(adr);
2573         }
2574         __flush_tlb_all();
2575  }
2576 @@ -364,7 +364,8 @@ static LIST_HEAD(deferred_pages); /* pro
2577  
2578  static inline void save_page(struct page *fpage)
2579  {
2580 -       list_add(&fpage->lru, &deferred_pages);
2581 +       if (!test_and_set_bit(PG_arch_1, &fpage->flags))
2582 +               list_add(&fpage->lru, &deferred_pages);
2583  }
2584  
2585  /* 
2586 @@ -398,9 +399,12 @@ __change_page_attr(unsigned long address
2587         pte_t *kpte; 
2588         struct page *kpte_page;
2589         pgprot_t ref_prot2;
2590 +
2591         kpte = lookup_address(address);
2592         if (!kpte) return 0;
2593         kpte_page = virt_to_page(((unsigned long)kpte) & PAGE_MASK);
2594 +       BUG_ON(PageLRU(kpte_page));
2595 +       BUG_ON(PageCompound(kpte_page));
2596         if (pgprot_val(prot) != pgprot_val(ref_prot)) { 
2597                 if (!pte_huge(*kpte)) {
2598                         set_pte(kpte, pfn_pte(pfn, prot));
2599 @@ -439,10 +443,9 @@ __change_page_attr(unsigned long address
2600                 return 0;
2601  #endif
2602  
2603 -       if (page_private(kpte_page) == 0) {
2604 -               save_page(kpte_page);
2605 +       save_page(kpte_page);
2606 +       if (page_private(kpte_page) == 0)
2607                 revert_page(address, ref_prot);
2608 -       }
2609         return 0;
2610  } 
2611  
2612 @@ -514,6 +517,10 @@ void global_flush_tlb(void)
2613         flush_map(&l);
2614  
2615         list_for_each_entry_safe(pg, next, &l, lru) {
2616 +               list_del(&pg->lru);
2617 +               clear_bit(PG_arch_1, &pg->flags);
2618 +               if (page_private(pg) != 0)
2619 +                       continue;
2620                 ClearPagePrivate(pg);
2621                 __free_page(pg);
2622         } 
2623 --- sle11sp1-2010-03-29.orig/arch/x86/vdso/vdso32/note.S        2010-03-29 09:00:35.000000000 +0200
2624 +++ sle11sp1-2010-03-29/arch/x86/vdso/vdso32/note.S     2009-11-06 10:51:07.000000000 +0100
2625 @@ -13,7 +13,7 @@ ELFNOTE_START(Linux, 0, "a")
2626         .long LINUX_VERSION_CODE
2627  ELFNOTE_END
2628  
2629 -#ifdef CONFIG_XEN
2630 +#if defined(CONFIG_X86_XEN) || defined(CONFIG_PARAVIRT_XEN)
2631  /*
2632   * Add a special note telling glibc's dynamic linker a fake hardware
2633   * flavor that it will use to choose the search path for libraries in the
2634 @@ -37,8 +37,12 @@ ELFNOTE_END
2635  
2636  ELFNOTE_START(GNU, 2, "a")
2637         .long 1                 /* ncaps */
2638 +#ifdef CONFIG_PARAVIRT_XEN
2639  VDSO32_NOTE_MASK:              /* Symbol used by arch/x86/xen/setup.c */
2640         .long 0                 /* mask */
2641 +#else
2642 +       .long 1 << VDSO_NOTE_NONEGSEG_BIT /* mask */
2643 +#endif
2644         .byte VDSO_NOTE_NONEGSEG_BIT; .asciz "nosegneg" /* bit, name */
2645  ELFNOTE_END
2646  #endif
2647 --- sle11sp1-2010-03-29.orig/drivers/Makefile   2009-12-04 10:44:41.000000000 +0100
2648 +++ sle11sp1-2010-03-29/drivers/Makefile        2009-11-06 10:51:07.000000000 +0100
2649 @@ -17,7 +17,7 @@ obj-$(CONFIG_SFI)             += sfi/
2650  obj-$(CONFIG_PNP)              += pnp/
2651  obj-$(CONFIG_ARM_AMBA)         += amba/
2652  
2653 -obj-$(CONFIG_XEN)              += xen/
2654 +obj-$(CONFIG_PARAVIRT_XEN)     += xen/
2655  
2656  # regulators early, since some subsystems rely on them to initialize
2657  obj-$(CONFIG_REGULATOR)                += regulator/
2658 --- sle11sp1-2010-03-29.orig/drivers/block/Kconfig      2010-03-29 09:00:35.000000000 +0200
2659 +++ sle11sp1-2010-03-29/drivers/block/Kconfig   2009-11-06 10:51:07.000000000 +0100
2660 @@ -464,9 +464,9 @@ config XILINX_SYSACE
2661         help
2662           Include support for the Xilinx SystemACE CompactFlash interface
2663  
2664 -config XEN_BLKDEV_FRONTEND
2665 +config XEN_BLKFRONT
2666         tristate "Xen virtual block device support"
2667 -       depends on XEN
2668 +       depends on PARAVIRT_XEN
2669         default y
2670         help
2671           This driver implements the front-end of the Xen virtual
2672 --- sle11sp1-2010-03-29.orig/drivers/block/Makefile     2010-03-29 09:00:35.000000000 +0200
2673 +++ sle11sp1-2010-03-29/drivers/block/Makefile  2009-11-06 10:51:07.000000000 +0100
2674 @@ -35,7 +35,7 @@ obj-$(CONFIG_BLK_DEV_SX8)     += sx8.o
2675  obj-$(CONFIG_BLK_DEV_UB)       += ub.o
2676  obj-$(CONFIG_BLK_DEV_HD)       += hd.o
2677  
2678 -obj-$(CONFIG_XEN_BLKDEV_FRONTEND)      += xen-blkfront.o
2679 +obj-$(CONFIG_XEN_BLKFRONT)     += xen-blkfront.o
2680  obj-$(CONFIG_CIPHER_TWOFISH)   += loop_fish2.o
2681  
2682  swim_mod-objs  := swim.o swim_asm.o
2683 --- sle11sp1-2010-03-29.orig/drivers/block/xen-blkfront.c       2010-03-29 09:00:35.000000000 +0200
2684 +++ sle11sp1-2010-03-29/drivers/block/xen-blkfront.c    2009-11-06 10:51:07.000000000 +0100
2685 @@ -1056,7 +1056,6 @@ static struct xenbus_device_id blkfront_
2686  
2687  static struct xenbus_driver blkfront = {
2688         .name = "vbd",
2689 -       .owner = THIS_MODULE,
2690         .ids = blkfront_ids,
2691         .probe = blkfront_probe,
2692         .remove = blkfront_remove,
2693 --- sle11sp1-2010-03-29.orig/drivers/char/Kconfig       2009-12-04 10:44:40.000000000 +0100
2694 +++ sle11sp1-2010-03-29/drivers/char/Kconfig    2009-11-06 10:51:07.000000000 +0100
2695 @@ -659,7 +659,7 @@ config HVC_IUCV
2696  
2697  config HVC_XEN