1. 13 3月, 2010 1 次提交
    • B
      x86, k8 nb: Fix boot crash: enable k8_northbridges unconditionally on AMD systems · 0e152cd7
      Borislav Petkov 提交于
      de957628 changed setting of the
      x86_init.iommu.iommu_init function ptr only when GART IOMMU is
      found.
      
      One side effect of it is that num_k8_northbridges
      is not initialized anymore if not explicitly
      called. This resulted in uninitialized pointers in
      <arch/x86/kernel/cpu/intel_cacheinfo.c:amd_calc_l3_indices()>,
      for example, which uses the num_k8_northbridges thing through
      node_to_k8_nb_misc().
      
      Fix that through an initcall that runs right after the PCI
      subsystem and does all the scanning. Then, remove initialization
      in gart_iommu_init() which is a rootfs_initcall and we're
      running before that.
      
      What is more, since num_k8_northbridges is being used in other
      places beside GART IOMMU, include it whenever we add AMD CPU
      support. The previous dependency chain in kconfig contained
      
      K8_NB depends on AGP_AMD64|GART_IOMMU
      
      which was clearly incorrect. The more natural way in terms of
      hardware dependency should be
      
      AGP_AMD64|GART_IOMMU depends on K8_NB depends on CPU_SUP_AMD &&
      PCI. Make it so Number One!
      Signed-off-by: NBorislav Petkov <borislav.petkov@amd.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      LKML-Reference: <20100312144303.GA29262@aftab>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Tested-by: NJoerg Roedel <joerg.roedel@amd.com>
      0e152cd7
  2. 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
  3. 14 12月, 2009 1 次提交
  4. 17 11月, 2009 2 次提交
  5. 10 11月, 2009 3 次提交
    • 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: GART: Convert gart_iommu_hole_init() to use iommu_init hook · de957628
      FUJITA Tomonori 提交于
      This changes gart_iommu_hole_init() to set gart_iommu_init() to
      iommu_init hook if gart_iommu_hole_init() finds the GART IOMMU.
      
      We can kill the code to check if we found the IOMMU in
      gart_iommu_init() since gart_iommu_hole_init() sets
      gart_iommu_init() only when it found the IOMMU.
      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-4-git-send-email-fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      de957628
    • J
      x86: GART: pci-gart_64.c: Use correct length in strncmp · 41855b77
      Joe Perches 提交于
      Signed-off-by: NJoe Perches <joe@perches.com>
      Cc: <stable@kernel.org> # .3x.x
      LKML-Reference: <1257818330.12852.72.camel@Joe-Laptop.home>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      41855b77
  6. 08 11月, 2009 1 次提交
    • F
      x86: Use x86_platform for iommu_shutdown · 338bac52
      FUJITA Tomonori 提交于
      This patch cleans up pci_iommu_shutdown() a bit to use
      x86_platform (similar to how IA64 initializes an IOMMU driver).
      
      This adds iommu_shutdown() to x86_platform to avoid calling
      every IOMMUs' shutdown functions in pci_iommu_shutdown() in
      order. The IOMMU shutdown functions are platform specific (we
      don't have multiple different IOMMU hardware) so the current way
      is pointless.
      
      An IOMMU driver sets x86_platform.iommu_shutdown to the shutdown
      function if necessary.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: joerg.roedel@amd.com
      LKML-Reference: <20091027163358F.fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      338bac52
  7. 12 10月, 2009 1 次提交
  8. 28 7月, 2009 1 次提交
  9. 09 7月, 2009 1 次提交
  10. 06 6月, 2009 1 次提交
    • M
      x86: enable GART-IOMMU only after setting up protection methods · fe2245c9
      Mark Langsdorf 提交于
      The current code to set up the GART as an IOMMU enables GART
      translations before it removes the aperture from the kernel memory
      map, sets the GART PTEs to UC, sets up the guard and scratch
      pages, or does a wbinvd().  This leaves the possibility of cache
      aliasing open and can cause system crashes.
      
      Re-order the code so as to enable the GART translations only
      after all safeguards are in place and the tlb has been flushed.
      
      AMD has tested this patch on both Istanbul systems and 1st
      generation Opteron systems with APG enabled and seen no adverse
      effects.  Istanbul systems with HT Assist enabled sometimes
      see MCE errors due to cache artifacts with the unmodified
      code.
      Signed-off-by: NMark Langsdorf <mark.langsdorf@amd.com>
      Cc: <stable@kernel.org>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Cc: akpm@linux-foundation.org
      Cc: jbarnes@virtuousgeek.org
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fe2245c9
  11. 15 4月, 2009 1 次提交
  12. 30 1月, 2009 1 次提交
  13. 06 1月, 2009 3 次提交
  14. 30 12月, 2008 1 次提交
  15. 18 12月, 2008 1 次提交
  16. 03 12月, 2008 2 次提交
  17. 29 10月, 2008 1 次提交
    • J
      x86, gart: fix gart detection for Fam11h CPUs · 87c6f401
      Joerg Roedel 提交于
      Impact: fix AMD Family 11h boot hangs / USB device problems
      
      The AMD Fam11h CPUs have a K8 northbridge. This northbridge is different
      from other family's because it lacks GART support (as I just learned).
      
      But the kernel implicitly expects a GART if it finds an AMD northbridge.
      
      Fix this by removing the Fam11h northbridge id from the scan list of K8
      northbridges. This patch also changes the message in the GART driver
      about missing K8 northbridges to tell that the GART is missing which is
      the correct information in this case.
      Reported-by: NJouni Malinen <jkmalinen@gmail.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      87c6f401
  18. 17 10月, 2008 2 次提交
  19. 05 10月, 2008 1 次提交
  20. 28 9月, 2008 3 次提交
  21. 25 9月, 2008 3 次提交
    • F
      x86 gart: remove unnecessary initialization · 1615965e
      FUJITA Tomonori 提交于
      There is no point to have such initialization in struct dma_mapping_ops.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1615965e
    • F
      x86: restore old GART alloc_coherent behavior · 1d990882
      FUJITA Tomonori 提交于
      Currently, GART alloc_coherent tries to allocate pages with GFP_DMA32
      for a device having dma_masks > 24bit < 32bits. If GART gets an
      address that a device can't access to, GART try to map the address to
      a virtual I/O address that the device can access to.
      
      But Andi pointed out, "The GART is somewhere in the 4GB range so you
      cannot use it to map anything < 4GB. Also GART is pretty small."
      
      http://lkml.org/lkml/2008/9/12/43
      
      That is, it's possible that GART doesn't have virtual I/O address
      space that a device can access to. The above behavior doesn't work for
      a device having dma_masks > 24bit < 32bits.
      
      This patch restores old GART alloc_coherent behavior (before the
      alloc_coherent rewrite).
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1d990882
    • F
      revert "x86: make GART to respect device's dma_mask about virtual mappings" · ecef533e
      FUJITA Tomonori 提交于
      This reverts:
      
      commit bee44f29
      Author: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Date:   Fri Sep 12 19:42:35 2008 +0900
      
          x86: make GART to respect device's dma_mask about virtual mappings
      
      I wrote the above commit to fix a GART alloc_coherent regression, that
      can't handle a device having dma_masks > 24bit < 32bits, introduced by
      the alloc_coherent rewrite:
      
        http://lkml.org/lkml/2008/8/12/200
      
      After the alloc_coherent rewrite, GART alloc_coherent tried to
      allocate pages with GFP_DMA32. If GART got an address that a device
      can't access to, GART mapped the address to a virtual I/O address. But
      GART mapping mechanism didn't take account of dma mask, so GART could
      use a virtual I/O address that the device can't access to again.
      
      Alan pointed out:
      
      " This is indeed a specific problem found with things like older
        AACRAID where control blocks must be below 31bits and the GART
        is above 0x80000000. "
      
      The above commit modified GART mapping mechanism to take care of dma
      mask. But Andi pointed out, "The GART is somewhere in the 4GB range so
      you cannot use it to map anything < 4GB. Also GART is pretty small."
      
      http://lkml.org/lkml/2008/9/12/43
      
      That means it's possible that GART doesn't have virtual I/O address
      space that a device can access to. The above commit (to modify GART
      mapping mechanism to take care of dma mask) can't fix the regression
      reliably so let's avoid making GART more complicated.
      
      We need a solution that always works for dma_masks > 24bit <
      32bits. That's how GART worked before the alloc_coherent rewrite.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Acked-by: NJoerg Roedel <joerg.roedel@amd.com>
      Acked-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ecef533e
  22. 23 9月, 2008 1 次提交
  23. 22 9月, 2008 1 次提交
  24. 19 9月, 2008 1 次提交
  25. 14 9月, 2008 2 次提交
  26. 10 9月, 2008 1 次提交
  27. 05 9月, 2008 1 次提交
  28. 22 8月, 2008 1 次提交