04 Dec, 2010

2 commits


03 Dec, 2010

2 commits


02 Dec, 2010

4 commits

  • Re-map and re-bind all the pirqs at resume time.

    Signed-off-by: Stefano Stabellini

    Stefano Stabellini
     
  • Signed-off-by: Stefano Stabellini

    Stefano Stabellini
     
  • When remapping MSIs into pirqs for PV on HVM guests, qemu is responsible
    for doing the actual mapping and unmapping.
    We only give qemu the desired pirq number when we ask to do the mapping
    the first time, after that we should be reading back the pirq number
    from qemu every time we want to re-enable the MSI.

    This fixes a bug in xen_hvm_setup_msi_irqs that manifests itself when
    trying to enable the same MSI for the second time: the old MSI to pirq
    mapping is still valid at this point but xen_hvm_setup_msi_irqs would
    try to assign a new pirq anyway.
    A simple way to reproduce this bug is to assign an MSI capable network
    card to a PV on HVM guest, if the user brings down the corresponding
    ethernet interface and up again, Linux would fail to enable MSIs on the
    device.

    Signed-off-by: Stefano Stabellini

    Stefano Stabellini
     
  • Use the new hypercall PHYSDEVOP_get_free_pirq to ask Xen to allocate a
    pirq. Remove the unsupported PHYSDEVOP_get_nr_pirqs hypercall to get the
    amount of pirq available.

    This fixes find_unbound_pirq that otherwise would return a number
    starting from nr_irqs that might very well be out of range in Xen.

    The symptom of this bug is that when you passthrough an MSI capable pci
    device to a PV on HVM guest, Linux would fail to enable MSIs on the
    device.

    Signed-off-by: Stefano Stabellini

    Stefano Stabellini
     

24 Nov, 2010

1 commit

  • * 'upstream/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen: (23 commits)
    xen/events: Use PIRQ instead of GSI value when unmapping MSI/MSI-X irqs.
    xen: set IO permission early (before early_cpu_init())
    xen: re-enable boot-time ballooning
    xen/balloon: make sure we only include remaining extra ram
    xen/balloon: the balloon_lock is useless
    xen: add extra pages to balloon
    xen: make evtchn's name less generic
    xen/evtchn: the evtchn device is non-seekable
    Revert "xen/privcmd: create address space to allow writable mmaps"
    xen/events: use locked set|clear_bit() for cpu_evtchn_mask
    xen/evtchn: clear secondary CPUs' cpu_evtchn_mask[] after restore
    xen/xenfs: update xenfs_mount for new prototype
    xen: fix header export to userspace
    xen: implement XENMEM_machphys_mapping
    xen: set vma flag VM_PFNMAP in the privcmd mmap file_op
    xen: xenfs: privcmd: check put_user() return code
    xen/evtchn: add missing static
    xen/evtchn: Fix name of Xen event-channel device
    xen/evtchn: don't do unbind_from_irqhandler under spinlock
    xen/evtchn: remove spurious barrier
    ...

    Linus Torvalds
     

23 Nov, 2010

2 commits

  • * upstream/core:
    xen/events: Use PIRQ instead of GSI value when unmapping MSI/MSI-X irqs.
    xen: set IO permission early (before early_cpu_init())
    xen: re-enable boot-time ballooning
    xen/balloon: make sure we only include remaining extra ram
    xen/balloon: the balloon_lock is useless
    xen: add extra pages to balloon
    xen/events: use locked set|clear_bit() for cpu_evtchn_mask
    xen/evtchn: clear secondary CPUs' cpu_evtchn_mask[] after restore
    xen: implement XENMEM_machphys_mapping

    * upstream/xenfs:
    Revert "xen/privcmd: create address space to allow writable mmaps"
    xen/xenfs: update xenfs_mount for new prototype
    xen: fix header export to userspace
    xen: set vma flag VM_PFNMAP in the privcmd mmap file_op
    xen: xenfs: privcmd: check put_user() return code

    * upstream/evtchn:
    xen: make evtchn's name less generic
    xen/evtchn: the evtchn device is non-seekable
    xen/evtchn: add missing static
    xen/evtchn: Fix name of Xen event-channel device
    xen/evtchn: don't do unbind_from_irqhandler under spinlock
    xen/evtchn: remove spurious barrier
    xen/evtchn: ports start enabled
    xen/evtchn: dynamically allocate port_user array
    xen/evtchn: track enabled state for each port

    Jeremy Fitzhardinge
     
  • When we allocate a vector for MSI/MSI-X we save away the PIRQ, and the
    vector value. When we unmap (de-allocate) the MSI/MSI-X vector(s) we
    need to provide the PIRQ and the vector value. What we did instead
    was to provide the GSI (which was zero) and the vector value, and we
    got these unhappy error messages:

    (XEN) irq.c:1575: dom0: pirq 0 not mapped
    [ 7.733415] unmap irq failed -22

    This patches fixes this and we use the PIRQ value instead of the GSI
    value.

    CC: Stefano Stabellini
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     

20 Nov, 2010

3 commits


19 Nov, 2010

4 commits


18 Nov, 2010

1 commit


17 Nov, 2010

4 commits

  • The per-cpu event channel masks can be updated unlocked from multiple
    CPUs, so use the locked variant.

    Signed-off-by: Jeremy Fitzhardinge

    Jeremy Fitzhardinge
     
  • To bind all event channels to CPU#0, it is not sufficient to set all
    of its cpu_evtchn_mask[] bits; all other CPUs also need to get their
    bits cleared. Otherwise, evtchn_do_upcall() will start handling
    interrupts on CPUs they're not intended to run on, which can be
    particularly bad for per-CPU ones.

    [ linux-2.6.18-xen.hg 7de7453dee36 ]

    Signed-off-by: Jan Beulich
    Signed-off-by: Jeremy Fitzhardinge

    Jan Beulich
     
  • .mount now returns a struct dentry *.

    Signed-off-by: Jeremy Fitzhardinge

    Jeremy Fitzhardinge
     
  • * commit 'v2.6.37-rc2': (10093 commits)
    Linux 2.6.37-rc2
    capabilities/syslog: open code cap_syslog logic to fix build failure
    i2c: Sanity checks on adapter registration
    i2c: Mark i2c_adapter.id as deprecated
    i2c: Drivers shouldn't include
    i2c: Delete unused adapter IDs
    i2c: Remove obsolete cleanup for clientdata
    include/linux/kernel.h: Move logging bits to include/linux/printk.h
    Fix gcc 4.5.1 miscompiling drivers/char/i8k.c (again)
    hwmon: (w83795) Check for BEEP pin availability
    hwmon: (w83795) Clear intrusion alarm immediately
    hwmon: (w83795) Read the intrusion state properly
    hwmon: (w83795) Print the actual temperature channels as sources
    hwmon: (w83795) List all usable temperature sources
    hwmon: (w83795) Expose fan control method
    hwmon: (w83795) Fix fan control mode attributes
    hwmon: (lm95241) Check validity of input values
    hwmon: Change mail address of Hans J. Koch
    PCI: sysfs: fix printk warnings
    GFS2: Fix inode deallocation race
    ...

    Jeremy Fitzhardinge
     

13 Nov, 2010

1 commit


12 Nov, 2010

1 commit


11 Nov, 2010

1 commit

  • The IRQ core code will take care of disabling and reenabling
    interrupts over suspend resume automatically, therefore we do not need
    to do this in the Xen event channel code.

    The only exception is those event channels marked IRQF_NO_SUSPEND
    which the IRQ core ignores. We must unmask these ourselves, taking
    care to obey the current IRQ_DISABLED status. Failure check for
    IRQ_DISABLED leads to enabling polled only event channels, such as
    that associated with the pv spinlocks, which must never be enabled:

    [ 21.970432] ------------[ cut here ]------------
    [ 21.970432] kernel BUG at arch/x86/xen/spinlock.c:343!
    [ 21.970432] invalid opcode: 0000 [#1] SMP
    [ 21.970432] last sysfs file: /sys/devices/virtual/net/lo/operstate
    [ 21.970432] Modules linked in:
    [ 21.970432]
    [ 21.970432] Pid: 0, comm: swapper Not tainted (2.6.32.24-x86_32p-xen-01034-g787c727 #34)
    [ 21.970432] EIP: 0061:[] EFLAGS: 00010046 CPU: 3
    [ 21.970432] EIP is at dummy_handler+0x3/0x7
    [ 21.970432] EAX: 0000021c EBX: dfc16880 ECX: 0000001a EDX: 00000000
    [ 21.970432] ESI: dfc02c00 EDI: 00000001 EBP: dfc47e10 ESP: dfc47e10
    [ 21.970432] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0069
    [ 21.970432] Process swapper (pid: 0, ti=dfc46000 task=dfc39440 task.ti=dfc46000)
    [ 21.970432] Stack:
    [ 21.970432] dfc47e30 c10a39f0 0000021c 00000000 00000000 dfc16880 0000021c 00000001
    [ 21.970432] dfc47e40 c10a4f08 0000021c 00000000 dfc47e78 c12240a7 c1839284 c1839284
    [ 21.970432] 00000200 00000000 00000000 f5720000 c1f3d028 c1f3d02c 00000180 dfc47e90
    [ 21.970432] Call Trace:
    [ 21.970432] [] ? handle_IRQ_event+0x5f/0x122
    [ 21.970432] [] ? handle_percpu_irq+0x2f/0x55
    [ 21.970432] [] ? __xen_evtchn_do_upcall+0xdb/0x15f
    [ 21.970432] [] ? xen_evtchn_do_upcall+0x20/0x30
    [ 21.970432] [] ? xen_do_upcall+0x7/0xc
    [ 21.970432] [] ? apic_reg_read+0xd3/0x22d
    [ 21.970432] [] ? hypercall_page+0x227/0x1005
    [ 21.970432] [] ? xen_force_evtchn_callback+0xf/0x14
    [ 21.970432] [] ? check_events+0x8/0xc
    [ 21.970432] [] ? xen_irq_enable_direct_end+0x0/0x1
    [ 21.970432] [] ? finish_task_switch+0x62/0xba
    [ 21.970432] [] ? schedule+0x808/0x89d
    [ 21.970432] [] ? hrtimer_start_expires+0x1a/0x22
    [ 21.970432] [] ? tick_nohz_restart_sched_tick+0x15a/0x162
    [ 21.970432] [] ? cpu_idle+0x6d/0x6f
    [ 21.970432] [] ? cpu_bringup_and_idle+0xd/0xf
    [ 21.970432] Code: 5d 0f 95 c0 0f b6 c0 c3 55 66 83 78 02 00 89 e5 5d 0f 95 \
    c0 0f b6 c0 c3 55 b2 01 86 10 31 c0 84 d2 89 e5 0f 94 c0 5d c3 55 89 e5 0b \
    eb fe 55 80 3d 4c ce 84 c1 00 89 e5 57 56 89 c6 53 74 15
    [ 21.970432] EIP: [] dummy_handler+0x3/0x7 SS:ESP 0069:dfc47e10
    [ 21.970432] ---[ end trace c0b71f7e12cf3011 ]---

    Signed-off-by: Ian Campbell
    Signed-off-by: Jeremy Fitzhardinge

    Ian Campbell
     

30 Oct, 2010

1 commit


29 Oct, 2010

2 commits

  • Signed-off-by: Al Viro

    Al Viro
     
  • and branch 'for-linus' of git://xenbits.xen.org/people/sstabellini/linux-pvhvm

    * 'for-linus' of git://xenbits.xen.org/people/sstabellini/linux-pvhvm:
    xen: register xen pci notifier
    xen: initialize cpu masks for pv guests in xen_smp_init
    xen: add a missing #include to arch/x86/pci/xen.c
    xen: mask the MTRR feature from the cpuid
    xen: make hvc_xen console work for dom0.
    xen: add the direct mapping area for ISA bus access
    xen: Initialize xenbus for dom0.
    xen: use vcpu_ops to setup cpu masks
    xen: map a dummy page for local apic and ioapic in xen_set_fixmap
    xen: remap MSIs into pirqs when running as initial domain
    xen: remap GSIs as pirqs when running as initial domain
    xen: introduce XEN_DOM0 as a silent option
    xen: map MSIs into pirqs
    xen: support GSI -> pirq remapping in PV on HVM guests
    xen: add xen hvm acpi_register_gsi variant
    acpi: use indirect call to register gsi in different modes
    xen: implement xen_hvm_register_pirq
    xen: get the maximum number of pirqs from xen
    xen: support pirq != irq

    * 'stable/xen-pcifront-0.8.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: (27 commits)
    X86/PCI: Remove the dependency on isapnp_disable.
    xen: Update Makefile with CONFIG_BLOCK dependency for biomerge.c
    MAINTAINERS: Add myself to the Xen Hypervisor Interface and remove Chris Wright.
    x86: xen: Sanitse irq handling (part two)
    swiotlb-xen: On x86-32 builts, select SWIOTLB instead of depending on it.
    MAINTAINERS: Add myself for Xen PCI and Xen SWIOTLB maintainer.
    xen/pci: Request ACS when Xen-SWIOTLB is activated.
    xen-pcifront: Xen PCI frontend driver.
    xenbus: prevent warnings on unhandled enumeration values
    xenbus: Xen paravirtualised PCI hotplug support.
    xen/x86/PCI: Add support for the Xen PCI subsystem
    x86: Introduce x86_msi_ops
    msi: Introduce default_[teardown|setup]_msi_irqs with fallback.
    x86/PCI: Export pci_walk_bus function.
    x86/PCI: make sure _PAGE_IOMAP it set on pci mappings
    x86/PCI: Clean up pci_cache_line_size
    xen: fix shared irq device passthrough
    xen: Provide a variant of xen_poll_irq with timeout.
    xen: Find an unbound irq number in reverse order (high to low).
    xen: statically initialize cpu_evtchn_mask_p
    ...

    Fix up trivial conflicts in drivers/pci/Makefile

    Linus Torvalds
     

28 Oct, 2010

1 commit

  • Register a pci notifier to add (or remove) pci devices to Xen via
    hypercalls. Xen needs to know the pci devices present in the system to
    handle pci passthrough and even MSI remapping in the initial domain.

    Signed-off-by: Weidong Han
    Signed-off-by: Qing He
    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Stefano Stabellini

    Weidong Han
     

27 Oct, 2010

1 commit

  • …scm/linux/kernel/git/jeremy/xen

    * 'upstream/xenfs' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen:
    xen/privcmd: make privcmd visible in domU
    xen/privcmd: move remap_domain_mfn_range() to core xen code and export.
    privcmd: MMAPBATCH: Fix error handling/reporting
    xenbus: export xen_store_interface for xenfs
    xen/privcmd: make sure vma is ours before doing anything to it
    xen/privcmd: print SIGBUS faults
    xen/xenfs: set_page_dirty is supposed to return true if it dirties
    xen/privcmd: create address space to allow writable mmaps
    xen: add privcmd driver
    xen: add variable hypercall caller
    xen: add xen_set_domain_pte()
    xen: add /proc/xen/xsd_{kva,port} to xenfs

    * 'upstream/core' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen: (29 commits)
    xen: include xen/xen.h for definition of xen_initial_domain()
    xen: use host E820 map for dom0
    xen: correctly rebuild mfn list list after migration.
    xen: improvements to VIRQ_DEBUG output
    xen: set up IRQ before binding virq to evtchn
    xen: ensure that all event channels start off bound to VCPU 0
    xen/hvc: only notify if we actually sent something
    xen: don't add extra_pages for RAM after mem_end
    xen: add support for PAT
    xen: make sure xen_max_p2m_pfn is up to date
    xen: limit extra memory to a certain ratio of base
    xen: add extra pages for E820 RAM regions, even if beyond mem_end
    xen: make sure xen_extra_mem_start is beyond all non-RAM e820
    xen: implement "extra" memory to reserve space for pages not present at boot
    xen: Use host-provided E820 map
    xen: don't map missing memory
    xen: defer building p2m mfn structures until kernel is mapped
    xen: add return value to set_phys_to_machine()
    xen: convert p2m to a 3 level tree
    xen: make install_p2mtop_page() static
    ...

    Fix up trivial conflict in arch/x86/xen/mmu.c, and fix the use of
    'reserve_early()' - in the new memblock world order it is now
    'memblock_x86_reserve_range()' instead. Pointed out by Jeremy.

    Linus Torvalds
     

23 Oct, 2010

9 commits