1. 18 11月, 2010 1 次提交
  2. 21 9月, 2010 1 次提交
  3. 18 9月, 2010 1 次提交
  4. 05 9月, 2010 1 次提交
    • B
      x86, GART: Disable GART table walk probes · 260133ab
      Borislav Petkov 提交于
      Current code tramples over bit F3x90[6] which can be used to
      disable GART table walk probes. However, this bit should be set
      for performance reasons (speed up GART table walks). We are
      allowed to do that since we put GART tables in UC memory later
      anyway. Make it so.
      Signed-off-by: NBorislav Petkov <borislav.petkov@amd.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      LKML-Reference: <1283531981-7495-3-git-send-email-bp@amd64.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      260133ab
  5. 27 8月, 2010 1 次提交
  6. 07 4月, 2010 1 次提交
  7. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  8. 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
  9. 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
  10. 14 12月, 2009 1 次提交
  11. 17 11月, 2009 2 次提交
  12. 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
  13. 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
  14. 12 10月, 2009 1 次提交
  15. 28 7月, 2009 1 次提交
  16. 09 7月, 2009 1 次提交
  17. 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
  18. 15 4月, 2009 1 次提交
  19. 30 1月, 2009 1 次提交
  20. 06 1月, 2009 3 次提交
  21. 30 12月, 2008 1 次提交
  22. 18 12月, 2008 1 次提交
  23. 03 12月, 2008 2 次提交
  24. 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
  25. 17 10月, 2008 2 次提交
  26. 05 10月, 2008 1 次提交
  27. 28 9月, 2008 3 次提交
  28. 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
  29. 23 9月, 2008 1 次提交