1. 04 3月, 2011 3 次提交
    • I
      xen: events: allocate GSIs and dynamic IRQs from separate IRQ ranges. · 89911501
      Ian Campbell 提交于
      There are three cases which we need to care about, PV guest, PV domain
      0 and HVM guest.
      
      The PV guest case is simple since it has no access to ACPI or real
      APICs and therefore has no GSIs therefore we simply dynamically
      allocate all IRQs. The potentially interesting case here is PIRQ type
      event channels associated with passed through PCI devices. However
      even in this case the guest has no direct interaction with the
      physical GSI since that happens in the PCI backend.
      
      The PV domain 0 and HVM guest cases are actually the same. In domain 0
      case the kernel sees the host ACPI and GSIs (although it only sees the
      APIC indirectly via the hypervisor) and in the HVM guest case it sees
      the virtualised ACPI and emulated APICs. In these cases we start
      allocating dynamic IRQs at nr_irqs_gsi so that they cannot clash with
      any GSI.
      
      Currently xen_allocate_irq_dynamic starts at nr_irqs and works
      backwards looking for a free IRQ in order to (try and) avoid clashing
      with GSIs used in domain 0 and in HVM guests. This change avoids that
      although we retain the behaviour of allowing dynamic IRQs to encroach
      on the GSI range if no suitable IRQs are available since a future IRQ
      clash is deemed preferable to failure right now.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      89911501
    • I
      xen: events: add xen_allocate_irq_{dynamic, gsi} and xen_free_irq · c9df1ce5
      Ian Campbell 提交于
      This is neater than open-coded calls to irq_alloc_desc_at and
      irq_free_desc.
      
      No intended behavioural change.
      
      Note that we previously were not checking the return value of
      irq_alloc_desc_at which would be failing for GSI<NR_IRQS_LEGACY
      because the core architecture code has already allocated those for
      us. Hence the additional check against NR_IRQS_LEGACY in
      xen_allocate_irq_gsi.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      c9df1ce5
    • I
      xen:events: move find_unbound_irq inside CONFIG_PCI_MSI · cbf6aa89
      Ian Campbell 提交于
      The only caller is xen_allocate_pirq_msi which is also under this
      ifdef so this fixes:
          drivers/xen/events.c:377: warning: 'find_unbound_pirq' defined but not used
      when CONFIG_PCI_MSI=n
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      cbf6aa89
  2. 10 1月, 2011 1 次提交
  3. 17 12月, 2010 2 次提交
  4. 10 12月, 2010 1 次提交
  5. 03 12月, 2010 1 次提交
  6. 02 12月, 2010 3 次提交
  7. 23 11月, 2010 1 次提交
    • K
      xen/events: Use PIRQ instead of GSI value when unmapping MSI/MSI-X irqs. · 12334715
      Konrad Rzeszutek Wilk 提交于
      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 <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      12334715
  8. 17 11月, 2010 2 次提交
  9. 11 11月, 2010 1 次提交
    • I
      xen: events: do not unmask event channels on resume · 6903591f
      Ian Campbell 提交于
      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:[<c102e209>] 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] <0> dfc47e40 c10a4f08 0000021c 00000000 dfc47e78 c12240a7 c1839284 c1839284
      [   21.970432] <0> 00000200 00000000 00000000 f5720000 c1f3d028 c1f3d02c 00000180 dfc47e90
      [   21.970432] Call Trace:
      [   21.970432]  [<c10a39f0>] ? handle_IRQ_event+0x5f/0x122
      [   21.970432]  [<c10a4f08>] ? handle_percpu_irq+0x2f/0x55
      [   21.970432]  [<c12240a7>] ? __xen_evtchn_do_upcall+0xdb/0x15f
      [   21.970432]  [<c122481e>] ? xen_evtchn_do_upcall+0x20/0x30
      [   21.970432]  [<c1030d47>] ? xen_do_upcall+0x7/0xc
      [   21.970432]  [<c102007b>] ? apic_reg_read+0xd3/0x22d
      [   21.970432]  [<c1002227>] ? hypercall_page+0x227/0x1005
      [   21.970432]  [<c102d30b>] ? xen_force_evtchn_callback+0xf/0x14
      [   21.970432]  [<c102da7c>] ? check_events+0x8/0xc
      [   21.970432]  [<c102da3b>] ? xen_irq_enable_direct_end+0x0/0x1
      [   21.970432]  [<c105e485>] ? finish_task_switch+0x62/0xba
      [   21.970432]  [<c14e3f84>] ? schedule+0x808/0x89d
      [   21.970432]  [<c1084dc5>] ? hrtimer_start_expires+0x1a/0x22
      [   21.970432]  [<c1085154>] ? tick_nohz_restart_sched_tick+0x15a/0x162
      [   21.970432]  [<c102f43a>] ? cpu_idle+0x6d/0x6f
      [   21.970432]  [<c14db29e>] ? 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 <0f> 0b \
      eb fe 55 80 3d 4c ce 84 c1 00 89 e5 57 56 89 c6 53 74 15
      [   21.970432] EIP: [<c102e209>] dummy_handler+0x3/0x7 SS:ESP 0069:dfc47e10
      [   21.970432] ---[ end trace c0b71f7e12cf3011 ]---
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      6903591f
  10. 23 10月, 2010 12 次提交
  11. 19 10月, 2010 1 次提交
  12. 18 10月, 2010 9 次提交
  13. 12 10月, 2010 1 次提交
  14. 25 8月, 2010 2 次提交
    • J
      xen: handle events as edge-triggered · dffe2e1e
      Jeremy Fitzhardinge 提交于
      Xen events are logically edge triggered, as Xen only calls the event
      upcall when an event is newly set, but not continuously as it remains set.
      As a result, use handle_edge_irq rather than handle_level_irq.
      
      This has the important side-effect of fixing a long-standing bug of
      events getting lost if:
       - an event's interrupt handler is running
       - the event is migrated to a different vcpu
       - the event is re-triggered
      
      The most noticable symptom of these lost events is occasional lockups
      of blkfront.
      
      Many thanks to Tom Kopec and Daniel Stodden in tracking this down.
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: Tom Kopec <tek@acm.org>
      Cc: Daniel Stodden <daniel.stodden@citrix.com>
      Cc: Stable Kernel <stable@kernel.org>
      dffe2e1e
    • J
      xen: use percpu interrupts for IPIs and VIRQs · aaca4964
      Jeremy Fitzhardinge 提交于
      IPIs and VIRQs are inherently per-cpu event types, so treat them as such:
       - use a specific percpu irq_chip implementation, and
       - handle them with handle_percpu_irq
      
      This makes the path for delivering these interrupts more efficient
      (no masking/unmasking, no locks), and it avoid problems with attempts
      to migrate them.
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: Stable Kernel <stable@kernel.org>
      aaca4964