1. 05 3月, 2014 1 次提交
  2. 09 1月, 2014 9 次提交
    • J
      iommu/vt-d, trivial: clean sparse warnings · b707cb02
      Jiang Liu 提交于
      Clean up most sparse warnings in Intel DMA and interrupt remapping
      drivers.
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      b707cb02
    • J
      iommu/vt-d: fix wrong return value of dmar_table_init() · cc05301f
      Jiang Liu 提交于
      If dmar_table_init() fails to detect DMAR table on the first call,
      it will return wrong result on following calls because it always
      sets dmar_table_initialized no matter if succeeds or fails to
      detect DMAR table.
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      cc05301f
    • J
      iommu/vt-d: release invalidation queue when destroying IOMMU unit · a84da70b
      Jiang Liu 提交于
      Release associated invalidation queue when destroying IOMMU unit
      to avoid memory leak.
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      a84da70b
    • J
      iommu/vt-d: keep shared resources when failed to initialize iommu devices · a868e6b7
      Jiang Liu 提交于
      Data structure drhd->iommu is shared between DMA remapping driver and
      interrupt remapping driver, so DMA remapping driver shouldn't release
      drhd->iommu when it failed to initialize IOMMU devices. Otherwise it
      may cause invalid memory access to the interrupt remapping driver.
      
      Sample stack dump:
      [   13.315090] BUG: unable to handle kernel paging request at ffffc9000605a088
      [   13.323221] IP: [<ffffffff81461bac>] qi_submit_sync+0x15c/0x400
      [   13.330107] PGD 82f81e067 PUD c2f81e067 PMD 82e846067 PTE 0
      [   13.336818] Oops: 0002 [#1] SMP
      [   13.340757] Modules linked in:
      [   13.344422] CPU: 0 PID: 4 Comm: kworker/0:0 Not tainted 3.13.0-rc1-gerry+ #7
      [   13.352474] Hardware name: Intel Corporation LH Pass ........../SVRBD-ROW_T,                                               BIOS SE5C600.86B.99.99.x059.091020121352 09/10/2012
      [   13.365659] Workqueue: events work_for_cpu_fn
      [   13.370774] task: ffff88042ddf00d0 ti: ffff88042ddee000 task.ti: ffff88042dde                                              e000
      [   13.379389] RIP: 0010:[<ffffffff81461bac>]  [<ffffffff81461bac>] qi_submit_sy                                              nc+0x15c/0x400
      [   13.389055] RSP: 0000:ffff88042ddef940  EFLAGS: 00010002
      [   13.395151] RAX: 00000000000005e0 RBX: 0000000000000082 RCX: 0000000200000025
      [   13.403308] RDX: ffffc9000605a000 RSI: 0000000000000010 RDI: ffff88042ddb8610
      [   13.411446] RBP: ffff88042ddef9a0 R08: 00000000000005d0 R09: 0000000000000001
      [   13.419599] R10: 0000000000000000 R11: 000000000000005d R12: 000000000000005c
      [   13.427742] R13: ffff88102d84d300 R14: 0000000000000174 R15: ffff88042ddb4800
      [   13.435877] FS:  0000000000000000(0000) GS:ffff88043de00000(0000) knlGS:00000                                              00000000000
      [   13.445168] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   13.451749] CR2: ffffc9000605a088 CR3: 0000000001a0b000 CR4: 00000000000407f0
      [   13.459895] Stack:
      [   13.462297]  ffff88042ddb85d0 000000000000005d ffff88042ddef9b0 0000000000000                                              5d0
      [   13.471147]  00000000000005c0 ffff88042ddb8000 000000000000005c 0000000000000                                              015
      [   13.480001]  ffff88042ddb4800 0000000000000282 ffff88042ddefa40 ffff88042ddef                                              ac0
      [   13.488855] Call Trace:
      [   13.491771]  [<ffffffff8146848d>] modify_irte+0x9d/0xd0
      [   13.497778]  [<ffffffff8146886d>] intel_setup_ioapic_entry+0x10d/0x290
      [   13.505250]  [<ffffffff810a92a6>] ? trace_hardirqs_on_caller+0x16/0x1e0
      [   13.512824]  [<ffffffff810346b0>] ? default_init_apic_ldr+0x60/0x60
      [   13.519998]  [<ffffffff81468be0>] setup_ioapic_remapped_entry+0x20/0x30
      [   13.527566]  [<ffffffff8103683a>] io_apic_setup_irq_pin+0x12a/0x2c0
      [   13.534742]  [<ffffffff8136673b>] ? acpi_pci_irq_find_prt_entry+0x2b9/0x2d8
      [   13.544102]  [<ffffffff81037fd5>] io_apic_setup_irq_pin_once+0x85/0xa0
      [   13.551568]  [<ffffffff8103816f>] ? mp_find_ioapic_pin+0x8f/0xf0
      [   13.558434]  [<ffffffff81038044>] io_apic_set_pci_routing+0x34/0x70
      [   13.565621]  [<ffffffff8102f4cf>] mp_register_gsi+0xaf/0x1c0
      [   13.572111]  [<ffffffff8102f5ee>] acpi_register_gsi_ioapic+0xe/0x10
      [   13.579286]  [<ffffffff8102f33f>] acpi_register_gsi+0xf/0x20
      [   13.585779]  [<ffffffff81366b86>] acpi_pci_irq_enable+0x171/0x1e3
      [   13.592764]  [<ffffffff8146d771>] pcibios_enable_device+0x31/0x40
      [   13.599744]  [<ffffffff81320e9b>] do_pci_enable_device+0x3b/0x60
      [   13.606633]  [<ffffffff81322248>] pci_enable_device_flags+0xc8/0x120
      [   13.613887]  [<ffffffff813222f3>] pci_enable_device+0x13/0x20
      [   13.620484]  [<ffffffff8132fa7e>] pcie_port_device_register+0x1e/0x510
      [   13.627947]  [<ffffffff810a92a6>] ? trace_hardirqs_on_caller+0x16/0x1e0
      [   13.635510]  [<ffffffff810a947d>] ? trace_hardirqs_on+0xd/0x10
      [   13.642189]  [<ffffffff813302b8>] pcie_portdrv_probe+0x58/0xc0
      [   13.648877]  [<ffffffff81323ba5>] local_pci_probe+0x45/0xa0
      [   13.655266]  [<ffffffff8106bc44>] work_for_cpu_fn+0x14/0x20
      [   13.661656]  [<ffffffff8106fa79>] process_one_work+0x369/0x710
      [   13.668334]  [<ffffffff8106fa02>] ? process_one_work+0x2f2/0x710
      [   13.675215]  [<ffffffff81071d56>] ? worker_thread+0x46/0x690
      [   13.681714]  [<ffffffff81072194>] worker_thread+0x484/0x690
      [   13.688109]  [<ffffffff81071d10>] ? cancel_delayed_work_sync+0x20/0x20
      [   13.695576]  [<ffffffff81079c60>] kthread+0xf0/0x110
      [   13.701300]  [<ffffffff8108e7bf>] ? local_clock+0x3f/0x50
      [   13.707492]  [<ffffffff81079b70>] ? kthread_create_on_node+0x250/0x250
      [   13.714959]  [<ffffffff81574d2c>] ret_from_fork+0x7c/0xb0
      [   13.721152]  [<ffffffff81079b70>] ? kthread_create_on_node+0x250/0x250
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      a868e6b7
    • J
      iommu/vt-d, trivial: simplify code with existing macros · 7c919779
      Jiang Liu 提交于
      Simplify vt-d related code with existing macros and introduce a new
      macro for_each_active_drhd_unit() to enumerate all active DRHD unit.
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      7c919779
    • J
      iommu/vt-d: mark internal functions as static · 694835dc
      Jiang Liu 提交于
      Functions alloc_iommu() and parse_ioapics_under_ir()
      are only used internally, so mark them as static.
      
      [Joerg: Made detect_intel_iommu() non-static again for IA64]
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      694835dc
    • J
      iommu/vt-d, trivial: clean up unused code · b8a2d288
      Jiang Liu 提交于
      Remove dead code from VT-d related files.
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      
      Conflicts:
      
      	drivers/iommu/dmar.c
      b8a2d288
    • J
      iommu/vt-d, trivial: check suitable flag in function detect_intel_iommu() · b977e73a
      Jiang Liu 提交于
      Flag irq_remapping_enabled is only set by intel_enable_irq_remapping(),
      which is called after detect_intel_iommu(). So moving pr_info() from
      detect_intel_iommu() to intel_enable_irq_remapping(), which also
      slightly simplifies implementation.
      Reviewed-by: NYijing Wang <wangyijing@huawei.com>
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      b977e73a
    • J
      iommu/vt-d: fix PCI device reference leakage on error recovery path · ada4d4b2
      Jiang Liu 提交于
      Function dmar_parse_dev_scope() should release the PCI device reference
      count gained in function dmar_parse_one_dev_scope() on error recovery,
      otherwise it will cause PCI device object leakage.
      
      This patch also introduces dmar_free_dev_scope(), which will be used
      to support DMAR device hotplug.
      Reviewed-by: NYijing Wang <wangyijing@huawei.com>
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      ada4d4b2
  3. 30 12月, 2013 1 次提交
  4. 01 11月, 2013 1 次提交
  5. 31 10月, 2013 1 次提交
    • L
      ACPICA: Update DMAR table definitions. · fa5f508f
      Lv Zheng 提交于
      This patch updates DMAR table header definitions as such enhancement
      has been made in ACPICA upstream already.  It ports that change to
      the Linux source to reduce source code differences between Linux and
      ACPICA upstream.
      
      Build test done on x86-64 machine with the following configs enabled:
        CONFIG_DMAR_TABLE
        CONFIG_IRQ_REMAP
        CONFIG_INTEL_IOMMU
      
      This patch does not affect the generation of the Linux kernel binary.
      
      [rjw: Changelog]
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      fa5f508f
  6. 20 6月, 2013 1 次提交
    • L
      iommu/vt-d: DMAR reporting table needs at least one DRHD · 7cef3347
      Li, Zhen-Hua 提交于
      In intel vt-d spec , chapter 8.1 , DMA Remapping Reporting Structure.
      In the end of the table, it says:
      
      Remapping Structures[]
      -
      A list of structures. The list will contain one or
      more DMA Remapping Hardware Unit Definition
      (DRHD) structures, and zero or more Reserved
      Memory Region Reporting (RMRR) and Root Port
      ATS Capability Reporting (ATSR) structures.
      These structures are described below.
      
      So, there should be at least one DRHD structure in DMA Remapping
      reporting table. If there is no DRHD found, a warning is necessary.
      Signed-off-by: NLi, Zhen-Hua <zhen-hual@hp.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      7cef3347
  7. 25 4月, 2013 1 次提交
  8. 24 4月, 2013 1 次提交
  9. 23 4月, 2013 1 次提交
    • T
      iommu/vt-d: Disable translation if already enabled · 3a93c841
      Takao Indoh 提交于
      This patch disables translation(dma-remapping) before its initialization
      if it is already enabled.
      
      This is needed for kexec/kdump boot. If dma-remapping is enabled in the
      first kernel, it need to be disabled before initializing its page table
      during second kernel boot. Wei Hu also reported that this is needed
      when second kernel boots with intel_iommu=off.
      
      Basically iommu->gcmd is used to know whether translation is enabled or
      disabled, but it is always zero at boot time even when translation is
      enabled since iommu->gcmd is initialized without considering such a
      case. Therefor this patch synchronizes iommu->gcmd value with global
      command register when iommu structure is allocated.
      Signed-off-by: NTakao Indoh <indou.takao@jp.fujitsu.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      3a93c841
  10. 27 3月, 2013 1 次提交
  11. 06 3月, 2013 1 次提交
  12. 08 2月, 2013 1 次提交
  13. 28 1月, 2013 1 次提交
  14. 11 6月, 2012 1 次提交
  15. 08 6月, 2012 2 次提交
  16. 14 5月, 2012 1 次提交
  17. 07 5月, 2012 3 次提交
  18. 21 9月, 2011 5 次提交
  19. 14 9月, 2011 1 次提交
  20. 13 9月, 2011 2 次提交
  21. 21 6月, 2011 1 次提交
    • O
      x86/ia64: intel-iommu: move to drivers/iommu/ · 166e9278
      Ohad Ben-Cohen 提交于
      This should ease finding similarities with different platforms,
      with the intention of solving problems once in a generic framework
      which everyone can use.
      
      Note: to move intel-iommu.c, the declaration of pci_find_upstream_pcie_bridge()
      has to move from drivers/pci/pci.h to include/linux/pci.h. This is handled
      in this patch, too.
      
      As suggested, also drop DMAR's EXPERIMENTAL tag while we're at it.
      
      Compile-tested on x86_64.
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      166e9278
  22. 24 5月, 2011 1 次提交
  23. 29 3月, 2011 1 次提交
  24. 14 12月, 2010 1 次提交
    • S
      x86, vt-d: Handle previous faults after enabling fault handling · 7f99d946
      Suresh Siddha 提交于
      Fault handling is getting enabled after enabling the interrupt-remapping (as
      the success of interrupt-remapping can affect the apic mode and hence the
      fault handling mode).
      
      Hence there can potentially be some faults between the window of enabling
      interrupt-remapping in the vt-d and the fault-handling of the vt-d units.
      
      Handle any previous faults after enabling the vt-d fault handling.
      
      For v2.6.38 cleanup, need to check if we can remove the dmar_fault() in the
      enable_intr_remapping() and see if we can enable fault handling along with
      enabling intr-remapping.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      LKML-Reference: <20101201062244.630417138@intel.com>
      Cc: stable@kernel.org [v2.6.32+]
      Acked-by: NChris Wright <chrisw@sous-sol.org>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      7f99d946