1 Subject: Fix xen build.
2 From: jbeulich@novell.com
3 Patch-mainline: obsolete
6 drivers/acpi/hardware/hwsleep.c | 2 ++
7 drivers/ide/ide-lib.c | 11 +++++++++++
8 drivers/oprofile/buffer_sync.c | 35 ++++++++++++++++++++++++-----------
9 drivers/oprofile/cpu_buffer.c | 6 ++++++
10 drivers/oprofile/oprof.c | 2 ++
11 drivers/oprofile/oprofile_files.c | 6 ++++++
12 include/linux/mm.h | 2 ++
13 include/linux/oprofile.h | 6 ++++--
15 9 files changed, 59 insertions(+), 13 deletions(-)
17 --- a/drivers/acpi/hardware/hwsleep.c
18 +++ b/drivers/acpi/hardware/hwsleep.c
19 @@ -430,6 +430,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_stat
20 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
22 ******************************************************************************/
24 acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)
27 @@ -479,6 +480,7 @@ acpi_status asmlinkage acpi_enter_sleep_
30 ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
33 /*******************************************************************************
35 --- a/drivers/ide/ide-lib.c
36 +++ b/drivers/ide/ide-lib.c
37 @@ -177,6 +177,16 @@ void ide_toggle_bounce(ide_drive_t *driv
39 u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */
42 + if (!PCI_DMA_BUS_IS_PHYS) {
43 + addr = BLK_BOUNCE_ANY;
44 + } else if (on && drive->media == ide_disk) {
45 + struct device *dev = drive->hwif->dev;
47 + if (dev && dev->dma_mask)
48 + addr = *dev->dma_mask;
51 if (on && drive->media == ide_disk) {
52 struct device *dev = drive->hwif->dev;
54 @@ -185,6 +195,7 @@ void ide_toggle_bounce(ide_drive_t *driv
55 else if (dev && dev->dma_mask)
56 addr = *dev->dma_mask;
61 blk_queue_bounce_limit(drive->queue, addr);
62 --- a/drivers/oprofile/buffer_sync.c
63 +++ b/drivers/oprofile/buffer_sync.c
64 @@ -44,7 +44,9 @@ static cpumask_t marked_cpus = CPU_MASK_
65 static DEFINE_SPINLOCK(task_mortuary);
66 static void process_task_mortuary(void);
69 static int cpu_current_domain[NR_CPUS];
72 /* Take ownership of the task struct and place it on the
73 * list for processing. Only after two full buffer syncs
74 @@ -153,11 +155,13 @@ static void end_sync(void)
81 for (i = 0; i < NR_CPUS; i++) {
82 cpu_current_domain[i] = COORDINATOR_DOMAIN;
88 @@ -302,12 +306,14 @@ static void add_cpu_mode_switch(unsigned
93 static void add_domain_switch(unsigned long domain_id)
95 add_event_entry(ESCAPE_CODE);
96 add_event_entry(DOMAIN_SWITCH_CODE);
97 add_event_entry(domain_id);
102 add_user_ctx_switch(struct task_struct const * task, unsigned long cookie)
103 @@ -531,11 +537,14 @@ void sync_buffer(int cpu)
108 /* We need to assign the first samples in this CPU buffer to the
109 same domain that we were processing at the last sync_buffer */
110 if (cpu_current_domain[cpu] != COORDINATOR_DOMAIN) {
111 add_domain_switch(cpu_current_domain[cpu]);
115 /* Remember, only we can modify tail_pos */
117 available = get_slots(cpu_buf);
118 @@ -553,8 +562,10 @@ void sync_buffer(int cpu)
119 } else if (s->event == CPU_TRACE_BEGIN) {
123 } else if (s->event == CPU_DOMAIN_SWITCH) {
128 struct mm_struct * oldmm = mm;
130 @@ -568,21 +579,21 @@ void sync_buffer(int cpu)
131 add_user_ctx_switch(new, cookie);
136 cpu_current_domain[cpu] = s->eip;
137 add_domain_switch(s->eip);
140 - if (cpu_current_domain[cpu] !=
141 + } else if (cpu_current_domain[cpu] !=
142 COORDINATOR_DOMAIN) {
143 - add_sample_entry(s->eip, s->event);
145 - else if (state >= sb_bt_start &&
146 - !add_sample(mm, s, cpu_mode)) {
147 - if (state == sb_bt_start) {
148 - state = sb_bt_ignore;
149 - atomic_inc(&oprofile_stats.bt_lost_no_mapping);
151 + add_sample_entry(s->eip, s->event);
154 + if (state >= sb_bt_start &&
155 + !add_sample(mm, s, cpu_mode)) {
156 + if (state == sb_bt_start) {
157 + state = sb_bt_ignore;
158 + atomic_inc(&oprofile_stats.bt_lost_no_mapping);
162 @@ -591,10 +602,12 @@ void sync_buffer(int cpu)
167 /* We reset domain to COORDINATOR at each CPU switch */
168 if (cpu_current_domain[cpu] != COORDINATOR_DOMAIN) {
169 add_domain_switch(COORDINATOR_DOMAIN);
175 --- a/drivers/oprofile/cpu_buffer.c
176 +++ b/drivers/oprofile/cpu_buffer.c
177 @@ -38,7 +38,11 @@ static void wq_sync_buffer(struct work_s
178 #define DEFAULT_TIMER_EXPIRE (HZ / 10)
179 static int work_enabled;
182 +#define current_domain COORDINATOR_DOMAIN
184 static int32_t current_domain = COORDINATOR_DOMAIN;
187 void free_cpu_buffers(void)
189 @@ -303,6 +307,7 @@ void oprofile_add_trace(unsigned long pc
190 add_sample(cpu_buf, pc, 0);
194 int oprofile_add_domain_switch(int32_t domain_id)
196 struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()];
197 @@ -321,6 +326,7 @@ int oprofile_add_domain_switch(int32_t d
204 * This serves to avoid cpu buffer overflow, and makes sure
205 --- a/drivers/oprofile/oprof.c
206 +++ b/drivers/oprofile/oprof.c
207 @@ -37,6 +37,7 @@ static DEFINE_MUTEX(start_mutex);
209 static int timer = 0;
212 int oprofile_set_active(int active_domains[], unsigned int adomains)
215 @@ -62,6 +63,7 @@ int oprofile_set_passive(int passive_dom
216 mutex_unlock(&start_mutex);
221 int oprofile_setup(void)
223 --- a/drivers/oprofile/oprofile_files.c
224 +++ b/drivers/oprofile/oprofile_files.c
225 @@ -124,6 +124,8 @@ static const struct file_operations dump
231 #define TMPBUFSIZE 512
233 static unsigned int adomains = 0;
234 @@ -313,12 +315,16 @@ static struct file_operations passive_do
235 .write = pdomain_write,
238 +#endif /* CONFIG_XEN */
240 void oprofile_create_files(struct super_block * sb, struct dentry * root)
242 oprofilefs_create_file(sb, root, "enable", &enable_fops);
243 oprofilefs_create_file_perm(sb, root, "dump", &dump_fops, 0666);
245 oprofilefs_create_file(sb, root, "active_domains", &active_domain_ops);
246 oprofilefs_create_file(sb, root, "passive_domains", &passive_domain_ops);
248 oprofilefs_create_file(sb, root, "buffer", &event_buffer_fops);
249 oprofilefs_create_ulong(sb, root, "buffer_size", &fs_buffer_size);
250 oprofilefs_create_ulong(sb, root, "buffer_watershed", &fs_buffer_watershed);
251 --- a/include/linux/mm.h
252 +++ b/include/linux/mm.h
253 @@ -187,10 +187,12 @@ struct vm_operations_struct {
254 int (*access)(struct vm_area_struct *vma, unsigned long addr,
255 void *buf, int len, int write);
258 /* Area-specific function for clearing the PTE at @ptep. Returns the
259 * original value of @ptep. */
260 pte_t (*zap_pte)(struct vm_area_struct *vma,
261 unsigned long addr, pte_t *ptep, int is_fullmm);
265 * set_policy() op must add a reference to any non-NULL @new mempolicy
266 --- a/include/linux/oprofile.h
267 +++ b/include/linux/oprofile.h
269 #include <linux/types.h>
270 #include <linux/spinlock.h>
271 #include <asm/atomic.h>
274 #include <xen/interface/xenoprof.h>
277 /* Each escaped entry is prefixed by ESCAPE_CODE
278 * then one of the following codes, then the
279 @@ -50,11 +51,12 @@ struct oprofile_operations {
280 /* create any necessary configuration files in the oprofile fs.
282 int (*create_files)(struct super_block * sb, struct dentry * root);
284 /* setup active domains with Xen */
285 int (*set_active)(int *active_domains, unsigned int adomains);
286 /* setup passive domains with Xen */
287 int (*set_passive)(int *passive_domains, unsigned int pdomains);
290 /* Do any necessary interrupt setup. Optional. */
292 /* Do any necessary interrupt shutdown. Optional. */
295 @@ -758,10 +758,12 @@ static unsigned long zap_pte_range(struc
296 page->index > details->last_index))
300 if (unlikely(vma->vm_ops && vma->vm_ops->zap_pte))
301 ptent = vma->vm_ops->zap_pte(vma, addr, pte,
305 ptent = ptep_get_and_clear_full(mm, addr, pte,
307 tlb_remove_tlb_entry(tlb, pte, addr);