1 Subject: Fix xen build.
2 From: jbeulich@novell.com
3 Patch-mainline: obsolete
5 --- sle11-2009-07-31.orig/drivers/acpi/hardware/hwsleep.c 2009-02-16 15:58:14.000000000 +0100
6 +++ sle11-2009-07-31/drivers/acpi/hardware/hwsleep.c 2009-02-16 16:01:39.000000000 +0100
7 @@ -430,6 +430,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_stat
8 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
10 ******************************************************************************/
12 acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)
15 @@ -479,6 +480,7 @@ acpi_status asmlinkage acpi_enter_sleep_
18 ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
21 /*******************************************************************************
23 --- sle11-2009-07-31.orig/drivers/base/cpu.c 2009-08-19 10:05:22.000000000 +0200
24 +++ sle11-2009-07-31/drivers/base/cpu.c 2009-02-17 11:26:03.000000000 +0100
25 @@ -78,7 +78,7 @@ static inline void register_cpu_control(
27 #endif /* CONFIG_HOTPLUG_CPU */
30 +#if defined(CONFIG_KEXEC) && !defined(CONFIG_XEN)
31 #include <linux/kexec.h>
33 static ssize_t show_crash_notes(struct sys_device *dev, struct sysdev_attribute *attr,
34 @@ -173,7 +173,7 @@ int __cpuinit register_cpu(struct cpu *c
36 register_cpu_under_node(num, cpu_to_node(num));
39 +#if defined(CONFIG_KEXEC) && !defined(CONFIG_XEN)
41 error = sysdev_create_file(&cpu->sysdev, &attr_crash_notes);
43 --- sle11-2009-07-31.orig/drivers/ide/ide-lib.c 2009-02-16 15:58:14.000000000 +0100
44 +++ sle11-2009-07-31/drivers/ide/ide-lib.c 2009-02-16 16:01:39.000000000 +0100
45 @@ -177,6 +177,16 @@ void ide_toggle_bounce(ide_drive_t *driv
47 u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */
50 + if (!PCI_DMA_BUS_IS_PHYS) {
51 + addr = BLK_BOUNCE_ANY;
52 + } else if (on && drive->media == ide_disk) {
53 + struct device *dev = drive->hwif->dev;
55 + if (dev && dev->dma_mask)
56 + addr = *dev->dma_mask;
59 if (on && drive->media == ide_disk) {
60 struct device *dev = drive->hwif->dev;
62 @@ -185,6 +195,7 @@ void ide_toggle_bounce(ide_drive_t *driv
63 else if (dev && dev->dma_mask)
64 addr = *dev->dma_mask;
69 blk_queue_bounce_limit(drive->queue, addr);
70 --- sle11-2009-07-31.orig/drivers/oprofile/buffer_sync.c 2009-02-16 15:58:14.000000000 +0100
71 +++ sle11-2009-07-31/drivers/oprofile/buffer_sync.c 2009-02-16 16:01:39.000000000 +0100
72 @@ -44,7 +44,9 @@ static cpumask_t marked_cpus = CPU_MASK_
73 static DEFINE_SPINLOCK(task_mortuary);
74 static void process_task_mortuary(void);
77 static int cpu_current_domain[NR_CPUS];
80 /* Take ownership of the task struct and place it on the
81 * list for processing. Only after two full buffer syncs
82 @@ -153,11 +155,13 @@ static void end_sync(void)
89 for (i = 0; i < NR_CPUS; i++) {
90 cpu_current_domain[i] = COORDINATOR_DOMAIN;
96 @@ -302,12 +306,14 @@ static void add_cpu_mode_switch(unsigned
101 static void add_domain_switch(unsigned long domain_id)
103 add_event_entry(ESCAPE_CODE);
104 add_event_entry(DOMAIN_SWITCH_CODE);
105 add_event_entry(domain_id);
110 add_user_ctx_switch(struct task_struct const * task, unsigned long cookie)
111 @@ -531,11 +537,14 @@ void sync_buffer(int cpu)
116 /* We need to assign the first samples in this CPU buffer to the
117 same domain that we were processing at the last sync_buffer */
118 if (cpu_current_domain[cpu] != COORDINATOR_DOMAIN) {
119 add_domain_switch(cpu_current_domain[cpu]);
123 /* Remember, only we can modify tail_pos */
125 available = get_slots(cpu_buf);
126 @@ -553,8 +562,10 @@ void sync_buffer(int cpu)
127 } else if (s->event == CPU_TRACE_BEGIN) {
131 } else if (s->event == CPU_DOMAIN_SWITCH) {
136 struct mm_struct * oldmm = mm;
138 @@ -568,21 +579,21 @@ void sync_buffer(int cpu)
139 add_user_ctx_switch(new, cookie);
144 cpu_current_domain[cpu] = s->eip;
145 add_domain_switch(s->eip);
148 - if (cpu_current_domain[cpu] !=
149 + } else if (cpu_current_domain[cpu] !=
150 COORDINATOR_DOMAIN) {
151 - add_sample_entry(s->eip, s->event);
153 - else if (state >= sb_bt_start &&
154 - !add_sample(mm, s, cpu_mode)) {
155 - if (state == sb_bt_start) {
156 - state = sb_bt_ignore;
157 - atomic_inc(&oprofile_stats.bt_lost_no_mapping);
159 + add_sample_entry(s->eip, s->event);
162 + if (state >= sb_bt_start &&
163 + !add_sample(mm, s, cpu_mode)) {
164 + if (state == sb_bt_start) {
165 + state = sb_bt_ignore;
166 + atomic_inc(&oprofile_stats.bt_lost_no_mapping);
170 @@ -591,10 +602,12 @@ void sync_buffer(int cpu)
175 /* We reset domain to COORDINATOR at each CPU switch */
176 if (cpu_current_domain[cpu] != COORDINATOR_DOMAIN) {
177 add_domain_switch(COORDINATOR_DOMAIN);
183 --- sle11-2009-07-31.orig/drivers/oprofile/cpu_buffer.c 2009-02-16 15:58:14.000000000 +0100
184 +++ sle11-2009-07-31/drivers/oprofile/cpu_buffer.c 2009-02-16 16:01:39.000000000 +0100
185 @@ -38,7 +38,11 @@ static void wq_sync_buffer(struct work_s
186 #define DEFAULT_TIMER_EXPIRE (HZ / 10)
187 static int work_enabled;
190 +#define current_domain COORDINATOR_DOMAIN
192 static int32_t current_domain = COORDINATOR_DOMAIN;
195 void free_cpu_buffers(void)
197 @@ -303,6 +307,7 @@ void oprofile_add_trace(unsigned long pc
198 add_sample(cpu_buf, pc, 0);
202 int oprofile_add_domain_switch(int32_t domain_id)
204 struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()];
205 @@ -321,6 +326,7 @@ int oprofile_add_domain_switch(int32_t d
212 * This serves to avoid cpu buffer overflow, and makes sure
213 --- sle11-2009-07-31.orig/drivers/oprofile/oprof.c 2009-02-16 15:58:14.000000000 +0100
214 +++ sle11-2009-07-31/drivers/oprofile/oprof.c 2009-02-16 16:01:39.000000000 +0100
215 @@ -37,6 +37,7 @@ static DEFINE_MUTEX(start_mutex);
217 static int timer = 0;
220 int oprofile_set_active(int active_domains[], unsigned int adomains)
223 @@ -62,6 +63,7 @@ int oprofile_set_passive(int passive_dom
224 mutex_unlock(&start_mutex);
229 int oprofile_setup(void)
231 --- sle11-2009-07-31.orig/drivers/oprofile/oprofile_files.c 2009-02-16 15:58:14.000000000 +0100
232 +++ sle11-2009-07-31/drivers/oprofile/oprofile_files.c 2009-02-16 16:01:39.000000000 +0100
233 @@ -124,6 +124,8 @@ static const struct file_operations dump
239 #define TMPBUFSIZE 512
241 static unsigned int adomains = 0;
242 @@ -313,12 +315,16 @@ static struct file_operations passive_do
243 .write = pdomain_write,
246 +#endif /* CONFIG_XEN */
248 void oprofile_create_files(struct super_block * sb, struct dentry * root)
250 oprofilefs_create_file(sb, root, "enable", &enable_fops);
251 oprofilefs_create_file_perm(sb, root, "dump", &dump_fops, 0666);
253 oprofilefs_create_file(sb, root, "active_domains", &active_domain_ops);
254 oprofilefs_create_file(sb, root, "passive_domains", &passive_domain_ops);
256 oprofilefs_create_file(sb, root, "buffer", &event_buffer_fops);
257 oprofilefs_create_ulong(sb, root, "buffer_size", &fs_buffer_size);
258 oprofilefs_create_ulong(sb, root, "buffer_watershed", &fs_buffer_watershed);
259 --- sle11-2009-07-31.orig/include/linux/mm.h 2009-08-19 10:20:34.000000000 +0200
260 +++ sle11-2009-07-31/include/linux/mm.h 2009-08-19 10:21:35.000000000 +0200
261 @@ -203,10 +203,12 @@ struct vm_operations_struct {
262 int (*access)(struct vm_area_struct *vma, unsigned long addr,
263 void *buf, int len, int write);
266 /* Area-specific function for clearing the PTE at @ptep. Returns the
267 * original value of @ptep. */
268 pte_t (*zap_pte)(struct vm_area_struct *vma,
269 unsigned long addr, pte_t *ptep, int is_fullmm);
273 * set_policy() op must add a reference to any non-NULL @new mempolicy
274 --- sle11-2009-07-31.orig/include/linux/oprofile.h 2009-06-26 16:58:14.000000000 +0200
275 +++ sle11-2009-07-31/include/linux/oprofile.h 2009-06-29 15:28:01.000000000 +0200
277 #include <linux/types.h>
278 #include <linux/spinlock.h>
279 #include <asm/atomic.h>
282 #include <xen/interface/xenoprof.h>
285 /* Each escaped entry is prefixed by ESCAPE_CODE
286 * then one of the following codes, then the
287 @@ -53,11 +54,12 @@ struct oprofile_operations {
288 /* create any necessary configuration files in the oprofile fs.
290 int (*create_files)(struct super_block * sb, struct dentry * root);
292 /* setup active domains with Xen */
293 int (*set_active)(int *active_domains, unsigned int adomains);
294 /* setup passive domains with Xen */
295 int (*set_passive)(int *passive_domains, unsigned int pdomains);
298 /* Do any necessary interrupt setup. Optional. */
300 /* Do any necessary interrupt shutdown. Optional. */
301 --- sle11-2009-07-31.orig/kernel/kexec.c 2008-11-25 13:31:12.000000000 +0100
302 +++ sle11-2009-07-31/kernel/kexec.c 2009-02-17 11:27:16.000000000 +0100
304 #include <linux/kdb.h>
308 /* Per cpu memory for storing cpu states in case of system crash. */
309 note_buf_t* crash_notes;
311 int dump_after_notifier;
313 /* vmcoreinfo stuff */
314 @@ -1167,6 +1169,7 @@ static void final_note(u32 *buf)
315 memcpy(buf, ¬e, sizeof(note));
319 void crash_save_cpu(struct pt_regs *regs, int cpu)
321 struct elf_prstatus prstatus;
322 @@ -1192,6 +1195,7 @@ void crash_save_cpu(struct pt_regs *regs
323 &prstatus, sizeof(prstatus));
329 static ctl_table dump_after_notifier_table[] = {
330 @@ -1219,6 +1223,7 @@ static ctl_table kexec_sys_table[] = {
332 static int __init crash_notes_memory_init(void)
335 /* Allocate memory for saving cpu registers. */
336 crash_notes = alloc_percpu(note_buf_t);
338 @@ -1226,6 +1231,7 @@ static int __init crash_notes_memory_ini
344 register_sysctl_table(kexec_sys_table);
346 --- sle11-2009-07-31.orig/mm/memory.c 2009-02-16 15:58:14.000000000 +0100
347 +++ sle11-2009-07-31/mm/memory.c 2009-02-16 16:01:39.000000000 +0100
348 @@ -758,10 +758,12 @@ static unsigned long zap_pte_range(struc
349 page->index > details->last_index))
353 if (unlikely(vma->vm_ops && vma->vm_ops->zap_pte))
354 ptent = vma->vm_ops->zap_pte(vma, addr, pte,
358 ptent = ptep_get_and_clear_full(mm, addr, pte,
360 tlb_remove_tlb_entry(tlb, pte, addr);