1. 28 9月, 2011 1 次提交
    • P
      doc: fix broken references · 395cf969
      Paul Bolle 提交于
      There are numerous broken references to Documentation files (in other
      Documentation files, in comments, etc.). These broken references are
      caused by typo's in the references, and by renames or removals of the
      Documentation files. Some broken references are simply odd.
      
      Fix these broken references, sometimes by dropping the irrelevant text
      they were part of.
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      395cf969
  2. 11 5月, 2011 1 次提交
  3. 27 8月, 2010 2 次提交
    • K
      x86, iommu: Utilize the IOMMU_INIT macros functionality. · ee1f284f
      Konrad Rzeszutek Wilk 提交于
      We remove all of the sub-platform detection/init routines and instead
      use on the .iommu_table array of structs to call the .early_init if
      .detect returned a positive value. Also we can stop detecting other
      IOMMUs if the IOMMU used the _FINISH type macro. During the
      'pci_iommu_init' stage, we call .init for the second-stage
      initialization if it was defined. Currently only SWIOTLB has this
      defined and it used to de-allocate the SWIOTLB if the other detected
      IOMMUs have deemed it unnecessary to use SWIOTLB.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      LKML-Reference: <1282845485-8991-11-git-send-email-konrad.wilk@oracle.com>
      CC: Fujita Tomonori <fujita.tomonori@lab.ntt.co.jp>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Ingo Molnar <mingo@redhat.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      ee1f284f
    • K
      x86, swiotlb: Simplify SWIOTLB pci_swiotlb_detect routine. · efa631c2
      Konrad Rzeszutek Wilk 提交于
      In 'pci_swiotlb_detect' we used to do two different things:
       a). If user provided 'iommu=soft' or 'swiotlb=force' we
           would set swiotlb=1 and return 1 (and forcing pci-dma.c
           to call pci_swiotlb_init() immediately).
       b). If 4GB or more would be detected and if user did not specify
           iommu=off, we would set 'swiotlb=1' and return whatever 'a)'
           figured out.
      
      We simplify this by splitting a) and b) in two different routines.
      
      CC: Fujita Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      LKML-Reference: <1282845485-8991-5-git-send-email-konrad.wilk@oracle.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      efa631c2
  4. 03 8月, 2010 1 次提交
  5. 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
  6. 11 2月, 2010 1 次提交
  7. 05 2月, 2010 1 次提交
  8. 15 12月, 2009 1 次提交
    • F
      x86: Split swiotlb initialization into two stages · 186a2502
      FUJITA Tomonori 提交于
      The commit f4780ca0 moves
      swiotlb initialization before dma32_free_bootmem(). It's
      supposed to fix a bug that the commit
      75f1cdf1 introduced, we
      initialize SWIOTLB right after dma32_free_bootmem so we wrongly
      steal memory area allocated for GART with broken BIOS earlier.
      
      However, the above commit introduced another problem, which
      likely breaks machines with huge amount of memory. Such a box
      use the majority of DMA32_ZONE so there is no memory for
      swiotlb.
      
      With this patch, the x86 IOMMU initialization sequence are:
      
      1. We set swiotlb to 1 in the case of (max_pfn > MAX_DMA32_PFN
         && !no_iommu). If swiotlb usage is forced by the boot option,
         we go to the step 3 and finish (we don't try to detect IOMMUs).
      
      2. We call the detection functions of all the IOMMUs. 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).
      
      3. We initialize swiotlb (and set dma_ops to swiotlb_dma_ops) if
         swiotlb is set to 1.
      
      4. If the IOMMU initialization function doesn't need swiotlb
         (e.g. the initialization is sucessful) then sets swiotlb to zero.
      
      5. If we find that swiotlb is set to zero, we free swiotlb
         resource.
      Reported-by: NYinghai Lu <yinghai@kernel.org>
      Reported-by: NRoland Dreier <rdreier@cisco.com>
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      LKML-Reference: <20091215204729A.fujita.tomonori@lab.ntt.co.jp>
      Tested-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      186a2502
  9. 14 12月, 2009 1 次提交
  10. 17 11月, 2009 1 次提交
    • F
      x86: Kill bad_dma_address variable · 8fd524b3
      FUJITA Tomonori 提交于
      This kills bad_dma_address variable, the old mechanism to enable
      IOMMU drivers to make dma_mapping_error() work in IOMMU's
      specific way.
      
      bad_dma_address variable was introduced to enable IOMMU drivers
      to make dma_mapping_error() work in IOMMU's specific way.
      However, it can't handle systems that use both swiotlb and HW
      IOMMU. SO we introduced dma_map_ops->mapping_error to solve that
      case.
      
      Intel VT-d, GART, and swiotlb already use
      dma_map_ops->mapping_error. Calgary, AMD IOMMU, and nommu use
      zero for an error dma address. This adds DMA_ERROR_CODE and
      converts them to use it (as SPARC and POWER does).
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Acked-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Cc: muli@il.ibm.com
      Cc: joerg.roedel@amd.com
      LKML-Reference: <1258287594-8777-3-git-send-email-fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8fd524b3
  11. 15 11月, 2009 1 次提交
  12. 11 11月, 2009 1 次提交
  13. 10 11月, 2009 8 次提交
    • I
      x86: Add iommu_init to x86_init_ops, fix build · b4941a9a
      Ingo Molnar 提交于
      Most of the time x86_init.h is included in pci-dma.c - but not always,
      leading to this rare build failure:
      
      arch/x86/kernel/pci-dma.c:296: error: 'x86_init' undeclared (first use in this function)
      
      So include asm/x86_init.h explicitly.
      
      Cc: FUJITA 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-2-git-send-email-fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b4941a9a
    • F
      x86, 32-bit: Fix swiotlb boot crash · 72d03802
      FUJITA Tomonori 提交于
      Ingo Molnar reported this boot crash:
      
      [    8.655620] pata_amd 0000:00:06.0: version 0.4.1
      [    8.660286] BUG: unable to handle kernel NULL pointer dereference at 00000034
      [    8.663572] IP: [<c100617b>] dma_supported+0x3b/0xa4
      [    8.663572] *pde = 00000000
      
      Initialize dma_ops properly in the 32-bit case.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      72d03802
    • 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: intel-iommu: Convert detect_intel_iommu to use iommu_init hook · 9d5ce73a
      FUJITA Tomonori 提交于
      This changes detect_intel_iommu() to set intel_iommu_init() to
      iommu_init hook if detect_intel_iommu() finds 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-6-git-send-email-fujita.tomonori@lab.ntt.co.jp>
      [ -v2: build fix for the !CONFIG_DMAR case ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9d5ce73a
    • F
      x86: amd_iommu: Convert amd_iommu_detect() to use iommu_init hook · ea1b0d39
      FUJITA Tomonori 提交于
      This changes amd_iommu_detect() to set amd_iommu_init to
      iommu_init hook if amd_iommu_detect() finds the AMD IOMMU.
      
      We can kill the code to check if we found the IOMMU in
      amd_iommu_init() since amd_iommu_detect() sets amd_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-5-git-send-email-fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ea1b0d39
    • 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
    • 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
    • F
      x86: Add iommu_init to x86_init_ops · d07c1be0
      FUJITA Tomonori 提交于
      We call the detections functions of all the IOMMUs then all
      their initialization functions. The latter is pointless since we
      don't detect multiple different IOMMUs. What we need to do is
      calling the initialization function of the detected IOMMU.
      
      This adds iommu_init hook to x86_init_ops so if an IOMMU
      detection function can set its initialization function to the
      hook.
      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-2-git-send-email-fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d07c1be0
  14. 08 11月, 2009 3 次提交
  15. 12 10月, 2009 1 次提交
  16. 04 10月, 2009 1 次提交
  17. 10 9月, 2009 1 次提交
  18. 03 9月, 2009 1 次提交
  19. 01 9月, 2009 1 次提交
  20. 03 8月, 2009 1 次提交
  21. 28 7月, 2009 1 次提交
  22. 02 7月, 2009 1 次提交
  23. 15 6月, 2009 1 次提交
  24. 01 5月, 2009 1 次提交
  25. 29 4月, 2009 1 次提交
    • F
      Intel IOMMU Pass Through Support · 4ed0d3e6
      Fenghua Yu 提交于
      The patch adds kernel parameter intel_iommu=pt to set up pass through
      mode in context mapping entry. This disables DMAR in linux kernel; but
      KVM still runs on VT-d and interrupt remapping still works.
      
      In this mode, kernel uses swiotlb for DMA API functions but other VT-d
      functionalities are enabled for KVM. KVM always uses multi level
      translation page table in VT-d. By default, pass though mode is disabled
      in kernel.
      
      This is useful when people don't want to enable VT-d DMAR in kernel but
      still want to use KVM and interrupt remapping for reasons like DMAR
      performance concern or debug purpose.
      Signed-off-by: NFenghua Yu <fenghua.yu@intel.com>
      Acked-by: NWeidong Han <weidong@intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      4ed0d3e6
  26. 07 4月, 2009 3 次提交
  27. 21 3月, 2009 1 次提交
  28. 17 3月, 2009 1 次提交