1. 09 9月, 2015 2 次提交
  2. 28 5月, 2015 1 次提交
  3. 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
  4. 06 5月, 2015 1 次提交
  5. 06 10月, 2014 1 次提交
  6. 29 9月, 2014 1 次提交
  7. 08 2月, 2014 1 次提交
    • P
      drivers/tty/hvc: don't use module_init in non-modular hyp. console code · 4fedd0bf
      Paul Gortmaker 提交于
      The HVC_OPAL/RTAS/UDBG/XEN options are all bool, and hence their support
      is either present or absent.  It will never be modular, so using
      module_init as an alias for __initcall is rather misleading.
      
      Fix this up now, so that we can relocate module_init from
      init.h into module.h in the future.  If we don't do this, we'd
      have to add module.h to obviously non-modular code, and that
      would be a worse thing.
      
      Note that direct use of __initcall is discouraged, vs. one
      of the priority categorized subgroups.  As __initcall gets
      mapped onto device_initcall, our use of device_initcall
      directly in this change means that the runtime impact is
      zero -- it will remain at level 6 in initcall ordering.
      
      Also the __exitcall functions have been outright deleted since
      they are only ever of interest to UML, and UML will never be
      using any of this code.
      
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Acked-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4fedd0bf
  8. 04 10月, 2013 1 次提交
  9. 30 9月, 2013 1 次提交
    • K
      xen/hvc: If we use xen_raw_printk let it also work on HVM guests. · 04b772d2
      Konrad Rzeszutek Wilk 提交于
      The xen_raw_printk works great for debugging purposes. We use
      for PV guests and we can also use it for HVM guests.
      
      However, for HVM guests we have a fallback of using the 0xe9
      port in case the hypervisor does not support an HVM guest of
      using the console_io hypercall. As such lets use 0xe9 during
      early bootup, and once the hyper-page is setup and if the
      console_io hypercall is supported - use that. Otherwise we
      will fallback to using the 0xe9 after early bootup.
      
      We also alter the return value for dom0_write_console to return
      an error value instead of zero. The HVC API has been supporting
      returning error values for quite some time.
      
      P.S.
      To use (and to see the output in the Xen ring buffer) one has to build
      the hypervisor with 'debug=y'.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      [v1: ifdef xen_cpuid_base as it is X86 specific]
      04b772d2
  10. 31 8月, 2013 2 次提交
  11. 20 2月, 2013 1 次提交
  12. 22 11月, 2012 1 次提交
  13. 04 10月, 2012 1 次提交
  14. 22 8月, 2012 1 次提交
  15. 20 7月, 2012 1 次提交
  16. 25 5月, 2012 3 次提交
  17. 21 5月, 2012 1 次提交
  18. 15 5月, 2012 1 次提交
  19. 14 3月, 2012 3 次提交
  20. 27 1月, 2012 1 次提交
    • A
      serial: Kill off NO_IRQ · d4e33fac
      Alan Cox 提交于
      We transform the offenders into a test of irq <= 0 which will be ok while
      the ARM people get their platform sorted. Once that is done (or in a while
      if they don't do it anyway) then we will change them all to !irq checks.
      
      For arch specific drivers that are already using NO_IRQ = 0 we just test
      against zero so we don't need to re-review them later.
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d4e33fac
  21. 29 3月, 2011 1 次提交
  22. 10 3月, 2011 1 次提交
    • K
      xen/hvc: Disable probe_irq_on/off from poking the hvc-console IRQ line. · bbd5a762
      Konrad Rzeszutek Wilk 提交于
      This fixes a particular nasty racing problem found when using
      Xen hypervisor with the console (hvc) output being routed to the
      serial port and the serial port receiving data when
      probe_irq_off(probe_irq_on) is running.
      
      Specifically the bug manifests itself with:
      
      [    4.470693] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
      [    4.470693] IP: [<ffffffff810a8c65>] handle_IRQ_event+0xe/0xc9
      ..snip..
      [    4.470693] Call Trace:
      [    4.470693]  <IRQ>
      [    4.470693]  [<ffffffff810aa645>] handle_percpu_irq+0x3c/0x69
      [    4.470693]  [<ffffffff8123cda7>] __xen_evtchn_do_upcall+0xfd/0x195
      [    4.470693]  [<ffffffff810308cf>] ? xen_restore_fl_direct_end+0x0/0x1
      [    4.470693]  [<ffffffff8123d873>] xen_evtchn_do_upcall+0x32/0x47
      [    4.470693]  [<ffffffff81034dfe>] xen_do_hypervisor_callback+0x1e/0x30
      [    4.470693]  <EOI>
      [    4.470693]  [<ffffffff8100922a>] ? hypercall_page+0x22a/0x1000
      [    4.470693]  [<ffffffff8100922a>] ? hypercall_page+0x22a/0x1000
      [    4.470693]  [<ffffffff810301c5>] ? xen_force_evtchn_callback+0xd/0xf
      [    4.470693]  [<ffffffff810308e2>] ? check_events+0x12/0x20
      [    4.470693]  [<ffffffff81030889>] ? xen_irq_enable_direct_end+0x0/0x7
      [    4.470693]  [<ffffffff810ab0a0>] ? probe_irq_on+0x8f/0x1d7
      [    4.470693]  [<ffffffff812b105e>] ? serial8250_config_port+0x7b7/0x9e6
      [    4.470693]  [<ffffffff812ad66c>] ? uart_add_one_port+0x11b/0x305
      
      The bug is trigged by three actors working together:
       A). serial_8250_config_port calling
      	probe_irq_off(probe_irq_on())
           wherein all of the IRQ handlers are being started and shut off.
           The functions utilize the sleep functions so the minimum time
           they are run is 120 msec.
       B). Xen hypervisor receiving on the serial line any character and
           setting the bits in the event channel - during this 120 msec timeframe.
       C). The hvc API makes a call to 'request_irq' (and hence setting desc->action
           to a valid value), much much later - when user space opens
           /dev/console (hvc_open). To make the console usable during bootup,
           the Xen HVC implementation sets the IRQ chip (and correspondingly
           the event channel) much earlier. The IRQ chip handler that is used
           is the handle_percpu_irq (aaca4964)
      
      Back to the issue. When A) is being called it ends up calling the
      xen_percpu_chip's chip->startup twice and chip->shutdown once. Those
      are set to the default_startup and mask_irq (events.c) respectivly.
      If (and this seems to depend on what serial concentrator you use), B)
      gets data from the serial port it sets in the event channel a pending bit.
      When A) calls chip->startup(), the masking of the pending bit, and
      unmasking of the event channel mask, and also setting of the upcall_pending
      flag is done (since there is data present on the event channel).
      If before the 120 msec has elapsed, any IRQ handler (Xen IRQ has one
      IRQ handler, which checks the event channels bitmap to figure which one
      to call) is called we end up calling the handle_percpu_irq. The
      handle_percpu_irq calls desc->action (which is NULL) and we blow up.
      
      Caveats: I could only reproduce this on 2.6.32 pvops. I am not sure
      why this is not showing up on 2.6.38 kernel.
      
      The probe_irq_on/off has code to disable poking specific IRQ lines. This is
      done by using the set_irq_noprobe() and then we do not have to
      worry about the handle_percpu_irq being called before the IRQ action
      handler has been installed.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      bbd5a762
  23. 14 1月, 2011 1 次提交
  24. 23 10月, 2010 2 次提交
  25. 24 2月, 2010 1 次提交
  26. 03 2月, 2010 1 次提交
  27. 05 11月, 2009 1 次提交
  28. 04 11月, 2009 1 次提交
  29. 22 10月, 2008 1 次提交
  30. 20 8月, 2008 1 次提交
  31. 25 7月, 2008 1 次提交
    • C
      hvc_console: rework setup to replace irq functions with callbacks · 611e097d
      Christian Borntraeger 提交于
      This patch tries to change hvc_console to not use request_irq/free_irq if
      the backend does not use irqs. This allows virtio_console to use hvc_console
      without having a linker reference to request_irq/free_irq.
      
      In addition, together with patch 2/3 it improves the performance for virtio
      console input. (an earlier version of this patch was tested by Yajin on lguest)
      
      The irq specific code is moved to hvc_irq.c and selected by the drivers that
      use irqs (System p, System i, XEN).
      
      I replaced "int irq" with the opaque "int data". The request_irq and
      free_irq calls are replaced with notifier_add and notifier_del. I have also
      changed the code a bit to call the notifier_add and notifier_del inside the
      spinlock area as the callbacks are found via hp->ops.
      
      Changes since last version:
      o remove ifdef
      o reintroduce "irq_requested" as "notified"
      o cleanups, sparse..
      
      I did not move the timer based polling into a separate polling scheme. I
      played with several variants, but it seems we need to sleep/schedule in
      a thread even for irq based consoles, as there are throttleing and buffer
      size constraints.
      
      I also kept hvc_struct defined in hvc_console.h so that hvc_irq.c can access
      the irq_requested element.
      
      Feedback is appreciated. virtio_console is currently the only available console
      for kvm on s390. I plan to push this change as soon as all affected parties
      agree on it. I would love to get test results from System p, Xen etc.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      611e097d
  32. 27 5月, 2008 2 次提交