diff options
-rw-r--r-- | arch/x86/xen/enlighten.c | 4 | ||||
-rw-r--r-- | arch/x86/xen/setup.c | 41 | ||||
-rw-r--r-- | drivers/xen/balloon.c | 12 | ||||
-rw-r--r-- | drivers/xen/events.c | 4 |
4 files changed, 26 insertions, 35 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 02c710bebf7a..44dcad43989d 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1021,10 +1021,6 @@ static void xen_reboot(int reason) | |||
1021 | { | 1021 | { |
1022 | struct sched_shutdown r = { .reason = reason }; | 1022 | struct sched_shutdown r = { .reason = reason }; |
1023 | 1023 | ||
1024 | #ifdef CONFIG_SMP | ||
1025 | stop_other_cpus(); | ||
1026 | #endif | ||
1027 | |||
1028 | if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r)) | 1024 | if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r)) |
1029 | BUG(); | 1025 | BUG(); |
1030 | } | 1026 | } |
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 01afd8a94607..b5a7f928234b 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -181,24 +181,21 @@ char * __init xen_memory_setup(void) | |||
181 | for (i = 0; i < memmap.nr_entries; i++) { | 181 | for (i = 0; i < memmap.nr_entries; i++) { |
182 | unsigned long long end = map[i].addr + map[i].size; | 182 | unsigned long long end = map[i].addr + map[i].size; |
183 | 183 | ||
184 | if (map[i].type == E820_RAM) { | 184 | if (map[i].type == E820_RAM && end > mem_end) { |
185 | if (map[i].addr < mem_end && end > mem_end) { | 185 | /* RAM off the end - may be partially included */ |
186 | /* Truncate region to max_mem. */ | 186 | u64 delta = min(map[i].size, end - mem_end); |
187 | u64 delta = end - mem_end; | ||
188 | 187 | ||
189 | map[i].size -= delta; | 188 | map[i].size -= delta; |
190 | extra_pages += PFN_DOWN(delta); | 189 | end -= delta; |
191 | 190 | ||
192 | end = mem_end; | 191 | extra_pages += PFN_DOWN(delta); |
193 | } | ||
194 | } | 192 | } |
195 | 193 | ||
196 | if (end > xen_extra_mem_start) | 194 | if (map[i].size > 0 && end > xen_extra_mem_start) |
197 | xen_extra_mem_start = end; | 195 | xen_extra_mem_start = end; |
198 | 196 | ||
199 | /* If region is non-RAM or below mem_end, add what remains */ | 197 | /* Add region if any remains */ |
200 | if ((map[i].type != E820_RAM || map[i].addr < mem_end) && | 198 | if (map[i].size > 0) |
201 | map[i].size > 0) | ||
202 | e820_add_region(map[i].addr, map[i].size, map[i].type); | 199 | e820_add_region(map[i].addr, map[i].size, map[i].type); |
203 | } | 200 | } |
204 | 201 | ||
@@ -252,20 +249,6 @@ char * __init xen_memory_setup(void) | |||
252 | return "Xen"; | 249 | return "Xen"; |
253 | } | 250 | } |
254 | 251 | ||
255 | static void xen_idle(void) | ||
256 | { | ||
257 | local_irq_disable(); | ||
258 | |||
259 | if (need_resched()) | ||
260 | local_irq_enable(); | ||
261 | else { | ||
262 | current_thread_info()->status &= ~TS_POLLING; | ||
263 | smp_mb__after_clear_bit(); | ||
264 | safe_halt(); | ||
265 | current_thread_info()->status |= TS_POLLING; | ||
266 | } | ||
267 | } | ||
268 | |||
269 | /* | 252 | /* |
270 | * Set the bit indicating "nosegneg" library variants should be used. | 253 | * Set the bit indicating "nosegneg" library variants should be used. |
271 | * We only need to bother in pure 32-bit mode; compat 32-bit processes | 254 | * We only need to bother in pure 32-bit mode; compat 32-bit processes |
@@ -362,7 +345,11 @@ void __init xen_arch_setup(void) | |||
362 | MAX_GUEST_CMDLINE > COMMAND_LINE_SIZE ? | 345 | MAX_GUEST_CMDLINE > COMMAND_LINE_SIZE ? |
363 | COMMAND_LINE_SIZE : MAX_GUEST_CMDLINE); | 346 | COMMAND_LINE_SIZE : MAX_GUEST_CMDLINE); |
364 | 347 | ||
365 | pm_idle = xen_idle; | 348 | /* Set up idle, making sure it calls safe_halt() pvop */ |
349 | #ifdef CONFIG_X86_32 | ||
350 | boot_cpu_data.hlt_works_ok = 1; | ||
351 | #endif | ||
352 | pm_idle = default_idle; | ||
366 | 353 | ||
367 | fiddle_vdso(); | 354 | fiddle_vdso(); |
368 | } | 355 | } |
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 2b17ad5b4b32..43f9f02c7db0 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -412,8 +412,16 @@ static int __init balloon_init(void) | |||
412 | 412 | ||
413 | register_balloon(&balloon_sysdev); | 413 | register_balloon(&balloon_sysdev); |
414 | 414 | ||
415 | /* Initialise the balloon with excess memory space. */ | 415 | /* |
416 | extra_pfn_end = min(e820_end_of_ram_pfn(), | 416 | * Initialise the balloon with excess memory space. We need |
417 | * to make sure we don't add memory which doesn't exist or | ||
418 | * logically exist. The E820 map can be trimmed to be smaller | ||
419 | * than the amount of physical memory due to the mem= command | ||
420 | * line parameter. And if this is a 32-bit non-HIGHMEM kernel | ||
421 | * on a system with memory which requires highmem to access, | ||
422 | * don't try to use it. | ||
423 | */ | ||
424 | extra_pfn_end = min(min(max_pfn, e820_end_of_ram_pfn()), | ||
417 | (unsigned long)PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size)); | 425 | (unsigned long)PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size)); |
418 | for (pfn = PFN_UP(xen_extra_mem_start); | 426 | for (pfn = PFN_UP(xen_extra_mem_start); |
419 | pfn < extra_pfn_end; | 427 | pfn < extra_pfn_end; |
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 2811bb988ea0..0009e489272c 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -423,7 +423,7 @@ static int find_unbound_irq(void) | |||
423 | if (irq == start) | 423 | if (irq == start) |
424 | goto no_irqs; | 424 | goto no_irqs; |
425 | 425 | ||
426 | res = irq_alloc_desc_at(irq, 0); | 426 | res = irq_alloc_desc_at(irq, -1); |
427 | 427 | ||
428 | if (WARN_ON(res != irq)) | 428 | if (WARN_ON(res != irq)) |
429 | return -1; | 429 | return -1; |
@@ -630,7 +630,7 @@ int xen_map_pirq_gsi(unsigned pirq, unsigned gsi, int shareable, char *name) | |||
630 | if (identity_mapped_irq(gsi) || (!xen_initial_domain() && | 630 | if (identity_mapped_irq(gsi) || (!xen_initial_domain() && |
631 | xen_pv_domain())) { | 631 | xen_pv_domain())) { |
632 | irq = gsi; | 632 | irq = gsi; |
633 | irq_alloc_desc_at(irq, 0); | 633 | irq_alloc_desc_at(irq, -1); |
634 | } else | 634 | } else |
635 | irq = find_unbound_irq(); | 635 | irq = find_unbound_irq(); |
636 | 636 | ||