1. 26 2月, 2019 2 次提交
    • L
      iommu/vt-d: Allow interrupts from the entire bus for aliased devices · 3f0c625c
      Logan Gunthorpe 提交于
      When a device has multiple aliases that all are from the same bus,
      we program the IRTE to accept requests from any matching device on the
      bus.
      
      This is so NTB devices which can have requests from multiple bus-devfns
      can pass MSI interrupts through across the bridge.
      Signed-off-by: NLogan Gunthorpe <logang@deltatee.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      3f0c625c
    • L
      iommu/vt-d: Add helper to set an IRTE to verify only the bus number · 9ca82611
      Logan Gunthorpe 提交于
      The current code uses set_irte_sid() with SVT_VERIFY_BUS and PCI_DEVID
      to set the SID value. However, this is very confusing because, with
      SVT_VERIFY_BUS, the SID value is not a PCI devfn address, but the start
      and end bus numbers to match against.
      
      According to the Intel Virtualization Technology for Directed I/O
      Architecture Specification, Rev. 3.0, page 9-36:
      
        The most significant 8-bits of the SID field contains the Startbus#,
        and the least significant 8-bits of the SID field contains the Endbus#.
        Interrupt requests that reference this IRTE must have a requester-id
        whose bus# (most significant 8-bits of requester-id) has a value equal
        to or within the Startbus# to Endbus# range.
      
      So to make this more clear, introduce a new set_irte_verify_bus() that
      explicitly takes a start bus and end bus so that we can stop abusing
      the PCI_DEVID macro.
      
      This helper function will be called a second time in an subsequent patch.
      Signed-off-by: NLogan Gunthorpe <logang@deltatee.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      9ca82611
  2. 11 12月, 2018 1 次提交
    • L
      iommu/vt-d: Add 256-bit invalidation descriptor support · 5d308fc1
      Lu Baolu 提交于
      Intel vt-d spec rev3.0 requires software to use 256-bit
      descriptors in invalidation queue. As the spec reads in
      section 6.5.2:
      
      Remapping hardware supporting Scalable Mode Translations
      (ECAP_REG.SMTS=1) allow software to additionally program
      the width of the descriptors (128-bits or 256-bits) that
      will be written into the Queue. Software should setup the
      Invalidation Queue for 256-bit descriptors before progra-
      mming remapping hardware for scalable-mode translation as
      128-bit descriptors are treated as invalid descriptors
      (see Table 21 in Section 6.5.2.10) in scalable-mode.
      
      This patch adds 256-bit invalidation descriptor support
      if the hardware presents scalable mode capability.
      
      Cc: Ashok Raj <ashok.raj@intel.com>
      Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
      Cc: Kevin Tian <kevin.tian@intel.com>
      Signed-off-by: NSanjay Kumar <sanjay.k.kumar@intel.com>
      Signed-off-by: NLiu Yi L <yi.l.liu@intel.com>
      Signed-off-by: NLu Baolu <baolu.lu@linux.intel.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      5d308fc1
  3. 25 9月, 2018 1 次提交
  4. 06 6月, 2018 1 次提交
    • T
      irq_remapping: Use apic_ack_irq() · 8a2b7d14
      Thomas Gleixner 提交于
      To address the EBUSY fail of interrupt affinity settings in case that the
      previous setting has not been cleaned up yet, use the new apic_ack_irq()
      function instead of the special ir_ack_apic_edge() implementation which is
      merily a wrapper around ack_APIC_irq().
      
      Preparatory change for the real fix
      
      Fixes: dccfe314 ("x86/vector: Simplify vector move cleanup")
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NSong Liu <songliubraving@fb.com>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <liu.song.a23@gmail.com>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: stable@vger.kernel.org
      Cc: Mike Travis <mike.travis@hpe.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Tariq Toukan <tariqt@mellanox.com>
      Link: https://lkml.kernel.org/r/20180604162224.555716895@linutronix.de
      8a2b7d14
  5. 03 5月, 2018 1 次提交
    • J
      iommu/vt-d: Fix usage of force parameter in intel_ir_reconfigure_irte() · aa7528fe
      Jagannathan Raman 提交于
      It was noticed that the IRTE configured for guest OS kernel
      was over-written while the guest was running. As a result,
      vt-d Posted Interrupts configured for the guest are not being
      delivered directly, and instead bounces off the host. Every
      interrupt delivery takes a VM Exit.
      
      It was noticed that the following stack is doing the over-write:
      [  147.463177]  modify_irte+0x171/0x1f0
      [  147.463405]  intel_ir_set_affinity+0x5c/0x80
      [  147.463641]  msi_domain_set_affinity+0x32/0x90
      [  147.463881]  irq_do_set_affinity+0x37/0xd0
      [  147.464125]  irq_set_affinity_locked+0x9d/0xb0
      [  147.464374]  __irq_set_affinity+0x42/0x70
      [  147.464627]  write_irq_affinity.isra.5+0xe1/0x110
      [  147.464895]  proc_reg_write+0x38/0x70
      [  147.465150]  __vfs_write+0x36/0x180
      [  147.465408]  ? handle_mm_fault+0xdf/0x200
      [  147.465671]  ? _cond_resched+0x15/0x30
      [  147.465936]  vfs_write+0xad/0x1a0
      [  147.466204]  SyS_write+0x52/0xc0
      [  147.466472]  do_syscall_64+0x74/0x1a0
      [  147.466744]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
      
      reversing the sense of force check in intel_ir_reconfigure_irte()
      restores proper posted interrupt functionality
      Signed-off-by: NJagannathan Raman <jag.raman@oracle.com>
      Fixes: d491bdff ('iommu/vt-d: Reevaluate vector configuration on activate()')
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      aa7528fe
  6. 30 12月, 2017 1 次提交
    • T
      genirq/irqdomain: Rename early argument of irq_domain_activate_irq() · 702cb0a0
      Thomas Gleixner 提交于
      The 'early' argument of irq_domain_activate_irq() is actually used to
      denote reservation mode. To avoid confusion, rename it before abuse
      happens.
      
      No functional change.
      
      Fixes: 72491643 ("genirq/irqdomain: Update irq_domain_ops.activate() signature")
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Alexandru Chirvasitu <achirvasub@gmail.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Maciej W. Rozycki <macro@linux-mips.org>
      Cc: Mikael Pettersson <mikpelinux@gmail.com>
      Cc: Josh Poulson <jopoulso@microsoft.com>
      Cc: Mihai Costache <v-micos@microsoft.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: linux-pci@vger.kernel.org
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Dexuan Cui <decui@microsoft.com>
      Cc: Simon Xiao <sixiao@microsoft.com>
      Cc: Saeed Mahameed <saeedm@mellanox.com>
      Cc: Jork Loeser <Jork.Loeser@microsoft.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: devel@linuxdriverproject.org
      Cc: KY Srinivasan <kys@microsoft.com>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: Sakari Ailus <sakari.ailus@intel.com>,
      Cc: linux-media@vger.kernel.org
      702cb0a0
  7. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  8. 26 9月, 2017 2 次提交
    • T
      iommu/vt-d: Reevaluate vector configuration on activate() · d491bdff
      Thomas Gleixner 提交于
      With the upcoming reservation/management scheme, early activation will
      assign a special vector. The final activation at request_irq() assigns a
      real vector, which needs to be updated in the tables.
      
      Split out the reconfiguration code in set_affinity and use it for
      reactivation.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NJuergen Gross <jgross@suse.com>
      Tested-by: NYu Chen <yu.c.chen@intel.com>
      Acked-by: NJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: iommu@lists.linux-foundation.org
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213155.853028808@linutronix.de
      d491bdff
    • T
      genirq/irqdomain: Update irq_domain_ops.activate() signature · 72491643
      Thomas Gleixner 提交于
      The irq_domain_ops.activate() callback has no return value and no way to
      tell the function that the activation is early.
      
      The upcoming changes to support a reservation scheme which allows to assign
      interrupt vectors on x86 only when the interrupt is actually requested
      requires:
      
        - A return value, so activation can fail at request_irq() time
        
        - Information that the activate invocation is early, i.e. before
          request_irq().
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NJuergen Gross <jgross@suse.com>
      Tested-by: NYu Chen <yu.c.chen@intel.com>
      Acked-by: NJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213152.848490816@linutronix.de
      72491643
  9. 23 6月, 2017 2 次提交
  10. 30 5月, 2017 1 次提交
  11. 29 4月, 2017 1 次提交
    • Q
      iommu/vt-d: Don't print the failure message when booting non-kdump kernel · 8e121884
      Qiuxu Zhuo 提交于
      When booting a new non-kdump kernel, we have below failure message:
      
      [    0.004000] DMAR-IR: IRQ remapping was enabled on dmar2 but we are not in kdump mode
      [    0.004000] DMAR-IR: Failed to copy IR table for dmar2 from previous kernel
      [    0.004000] DMAR-IR: IRQ remapping was enabled on dmar1 but we are not in kdump mode
      [    0.004000] DMAR-IR: Failed to copy IR table for dmar1 from previous kernel
      [    0.004000] DMAR-IR: IRQ remapping was enabled on dmar0 but we are not in kdump mode
      [    0.004000] DMAR-IR: Failed to copy IR table for dmar0 from previous kernel
      [    0.004000] DMAR-IR: IRQ remapping was enabled on dmar3 but we are not in kdump mode
      [    0.004000] DMAR-IR: Failed to copy IR table for dmar3 from previous kernel
      
      For non-kdump case, we no need to copy IR table from previous kernel
      so it's nonthing actually failed. To be less alarming or misleading,
      do not print "DMAR-IR: Failed to copy IR table for dmar[0-9] from
      previous kernel" messages when booting non-kdump kernel.
      Signed-off-by: NQiuxu Zhuo <qiuxu.zhuo@intel.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      8e121884
  12. 14 1月, 2016 1 次提交
  13. 19 12月, 2015 1 次提交
  14. 02 11月, 2015 1 次提交
  15. 23 10月, 2015 2 次提交
  16. 15 10月, 2015 1 次提交
  17. 14 10月, 2015 1 次提交
  18. 14 8月, 2015 1 次提交
  19. 03 8月, 2015 1 次提交
  20. 16 6月, 2015 8 次提交
  21. 12 6月, 2015 5 次提交
  22. 05 5月, 2015 1 次提交
  23. 24 4月, 2015 3 次提交