Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'stable/for-linus-3.4-tag-two' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

Pull more xen updates from Konrad Rzeszutek Wilk:
"One tiny feature that accidentally got lost in the initial git pull:
* Add fast-EOI acking of interrupts (clear a bit instead of
hypercall)
And bug-fixes:
* Fix CPU bring-up code missing a call to notify other subsystems.
* Fix reading /sys/hypervisor even if PVonHVM drivers are not loaded.
* In Xen ACPI processor driver: remove too verbose WARN messages, fix
up the Kconfig dependency to be a module by default, and add
dependency on CPU_FREQ.
* Disable CPU frequency drivers from loading when booting under Xen
(as we want the Xen ACPI processor to be used instead).
* Cleanups in tmem code."

* tag 'stable/for-linus-3.4-tag-two' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
xen/acpi: Fix Kconfig dependency on CPU_FREQ
xen: initialize platform-pci even if xen_emul_unplug=never
xen/smp: Fix bringup bug in AP code.
xen/acpi: Remove the WARN's as they just create noise.
xen/tmem: cleanup
xen: support pirq_eoi_map
xen/acpi-processor: Do not depend on CPU frequency scaling drivers.
xen/cpufreq: Disable the cpu frequency scaling drivers from loading.
provide disable_cpufreq() function to disable the API.

+76 -27
+2
arch/x86/xen/setup.c
··· 10 10 #include <linux/pm.h> 11 11 #include <linux/memblock.h> 12 12 #include <linux/cpuidle.h> 13 + #include <linux/cpufreq.h> 13 14 14 15 #include <asm/elf.h> 15 16 #include <asm/vdso.h> ··· 421 420 boot_cpu_data.hlt_works_ok = 1; 422 421 #endif 423 422 disable_cpuidle(); 423 + disable_cpufreq(); 424 424 WARN_ON(set_pm_idle_to_default()); 425 425 fiddle_vdso(); 426 426 }
+6
arch/x86/xen/smp.c
··· 75 75 76 76 xen_setup_cpu_clockevents(); 77 77 78 + notify_cpu_starting(cpu); 79 + 80 + ipi_call_lock(); 78 81 set_cpu_online(cpu, true); 82 + ipi_call_unlock(); 83 + 79 84 this_cpu_write(cpu_state, CPU_ONLINE); 85 + 80 86 wmb(); 81 87 82 88 /* We can take interrupts now: we're officially "up". */
+3
drivers/block/xen-blkfront.c
··· 1475 1475 if (!xen_domain()) 1476 1476 return -ENODEV; 1477 1477 1478 + if (!xen_platform_pci_unplug) 1479 + return -ENODEV; 1480 + 1478 1481 if (register_blkdev(XENVBD_MAJOR, DEV_NAME)) { 1479 1482 printk(KERN_WARNING "xen_blk: can't get major %d with name %s\n", 1480 1483 XENVBD_MAJOR, DEV_NAME);
+4
drivers/net/xen-netfront.c
··· 47 47 #include <xen/xenbus.h> 48 48 #include <xen/events.h> 49 49 #include <xen/page.h> 50 + #include <xen/platform_pci.h> 50 51 #include <xen/grant_table.h> 51 52 52 53 #include <xen/interface/io/netif.h> ··· 1964 1963 1965 1964 if (xen_initial_domain()) 1966 1965 return 0; 1966 + 1967 + if (!xen_platform_pci_unplug) 1968 + return -ENODEV; 1967 1969 1968 1970 printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n"); 1969 1971
+2 -3
drivers/xen/Kconfig
··· 180 180 181 181 config XEN_ACPI_PROCESSOR 182 182 tristate "Xen ACPI processor" 183 - depends on XEN && X86 && ACPI_PROCESSOR 184 - default y if (X86_ACPI_CPUFREQ = y || X86_POWERNOW_K8 = y) 185 - default m if (X86_ACPI_CPUFREQ = m || X86_POWERNOW_K8 = m) 183 + depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ 184 + default m 186 185 help 187 186 This ACPI processor uploads Power Management information to the Xen hypervisor. 188 187
+23 -3
drivers/xen/events.c
··· 37 37 #include <asm/idle.h> 38 38 #include <asm/io_apic.h> 39 39 #include <asm/sync_bitops.h> 40 + #include <asm/xen/page.h> 40 41 #include <asm/xen/pci.h> 41 42 #include <asm/xen/hypercall.h> 42 43 #include <asm/xen/hypervisor.h> ··· 110 109 #define PIRQ_SHAREABLE (1 << 1) 111 110 112 111 static int *evtchn_to_irq; 112 + static unsigned long *pirq_eoi_map; 113 + static bool (*pirq_needs_eoi)(unsigned irq); 113 114 114 115 static DEFINE_PER_CPU(unsigned long [NR_EVENT_CHANNELS/BITS_PER_LONG], 115 116 cpu_evtchn_mask); ··· 272 269 return ret; 273 270 } 274 271 275 - static bool pirq_needs_eoi(unsigned irq) 272 + static bool pirq_check_eoi_map(unsigned irq) 273 + { 274 + return test_bit(irq, pirq_eoi_map); 275 + } 276 + 277 + static bool pirq_needs_eoi_flag(unsigned irq) 276 278 { 277 279 struct irq_info *info = info_for_irq(irq); 278 - 279 280 BUG_ON(info->type != IRQT_PIRQ); 280 281 281 282 return info->u.pirq.flags & PIRQ_NEEDS_EOI; ··· 1775 1768 1776 1769 void __init xen_init_IRQ(void) 1777 1770 { 1778 - int i; 1771 + int i, rc; 1779 1772 1780 1773 evtchn_to_irq = kcalloc(NR_EVENT_CHANNELS, sizeof(*evtchn_to_irq), 1781 1774 GFP_KERNEL); ··· 1789 1782 for (i = 0; i < NR_EVENT_CHANNELS; i++) 1790 1783 mask_evtchn(i); 1791 1784 1785 + pirq_needs_eoi = pirq_needs_eoi_flag; 1786 + 1792 1787 if (xen_hvm_domain()) { 1793 1788 xen_callback_vector(); 1794 1789 native_init_IRQ(); ··· 1798 1789 * __acpi_register_gsi can point at the right function */ 1799 1790 pci_xen_hvm_init(); 1800 1791 } else { 1792 + struct physdev_pirq_eoi_gmfn eoi_gmfn; 1793 + 1801 1794 irq_ctx_init(smp_processor_id()); 1802 1795 if (xen_initial_domain()) 1803 1796 pci_xen_initial_domain(); 1797 + 1798 + pirq_eoi_map = (void *)__get_free_page(GFP_KERNEL|__GFP_ZERO); 1799 + eoi_gmfn.gmfn = virt_to_mfn(pirq_eoi_map); 1800 + rc = HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_gmfn_v2, &eoi_gmfn); 1801 + if (rc != 0) { 1802 + free_page((unsigned long) pirq_eoi_map); 1803 + pirq_eoi_map = NULL; 1804 + } else 1805 + pirq_needs_eoi = pirq_check_eoi_map; 1804 1806 } 1805 1807 }
-5
drivers/xen/platform-pci.c
··· 186 186 187 187 static int __init platform_pci_module_init(void) 188 188 { 189 - /* no unplug has been done, IGNORE hasn't been specified: just 190 - * return now */ 191 - if (!xen_platform_pci_unplug) 192 - return -ENODEV; 193 - 194 189 return pci_register_driver(&platform_driver); 195 190 } 196 191
+8 -13
drivers/xen/tmem.c
··· 9 9 #include <linux/types.h> 10 10 #include <linux/init.h> 11 11 #include <linux/pagemap.h> 12 - #include <linux/module.h> 13 12 #include <linux/cleancache.h> 14 13 15 14 /* temporary ifdef until include/linux/frontswap.h is upstream */ ··· 127 128 return xen_tmem_op(TMEM_FLUSH_OBJECT, pool_id, oid, 0, 0, 0, 0, 0); 128 129 } 129 130 130 - int tmem_enabled __read_mostly; 131 - EXPORT_SYMBOL(tmem_enabled); 131 + bool __read_mostly tmem_enabled = false; 132 132 133 133 static int __init enable_tmem(char *s) 134 134 { 135 - tmem_enabled = 1; 135 + tmem_enabled = true; 136 136 return 1; 137 137 } 138 - 139 138 __setup("tmem", enable_tmem); 140 139 141 140 #ifdef CONFIG_CLEANCACHE ··· 226 229 return xen_tmem_new_pool(shared_uuid, TMEM_POOL_SHARED, pagesize); 227 230 } 228 231 229 - static int use_cleancache = 1; 232 + static bool __initdata use_cleancache = true; 230 233 231 234 static int __init no_cleancache(char *s) 232 235 { 233 - use_cleancache = 0; 236 + use_cleancache = false; 234 237 return 1; 235 238 } 236 - 237 239 __setup("nocleancache", no_cleancache); 238 240 239 - static struct cleancache_ops tmem_cleancache_ops = { 241 + static struct cleancache_ops __initdata tmem_cleancache_ops = { 240 242 .put_page = tmem_cleancache_put_page, 241 243 .get_page = tmem_cleancache_get_page, 242 244 .invalidate_page = tmem_cleancache_flush_page, ··· 352 356 xen_tmem_new_pool(private, TMEM_POOL_PERSIST, PAGE_SIZE); 353 357 } 354 358 355 - static int __initdata use_frontswap = 1; 359 + static bool __initdata use_frontswap = true; 356 360 357 361 static int __init no_frontswap(char *s) 358 362 { 359 - use_frontswap = 0; 363 + use_frontswap = false; 360 364 return 1; 361 365 } 362 - 363 366 __setup("nofrontswap", no_frontswap); 364 367 365 - static struct frontswap_ops tmem_frontswap_ops = { 368 + static struct frontswap_ops __initdata tmem_frontswap_ops = { 366 369 .put_page = tmem_frontswap_put_page, 367 370 .get_page = tmem_frontswap_get_page, 368 371 .invalidate_page = tmem_frontswap_flush_page,
+2 -2
drivers/xen/xen-acpi-processor.c
··· 501 501 502 502 perf = per_cpu_ptr(acpi_perf_data, i); 503 503 rc = acpi_processor_register_performance(perf, i); 504 - if (WARN_ON(rc)) 504 + if (rc) 505 505 goto err_out; 506 506 } 507 507 rc = acpi_processor_notify_smm(THIS_MODULE); 508 - if (WARN_ON(rc)) 508 + if (rc) 509 509 goto err_unregister; 510 510 511 511 for_each_possible_cpu(i) {
+21
include/xen/interface/physdev.h
··· 39 39 }; 40 40 41 41 /* 42 + * Register a shared page for the hypervisor to indicate whether the guest 43 + * must issue PHYSDEVOP_eoi. The semantics of PHYSDEVOP_eoi change slightly 44 + * once the guest used this function in that the associated event channel 45 + * will automatically get unmasked. The page registered is used as a bit 46 + * array indexed by Xen's PIRQ value. 47 + */ 48 + #define PHYSDEVOP_pirq_eoi_gmfn_v1 17 49 + /* 50 + * Register a shared page for the hypervisor to indicate whether the 51 + * guest must issue PHYSDEVOP_eoi. This hypercall is very similar to 52 + * PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't change the semantics of 53 + * PHYSDEVOP_eoi. The page registered is used as a bit array indexed by 54 + * Xen's PIRQ value. 55 + */ 56 + #define PHYSDEVOP_pirq_eoi_gmfn_v2 28 57 + struct physdev_pirq_eoi_gmfn { 58 + /* IN */ 59 + unsigned long gmfn; 60 + }; 61 + 62 + /* 42 63 * Query the status of an IRQ line. 43 64 * @arg == pointer to physdev_irq_status_query structure. 44 65 */
+5 -1
include/xen/tmem.h
··· 1 1 #ifndef _XEN_TMEM_H 2 2 #define _XEN_TMEM_H 3 + 4 + #include <linux/types.h> 5 + 3 6 /* defined in drivers/xen/tmem.c */ 4 - extern int tmem_enabled; 7 + extern bool tmem_enabled; 8 + 5 9 #endif /* _XEN_TMEM_H */