1. 16 12月, 2009 1 次提交
    • A
      iommu-helper: use bitmap library · a66022c4
      Akinobu Mita 提交于
      Use bitmap library and kill some unused iommu helper functions.
      
      1. s/iommu_area_free/bitmap_clear/
      
      2. s/iommu_area_reserve/bitmap_set/
      
      3. Use bitmap_find_next_zero_area instead of find_next_zero_area
      
        This cannot be simple substitution because find_next_zero_area
        doesn't check the last bit of the limit in bitmap
      
      4. Remove iommu_area_free, iommu_area_reserve, and find_next_zero_area
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a66022c4
  2. 03 12月, 2009 1 次提交
    • D
      x86, Calgary IOMMU quirk: Find nearest matching Calgary while walking up the PCI tree · 4528752f
      Darrick J. Wong 提交于
      On a multi-node x3950M2 system, there's a slight oddity in the
      PCI device tree for all secondary nodes:
      
       30:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
        \-33:00.0 PCI bridge: IBM CalIOC2 PCI-E Root Port (rev 01)
           \-34:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 1078 (rev 04)
      
      ...as compared to the primary node:
      
       00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
        \-01:00.0 VGA compatible controller: ATI Technologies Inc ES1000 (rev 02)
       03:00.0 PCI bridge: IBM CalIOC2 PCI-E Root Port (rev 01)
        \-04:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 1078 (rev 04)
      
      In both nodes, the LSI RAID controller hangs off a CalIOC2
      device, but on the secondary nodes, the BIOS hides the VGA
      device and substitutes the device tree ending with the disk
      controller.
      
      It would seem that Calgary devices don't necessarily appear at
      the top of the PCI tree, which means that the current code to
      find the Calgary IOMMU that goes with a particular device is
      buggy.
      
      Rather than walk all the way to the top of the PCI
      device tree and try to match bus number with Calgary descriptor,
      the code needs to examine each parent of the particular device;
      if it encounters a Calgary with a matching bus number, simply
      use that.
      
      Otherwise, we BUG() when the bus number of the Calgary doesn't
      match the bus number of whatever's at the top of the device tree.
      
      Extra note: This patch appears to work correctly for the x3950
      that came before the x3950 M2.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Acked-by: NMuli Ben-Yehuda <muli@il.ibm.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Cc: Yinghai Lu <yhlu.kernel@gmail.com>
      Cc: Jon D. Mason <jdmason@kudzu.us>
      Cc: Corinna Schultz <coschult@us.ibm.com>
      Cc: <stable@kernel.org>
      LKML-Reference: <20091202230556.GG10295@tux1.beaverton.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4528752f
  3. 17 11月, 2009 2 次提交
  4. 15 11月, 2009 1 次提交
  5. 10 11月, 2009 2 次提交
    • F
      x86: Handle HW IOMMU initialization failure gracefully · 75f1cdf1
      FUJITA Tomonori 提交于
      If HW IOMMU initialization fails (Intel VT-d often does this,
      typically due to BIOS bugs), we fall back to nommu. It doesn't
      work for the majority since nowadays we have more than 4GB
      memory so we must use swiotlb instead of nommu.
      
      The problem is that it's too late to initialize swiotlb when HW
      IOMMU initialization fails. We need to allocate swiotlb memory
      earlier from bootmem allocator. Chris explained the issue in
      detail:
      
        http://marc.info/?l=linux-kernel&m=125657444317079&w=2
      
      The current x86 IOMMU initialization sequence is too complicated
      and handling the above issue makes it more hacky.
      
      This patch changes x86 IOMMU initialization sequence to handle
      the above issue cleanly.
      
      The new x86 IOMMU initialization sequence are:
      
      1. we initialize the swiotlb (and setting swiotlb to 1) in the case
         of (max_pfn > MAX_DMA32_PFN && !no_iommu). dma_ops is set to
         swiotlb_dma_ops or nommu_dma_ops. if swiotlb usage is forced by
         the boot option, we finish here.
      
      2. we call the detection functions of all the IOMMUs
      
      3. the detection function sets x86_init.iommu.iommu_init to the
         IOMMU initialization function (so we can avoid calling the
         initialization functions of all the IOMMUs needlessly).
      
      4. if the IOMMU initialization function doesn't need to swiotlb
         then sets swiotlb to zero (e.g. the initialization is
         sucessful).
      
      5. if we find that swiotlb is set to zero, we free swiotlb
         resource.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: chrisw@sous-sol.org
      Cc: dwmw2@infradead.org
      Cc: joerg.roedel@amd.com
      Cc: muli@il.ibm.com
      LKML-Reference: <1257849980-22640-10-git-send-email-fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      75f1cdf1
    • F
      x86: Calgary: Convert detect_calgary() to use iommu_init hook · d7b9f7be
      FUJITA Tomonori 提交于
      This changes detect_calgary() to set init_calgary() to
      iommu_init hook if detect_calgary() finds the Calgary IOMMU.
      
      We can kill the code to check if we found the IOMMU in
      init_calgary() since detect_calgary() sets init_calgary() only
      when it found the IOMMU.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Acked-by: NMuli Ben-Yehuda <muli@il.ibm.com>
      Cc: chrisw@sous-sol.org
      Cc: dwmw2@infradead.org
      Cc: joerg.roedel@amd.com
      LKML-Reference: <1257849980-22640-3-git-send-email-fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d7b9f7be
  6. 14 4月, 2009 1 次提交
    • F
      x86: calgary: remove IOMMU_DEBUG · 7e05575c
      FUJITA Tomonori 提交于
      CONFIG_IOMMU_DEBUG has depends on CONFIG_GART_IOMMU:
      
      config IOMMU_DEBUG
      	bool "Enable IOMMU debugging"
      	depends on GART_IOMMU && DEBUG_KERNEL
      	depends on X86_64
      
      So it's not useful to have CONFIG_IOMMU_DEBUG in Calgary IOMMU code,
      which does the extra checking of the bitmap space management.
      
      And Calgary uses the iommu helper for the bitmap space management now
      so it would be better to have the extra checking feature in the iommu
      helper rather than Calgary code (if necessary).
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Acked-by: NMuli Ben-Yehuda <muli@il.ibm.com>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Cc: alexisb@us.ibm.com
      LKML-Reference: <20090414120827G.fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7e05575c
  7. 06 1月, 2009 3 次提交
  8. 25 11月, 2008 1 次提交
  9. 17 10月, 2008 1 次提交
  10. 22 9月, 2008 1 次提交
  11. 14 9月, 2008 1 次提交
  12. 22 8月, 2008 1 次提交
  13. 21 8月, 2008 2 次提交
  14. 18 8月, 2008 1 次提交
    • M
      x86, calgary: fix section mismatch warning - get_tce_space_from_tar · f7106662
      Marcin Slusarz 提交于
      WARNING: vmlinux.o(.text+0x27032): Section mismatch in reference from the function get_tce_space_from_tar() to the function .init.text:calgary_bus_has_devices()
      The function get_tce_space_from_tar() references
      the function __init calgary_bus_has_devices().
      This is often because get_tce_space_from_tar lacks a __init
      annotation or the annotation of calgary_bus_has_devices is wrong.
      
      get_tce_space_from_tar is called only from __init function (calgary_init)
      and calls __init function (calgary_bus_has_devices).
      So annotate it properly.
      Signed-off-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
      Cc: Chandru Siddalingappa <chandru@in.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f7106662
  15. 12 8月, 2008 1 次提交
  16. 27 7月, 2008 2 次提交
    • A
      x86 calgary: fix handling of devices that aren't behind the Calgary · 1956a96d
      Alexis Bruemmer 提交于
      The calgary code can give drivers addresses above 4GB which is very bad
      for hardware that is only 32bit DMA addressable.
      
      With this patch, the calgary code sets the global dma_ops to swiotlb or
      nommu properly, and the dma_ops of devices behind the Calgary/CalIOC2
      to calgary_dma_ops.  So the calgary code can handle devices safely that
      aren't behind the Calgary/CalIOC2.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NAlexis Bruemmer <alexisb@us.ibm.com>
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Muli Ben-Yehuda <muli@il.ibm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1956a96d
    • F
      dma-mapping: add the device argument to dma_mapping_error() · 8d8bb39b
      FUJITA Tomonori 提交于
      Add per-device dma_mapping_ops support for CONFIG_X86_64 as POWER
      architecture does:
      
      This enables us to cleanly fix the Calgary IOMMU issue that some devices
      are not behind the IOMMU (http://lkml.org/lkml/2008/5/8/423).
      
      I think that per-device dma_mapping_ops support would be also helpful for
      KVM people to support PCI passthrough but Andi thinks that this makes it
      difficult to support the PCI passthrough (see the above thread).  So I
      CC'ed this to KVM camp.  Comments are appreciated.
      
      A pointer to dma_mapping_ops to struct dev_archdata is added.  If the
      pointer is non NULL, DMA operations in asm/dma-mapping.h use it.  If it's
      NULL, the system-wide dma_ops pointer is used as before.
      
      If it's useful for KVM people, I plan to implement a mechanism to register
      a hook called when a new pci (or dma capable) device is created (it works
      with hot plugging).  It enables IOMMUs to set up an appropriate
      dma_mapping_ops per device.
      
      The major obstacle is that dma_mapping_error doesn't take a pointer to the
      device unlike other DMA operations.  So x86 can't have dma_mapping_ops per
      device.  Note all the POWER IOMMUs use the same dma_mapping_error function
      so this is not a problem for POWER but x86 IOMMUs use different
      dma_mapping_error functions.
      
      The first patch adds the device argument to dma_mapping_error.  The patch
      is trivial but large since it touches lots of drivers and dma-mapping.h in
      all the architecture.
      
      This patch:
      
      dma_mapping_error() doesn't take a pointer to the device unlike other DMA
      operations.  So we can't have dma_mapping_ops per device.
      
      Note that POWER already has dma_mapping_ops per device but all the POWER
      IOMMUs use the same dma_mapping_error function.  x86 IOMMUs use device
      argument.
      
      [akpm@linux-foundation.org: fix sge]
      [akpm@linux-foundation.org: fix svc_rdma]
      [akpm@linux-foundation.org: build fix]
      [akpm@linux-foundation.org: fix bnx2x]
      [akpm@linux-foundation.org: fix s2io]
      [akpm@linux-foundation.org: fix pasemi_mac]
      [akpm@linux-foundation.org: fix sdhci]
      [akpm@linux-foundation.org: build fix]
      [akpm@linux-foundation.org: fix sparc]
      [akpm@linux-foundation.org: fix ibmvscsi]
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Muli Ben-Yehuda <muli@il.ibm.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Avi Kivity <avi@qumranet.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8d8bb39b
  17. 26 7月, 2008 1 次提交
  18. 11 7月, 2008 1 次提交
  19. 08 7月, 2008 1 次提交
  20. 26 4月, 2008 1 次提交
  21. 21 4月, 2008 1 次提交
  22. 20 4月, 2008 1 次提交
  23. 06 2月, 2008 1 次提交
  24. 02 2月, 2008 1 次提交
  25. 30 1月, 2008 2 次提交
  26. 30 10月, 2007 1 次提交
  27. 23 10月, 2007 1 次提交
  28. 18 10月, 2007 2 次提交
  29. 16 10月, 2007 1 次提交
  30. 11 10月, 2007 2 次提交
  31. 12 8月, 2007 1 次提交