Merge branches 'upstream/core' and 'upstream/bugfix' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen

* 'upstream/core' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen:
xen: allocate irq descs on any NUMA node
xen: prevent crashes with non-HIGHMEM 32-bit kernels with largeish memory
xen: use default_idle
xen: clean up "extra" memory handling some more

* 'upstream/bugfix' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen:
xen: x86/32: perform initial startup on initial_page_table
xen: don't bother to stop other cpus on shutdown/reboot

+26 -35
-4
arch/x86/xen/enlighten.c
··· 1021 { 1022 struct sched_shutdown r = { .reason = reason }; 1023 1024 - #ifdef CONFIG_SMP 1025 - stop_other_cpus(); 1026 - #endif 1027 - 1028 if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r)) 1029 BUG(); 1030 }
··· 1021 { 1022 struct sched_shutdown r = { .reason = reason }; 1023 1024 if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r)) 1025 BUG(); 1026 }
+14 -27
arch/x86/xen/setup.c
··· 181 for (i = 0; i < memmap.nr_entries; i++) { 182 unsigned long long end = map[i].addr + map[i].size; 183 184 - if (map[i].type == E820_RAM) { 185 - if (map[i].addr < mem_end && end > mem_end) { 186 - /* Truncate region to max_mem. */ 187 - u64 delta = end - mem_end; 188 189 - map[i].size -= delta; 190 - extra_pages += PFN_DOWN(delta); 191 192 - end = mem_end; 193 - } 194 } 195 196 - if (end > xen_extra_mem_start) 197 xen_extra_mem_start = end; 198 199 - /* If region is non-RAM or below mem_end, add what remains */ 200 - if ((map[i].type != E820_RAM || map[i].addr < mem_end) && 201 - map[i].size > 0) 202 e820_add_region(map[i].addr, map[i].size, map[i].type); 203 } 204 ··· 247 xen_add_extra_mem(extra_pages); 248 249 return "Xen"; 250 - } 251 - 252 - static void xen_idle(void) 253 - { 254 - local_irq_disable(); 255 - 256 - if (need_resched()) 257 - local_irq_enable(); 258 - else { 259 - current_thread_info()->status &= ~TS_POLLING; 260 - smp_mb__after_clear_bit(); 261 - safe_halt(); 262 - current_thread_info()->status |= TS_POLLING; 263 - } 264 } 265 266 /* ··· 345 MAX_GUEST_CMDLINE > COMMAND_LINE_SIZE ? 346 COMMAND_LINE_SIZE : MAX_GUEST_CMDLINE); 347 348 - pm_idle = xen_idle; 349 350 fiddle_vdso(); 351 }
··· 181 for (i = 0; i < memmap.nr_entries; i++) { 182 unsigned long long end = map[i].addr + map[i].size; 183 184 + if (map[i].type == E820_RAM && end > mem_end) { 185 + /* RAM off the end - may be partially included */ 186 + u64 delta = min(map[i].size, end - mem_end); 187 188 + map[i].size -= delta; 189 + end -= delta; 190 191 + extra_pages += PFN_DOWN(delta); 192 } 193 194 + if (map[i].size > 0 && end > xen_extra_mem_start) 195 xen_extra_mem_start = end; 196 197 + /* Add region if any remains */ 198 + if (map[i].size > 0) 199 e820_add_region(map[i].addr, map[i].size, map[i].type); 200 } 201 ··· 250 xen_add_extra_mem(extra_pages); 251 252 return "Xen"; 253 } 254 255 /* ··· 362 MAX_GUEST_CMDLINE > COMMAND_LINE_SIZE ? 363 COMMAND_LINE_SIZE : MAX_GUEST_CMDLINE); 364 365 + /* Set up idle, making sure it calls safe_halt() pvop */ 366 + #ifdef CONFIG_X86_32 367 + boot_cpu_data.hlt_works_ok = 1; 368 + #endif 369 + pm_idle = default_idle; 370 371 fiddle_vdso(); 372 }
+10 -2
drivers/xen/balloon.c
··· 412 413 register_balloon(&balloon_sysdev); 414 415 - /* Initialise the balloon with excess memory space. */ 416 - extra_pfn_end = min(e820_end_of_ram_pfn(), 417 (unsigned long)PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size)); 418 for (pfn = PFN_UP(xen_extra_mem_start); 419 pfn < extra_pfn_end;
··· 412 413 register_balloon(&balloon_sysdev); 414 415 + /* 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()), 425 (unsigned long)PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size)); 426 for (pfn = PFN_UP(xen_extra_mem_start); 427 pfn < extra_pfn_end;
+2 -2
drivers/xen/events.c
··· 423 if (irq == start) 424 goto no_irqs; 425 426 - res = irq_alloc_desc_at(irq, 0); 427 428 if (WARN_ON(res != irq)) 429 return -1; ··· 630 if (identity_mapped_irq(gsi) || (!xen_initial_domain() && 631 xen_pv_domain())) { 632 irq = gsi; 633 - irq_alloc_desc_at(irq, 0); 634 } else 635 irq = find_unbound_irq(); 636
··· 423 if (irq == start) 424 goto no_irqs; 425 426 + res = irq_alloc_desc_at(irq, -1); 427 428 if (WARN_ON(res != irq)) 429 return -1; ··· 630 if (identity_mapped_irq(gsi) || (!xen_initial_domain() && 631 xen_pv_domain())) { 632 irq = gsi; 633 + irq_alloc_desc_at(irq, -1); 634 } else 635 irq = find_unbound_irq(); 636