1. 30 9月, 2016 1 次提交
    • K
      xen: Remove event channel notification through Xen PCI platform device · 72a9b186
      KarimAllah Ahmed 提交于
      Ever since commit 254d1a3f ("xen/pv-on-hvm kexec: shutdown watches
      from old kernel") using the INTx interrupt from Xen PCI platform
      device for event channel notification would just lockup the guest
      during bootup.  postcore_initcall now calls xs_reset_watches which
      will eventually try to read a value from XenStore and will get stuck
      on read_reply at XenBus forever since the platform driver is not
      probed yet and its INTx interrupt handler is not registered yet. That
      means that the guest can not be notified at this moment of any pending
      event channels and none of the per-event handlers will ever be invoked
      (including the XenStore one) and the reply will never be picked up by
      the kernel.
      
      The exact stack where things get stuck during xenbus_init:
      
      -xenbus_init
       -xs_init
        -xs_reset_watches
         -xenbus_scanf
          -xenbus_read
           -xs_single
            -xs_single
             -xs_talkv
      
      Vector callbacks have always been the favourite event notification
      mechanism since their introduction in commit 38e20b07 ("x86/xen:
      event channels delivery on HVM.") and the vector callback feature has
      always been advertised for quite some time by Xen that's why INTx was
      broken for several years now without impacting anyone.
      
      Luckily this also means that event channel notification through INTx
      is basically dead-code which can be safely removed without impacting
      anybody since it has been effectively disabled for more than 4 years
      with nobody complaining about it (at least as far as I'm aware of).
      
      This commit removes event channel notification through Xen PCI
      platform device.
      
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: David Vrabel <david.vrabel@citrix.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: x86@kernel.org
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Julien Grall <julien.grall@citrix.com>
      Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Ross Lagerwall <ross.lagerwall@citrix.com>
      Cc: xen-devel@lists.xenproject.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-pci@vger.kernel.org
      Cc: Anthony Liguori <aliguori@amazon.com>
      Signed-off-by: NKarimAllah Ahmed <karahmed@amazon.de>
      Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      72a9b186
  2. 14 7月, 2016 1 次提交
    • P
      x86: Audit and remove any remaining unnecessary uses of module.h · eb008eb6
      Paul Gortmaker 提交于
      Historically a lot of these existed because we did not have
      a distinction between what was modular code and what was providing
      support to modules via EXPORT_SYMBOL and friends.  That changed
      when we forked out support for the latter into the export.h file.
      
      This means we should be able to reduce the usage of module.h
      in code that is obj-y Makefile or bool Kconfig.  In the case of
      some of these which are modular, we can extend that to also include
      files that are building basic support functionality but not related
      to loading or registering the final module; such files also have
      no need whatsoever for module.h
      
      The advantage in removing such instances is that module.h itself
      sources about 15 other headers; adding significantly to what we feed
      cpp, and it can obscure what headers we are effectively using.
      
      Since module.h was the source for init.h (for __init) and for
      export.h (for EXPORT_SYMBOL) we consider each instance for the
      presence of either and replace as needed.
      
      In the case of crypto/glue_helper.c we delete a redundant instance
      of MODULE_LICENSE in order to delete module.h -- the license info
      is already present at the top of the file.
      
      The uncore change warrants a mention too; it is uncore.c that uses
      module.h and not uncore.h; hence the relocation done there.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20160714001901.31603-9-paul.gortmaker@windriver.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      eb008eb6
  3. 24 5月, 2016 1 次提交
  4. 13 4月, 2016 1 次提交
  5. 15 2月, 2016 1 次提交
  6. 23 7月, 2015 1 次提交
  7. 28 1月, 2015 1 次提交
    • Y
      PCI: Fail MSI-X mappings if there's no space assigned to MSI-X BAR · 6a878e50
      Yijing Wang 提交于
      Unlike MSI, which is configured via registers in the MSI capability in
      Configuration Space, MSI-X is configured via tables in Memory Space.
      These MSI-X tables are mapped by a device BAR, and if no Memory Space
      has been assigned to the BAR, MSI-X cannot be used.
      
      Fail MSI-X setup if no space has been assigned for the BAR.
      
      Previously, we ioremapped the MSI-X table even if the resource hadn't been
      assigned.  In this case, the resource address is undefined (and is often
      zero), which may lead to warnings or oopses in this path:
      
        pci_enable_msix
          msix_capability_init
            msix_map_region
              ioremap_nocache
      
      The PCI core sets resource flags to zero when it can't assign space for the
      resource (see reset_resource()).  There are also some cases where it sets
      the IORESOURCE_UNSET flag, e.g., pci_reassigndev_resource_alignment(),
      pci_assign_resource(), etc.  So we must check for both cases.
      
      [bhelgaas: changelog]
      Reported-by: NZhang Jukuo <zhangjukuo@huawei.com>
      Tested-by: NZhang Jukuo <zhangjukuo@huawei.com>
      Signed-off-by: NYijing Wang <wangyijing@huawei.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      6a878e50
  8. 20 1月, 2015 2 次提交
  9. 04 12月, 2014 2 次提交
  10. 23 11月, 2014 2 次提交
  11. 12 11月, 2014 1 次提交
  12. 07 11月, 2014 1 次提交
    • Y
      PCI/MSI: Add pci_msi_ignore_mask to prevent writes to MSI/MSI-X Mask Bits · 38737d82
      Yijing Wang 提交于
      MSI-X vector Mask Bits are in MSI-X Tables in PCI memory space.  Xen PV
      guests can't write to those tables.  MSI vector Mask Bits are in PCI
      configuration space.  Xen PV guests can write to config space, but those
      writes are ignored.
      
      Commit 0e4ccb15 ("PCI: Add x86_msi.msi_mask_irq() and
      msix_mask_irq()") added a way to override default_mask_msi_irqs() and
      default_mask_msix_irqs() so they can be no-ops in Xen guests, but this is
      more complicated than necessary.
      
      Add "pci_msi_ignore_mask" in the core PCI MSI code.  If set,
      default_mask_msi_irqs() and default_mask_msix_irqs() return without doing
      anything.  This is less flexible, but much simpler.
      
      [bhelgaas: changelog]
      Signed-off-by: NYijing Wang <wangyijing@huawei.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NDavid Vrabel <david.vrabel@citrix.com>
      CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      CC: xen-devel@lists.xenproject.org
      38737d82
  13. 22 6月, 2014 1 次提交
  14. 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
  15. 13 12月, 2013 1 次提交
  16. 07 11月, 2013 1 次提交
    • K
      PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq() · 0e4ccb15
      Konrad Rzeszutek Wilk 提交于
      Certain platforms do not allow writes in the MSI-X BARs to setup or tear
      down vector values.  To combat against the generic code trying to write to
      that and either silently being ignored or crashing due to the pagetables
      being marked R/O this patch introduces a platform override.
      
      Note that we keep two separate, non-weak, functions default_mask_msi_irqs()
      and default_mask_msix_irqs() for the behavior of the arch_mask_msi_irqs()
      and arch_mask_msix_irqs(), as the default behavior is needed by x86 PCI
      code.
      
      For Xen, which does not allow the guest to write to MSI-X tables - as the
      hypervisor is solely responsible for setting the vector values - we
      implement two nops.
      
      This fixes a Xen guest crash when passing a PCI device with MSI-X to the
      guest.  See the bugzilla for more details.
      
      [bhelgaas: add bugzilla info]
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=64581Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
      CC: Zhenzhong Duan <zhenzhong.duan@oracle.com>
      0e4ccb15
  17. 10 5月, 2013 2 次提交
  18. 17 4月, 2013 1 次提交
  19. 01 3月, 2013 1 次提交
    • K
      xen/pci: We don't do multiple MSI's. · 884ac297
      Konrad Rzeszutek Wilk 提交于
      There is no hypercall to setup multiple MSI per PCI device.
      As such with these two new commits:
      -  08261d87
         PCI/MSI: Enable multiple MSIs with pci_enable_msi_block_auto()
      - 5ca72c4f
         AHCI: Support multiple MSIs
      
      we would call the PHYSDEVOP_map_pirq 'nvec' times with the same
      contents of the PCI device. Sander discovered that we would get
      the same PIRQ value 'nvec' times and return said values to the
      caller. That of course meant that the device was configured only
      with one MSI and AHCI would fail with:
      
      ahci 0000:00:11.0: version 3.0
      xen: registering gsi 19 triggering 0 polarity 1
      xen: --> pirq=19 -> irq=19 (gsi=19)
      (XEN) [2013-02-27 19:43:07] IOAPIC[0]: Set PCI routing entry (6-19 -> 0x99 -> IRQ 19 Mode:1 Active:1)
      ahci 0000:00:11.0: AHCI 0001.0200 32 slots 4 ports 6 Gbps 0xf impl SATA mode
      ahci 0000:00:11.0: flags: 64bit ncq sntf ilck pm led clo pmp pio slum part
      ahci: probe of 0000:00:11.0 failed with error -22
      
      That is b/c in ahci_host_activate the second call to
      devm_request_threaded_irq  would return -EINVAL as we passed in
      (on the second run) an IRQ that was never initialized.
      
      CC: stable@vger.kernel.org
      Reported-and-Tested-by: NSander Eikelenboom <linux@eikelenboom.it>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      884ac297
  20. 22 5月, 2012 1 次提交
  21. 04 2月, 2012 1 次提交
  22. 13 1月, 2012 1 次提交
  23. 20 10月, 2011 1 次提交
  24. 23 9月, 2011 1 次提交
  25. 12 7月, 2011 10 次提交
  26. 08 7月, 2011 1 次提交
  27. 30 6月, 2011 1 次提交
    • K
      xen/pci: Use the INT_SRC_OVR IRQ (instead of GSI) to preset the ACPI SCI IRQ. · 155a16f2
      Konrad Rzeszutek Wilk 提交于
      In the past we would use the GSI value to preset the ACPI SCI
      IRQ which worked great as GSI == IRQ:
      
      ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)
      
      While that is most often seen, there are some oddities:
      
      ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 20 low level)
      
      which means that GSI 20 (or pin 20) is to be overriden for IRQ 9.
      Our code that presets the interrupt for ACPI SCI however would
      use the GSI 20 instead of IRQ 9 ending up with:
      
      xen: sci override: global_irq=20 trigger=0 polarity=1
      xen: registering gsi 20 triggering 0 polarity 1
      xen: --> pirq=20 -> irq=20
      xen: acpi sci 20
      .. snip..
      calling  acpi_init+0x0/0xbc @ 1
      ACPI: SCI (IRQ9) allocation failed
      ACPI Exception: AE_NOT_ACQUIRED, Unable to install System Control Interrupt handler (20110413/evevent-119)
      ACPI: Unable to start the ACPI Interpreter
      
      as the ACPI interpreter made a call to 'acpi_gsi_to_irq' which got nine.
      It used that value to request an IRQ (request_irq) and since that was not
      present it failed.
      
      The fix is to recognize that for interrupts that are overriden (in our
      case we only care about the ACPI SCI) we should use the IRQ number
      to present the IRQ instead of the using GSI. End result is that we get:
      
      xen: sci override: global_irq=20 trigger=0 polarity=1
      xen: registering gsi 20 triggering 0 polarity 1
      xen: --> pirq=20 -> irq=9 (gsi=9)
      xen: acpi sci 9
      
      which fixes the ACPI interpreter failing on startup.
      
      CC: stable@kernel.org
      Reported-by: NLiwei <xieliwei@gmail.com>
      Tested-by: NLiwei <xieliwei@gmail.com>
      [http://lists.xensource.com/archives/html/xen-devel/2011-06/msg01727.html]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      155a16f2