1. 04 4月, 2016 1 次提交
    • B
      xen/events: Mask a moving irq · ff1e22e7
      Boris Ostrovsky 提交于
      Moving an unmasked irq may result in irq handler being invoked on both
      source and target CPUs.
      
      With 2-level this can happen as follows:
      
      On source CPU:
              evtchn_2l_handle_events() ->
                  generic_handle_irq() ->
                      handle_edge_irq() ->
                         eoi_pirq():
                             irq_move_irq(data);
      
                             /***** WE ARE HERE *****/
      
                             if (VALID_EVTCHN(evtchn))
                                 clear_evtchn(evtchn);
      
      If at this moment target processor is handling an unrelated event in
      evtchn_2l_handle_events()'s loop it may pick up our event since target's
      cpu_evtchn_mask claims that this event belongs to it *and* the event is
      unmasked and still pending. At the same time, source CPU will continue
      executing its own handle_edge_irq().
      
      With FIFO interrupt the scenario is similar: irq_move_irq() may result
      in a EVTCHNOP_unmask hypercall which, in turn, may make the event
      pending on the target CPU.
      
      We can avoid this situation by moving and clearing the event while
      keeping event masked.
      Signed-off-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      ff1e22e7
  2. 21 3月, 2016 1 次提交
  3. 27 11月, 2015 1 次提交
  4. 23 10月, 2015 1 次提交
  5. 09 9月, 2015 1 次提交
  6. 20 8月, 2015 1 次提交
    • J
      xen/events: Support event channel rebind on ARM · 4a5b6946
      Julien Grall 提交于
      Currently, the event channel rebind code is gated with the presence of
      the vector callback.
      
      The virtual interrupt controller on ARM has the concept of per-CPU
      interrupt (PPI) which allow us to support per-VCPU event channel.
      Therefore there is no need of vector callback for ARM.
      
      Xen is already using a free PPI to notify the guest VCPU of an event.
      Furthermore, the xen code initialization in Linux (see
      arch/arm/xen/enlighten.c) is requesting correctly a per-CPU IRQ.
      
      Introduce new helper xen_support_evtchn_rebind to allow architecture
      decide whether rebind an event is support or not. It will always return
      true on ARM and keep the same behavior on x86.
      
      This is also allow us to drop the usage of xen_have_vector_callback
      entirely in the ARM code.
      Signed-off-by: NJulien Grall <julien.grall@citrix.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      4a5b6946
  7. 11 8月, 2015 1 次提交
  8. 04 8月, 2015 1 次提交
    • R
      xen/events/fifo: Handle linked events when closing a port · fcdf31a7
      Ross Lagerwall 提交于
      An event channel bound to a CPU that was offlined may still be linked
      on that CPU's queue.  If this event channel is closed and reused,
      subsequent events will be lost because the event channel is never
      unlinked and thus cannot be linked onto the correct queue.
      
      When a channel is closed and the event is still linked into a queue,
      ensure that it is unlinked before completing.
      
      If the CPU to which the event channel bound is online, spin until the
      event is handled by that CPU. If that CPU is offline, it can't handle
      the event, so clear the event queue during the close, dropping the
      events.
      
      This fixes the missing interrupts (and subsequent disk stalls etc.)
      when offlining a CPU.
      Signed-off-by: NRoss Lagerwall <ross.lagerwall@citrix.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      fcdf31a7
  9. 14 7月, 2015 1 次提交
  10. 17 6月, 2015 1 次提交
  11. 20 5月, 2015 1 次提交
    • D
      xen/events: don't bind non-percpu VIRQs with percpu chip · 77bb3dfd
      David Vrabel 提交于
      A non-percpu VIRQ (e.g., VIRQ_CONSOLE) may be freed on a different
      VCPU than it is bound to.  This can result in a race between
      handle_percpu_irq() and removing the action in __free_irq() because
      handle_percpu_irq() does not take desc->lock.  The interrupt handler
      sees a NULL action and oopses.
      
      Only use the percpu chip/handler for per-CPU VIRQs (like VIRQ_TIMER).
      
        # cat /proc/interrupts | grep virq
         40:      87246          0  xen-percpu-virq      timer0
         44:          0          0  xen-percpu-virq      debug0
         47:          0      20995  xen-percpu-virq      timer1
         51:          0          0  xen-percpu-virq      debug1
         69:          0          0   xen-dyn-virq      xen-pcpu
         74:          0          0   xen-dyn-virq      mce
         75:         29          0   xen-dyn-virq      hvc_console
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Cc: <stable@vger.kernel.org>
      77bb3dfd
  12. 06 5月, 2015 2 次提交
    • B
      xen/events: Set irq_info->evtchn before binding the channel to CPU in __startup_pirq() · 16e6bd59
      Boris Ostrovsky 提交于
      .. because bind_evtchn_to_cpu(evtchn, cpu) will map evtchn to
      'info' and pass 'info' down to xen_evtchn_port_bind_to_cpu().
      Signed-off-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Tested-by: NAnnie Li <annie.li@oracle.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      16e6bd59
    • B
      xen/events: Clear cpu_evtchn_mask before resuming · 5cec9883
      Boris Ostrovsky 提交于
      When a guest is resumed, the hypervisor may change event channel
      assignments. If this happens and the guest uses 2-level events it
      is possible for the interrupt to be claimed by wrong VCPU since
      cpu_evtchn_mask bits may be stale. This can happen even though
      evtchn_2l_bind_to_cpu() attempts to clear old bits: irq_info that
      is passed in is not necessarily the original one (from pre-migration
      times) but instead is freshly allocated during resume and so any
      information about which CPU the channel was bound to is lost.
      
      Thus we should clear the mask during resume.
      
      We also need to make sure that bits for xenstore and console channels
      are set when these two subsystems are resumed. While rebind_evtchn_irq()
      (which is invoked for both of them on a resume) calls irq_set_affinity(),
      the latter will in fact postpone setting affinity until handling the
      interrupt. But because cpu_evtchn_mask will have bits for these two
      cleared we won't be able to take the interrupt.
      
      With that in mind, we need to bind those two channels explicitly in
      rebind_evtchn_irq(). We will keep irq_set_affinity() so that we have a
      pass through generic irq affinity code later, in case something needs
      to be updated there as well.
      
      (Also replace cpumask_of(0) with cpumask_of(info->cpu) in
      rebind_evtchn_irq(): it should be set to zero in preceding
      xen_irq_info_evtchn_setup().)
      Signed-off-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Reported-by: NAnnie Li <annie.li@oracle.com>
      Cc: <stable@vger.kernel.org> # 3.14+
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      5cec9883
  13. 06 3月, 2015 1 次提交
    • J
      xen/events: avoid NULL pointer dereference in dom0 on large machines · 85e40b05
      Juergen Gross 提交于
      Using the pvops kernel a NULL pointer dereference was detected on a
      large machine (144 processors) when booting as dom0 in
      evtchn_fifo_unmask() during assignment of a pirq.
      
      The event channel in question was the first to need a new entry in
      event_array[] in events_fifo.c. Unfortunately xen_irq_info_pirq_setup()
      is called with evtchn being 0 for a new pirq and the real event channel
      number is assigned to the pirq only during __startup_pirq().
      
      It is mandatory to call xen_evtchn_port_setup() after assigning the
      event channel number to the pirq to make sure all memory needed for the
      event channel is allocated.
      Signed-off-by: NJuergen Gross <jgross@suse.com>
      Cc: <stable@vger.kernel.org> # 3.14+
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      85e40b05
  14. 23 9月, 2014 1 次提交
  15. 01 8月, 2014 1 次提交
  16. 16 5月, 2014 1 次提交
  17. 07 4月, 2014 1 次提交
    • A
      Xen: do hv callback accounting only on x86 · d06eb3ee
      Arnd Bergmann 提交于
      Patch 99c8b79d "xen: Add proper irq accounting for HYPERCALL vector"
      added a call to inc_irq_stat(irq_hv_callback_count) in common Xen code,
      however both the inc_irq_stat function and the irq_hv_callback_count
      counter are architecture specific.
      
      This makes the code build again on ARM by moving the call into the
      existing #ifdef CONFIG_X86. We may want to later do the same implementation
      on ARM that x86 has though.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Xen <xen-devel@lists.xenproject.org>
      d06eb3ee
  18. 18 3月, 2014 1 次提交
    • R
      xen: add support for MSI message groups · 4892c9b4
      Roger Pau Monne 提交于
      Add support for MSI message groups for Xen Dom0 using the
      MAP_PIRQ_TYPE_MULTI_MSI pirq map type.
      
      In order to keep track of which pirq is the first one in the group all
      pirqs in the MSI group except for the first one have the newly
      introduced PIRQ_MSI_GROUP flag set. This prevents calling
      PHYSDEVOP_unmap_pirq on them, since the unmap must be done with the
      first pirq in the group.
      Signed-off-by: NRoger Pau Monné <roger.pau@citrix.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      4892c9b4
  19. 12 3月, 2014 1 次提交
  20. 05 3月, 2014 3 次提交
  21. 01 3月, 2014 2 次提交
  22. 11 2月, 2014 1 次提交
  23. 06 1月, 2014 14 次提交