1. 03 Mar, 2011 4 commits
    • Ian Campbell's avatar
      xen: events: allocate GSIs and dynamic IRQs from separate IRQ ranges. · 89911501
      Ian Campbell authored
      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: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      89911501
    • Ian Campbell's avatar
      xen: events: add xen_allocate_irq_{dynamic, gsi} and xen_free_irq · c9df1ce5
      Ian Campbell authored
      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: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      c9df1ce5
    • Ian Campbell's avatar
      xen:events: move find_unbound_irq inside CONFIG_PCI_MSI · cbf6aa89
      Ian Campbell authored
      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: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      cbf6aa89
    • Ian Campbell's avatar
      xen: handled remapped IRQs when enabling a pcifront PCI device. · 3f2a230c
      Ian Campbell authored
      This happens to not be an issue currently because we take pains to try
      to ensure that the GSI-IRQ mapping is 1-1 in a PV guest and that
      regular event channels do not clash. However a subsequent patch is
      going to break this 1-1 mapping.
      Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      3f2a230c
  2. 08 Feb, 2011 1 commit
  3. 07 Feb, 2011 28 commits
  4. 06 Feb, 2011 7 commits