1. May 11, 2009
    • David Woodhouse's avatar
      intel-iommu: Fix tiny theoretical race in write-buffer flush. · 462b60f6
      David Woodhouse authored
      
      
      In iommu_flush_write_buffer() we read iommu->gcmd before taking the
      register_lock, and then we mask in the WBF bit and write it to the
      register.
      
      There is a tiny chance that something else could have _changed_
      iommu->gcmd before we take the lock, but after we read it. So we could
      be undoing that change.
      
      Never actually going to have happened in practice, since nothing else
      changes that register at runtime -- aside from the write-buffer flush
      it's only ever touched at startup for enabling translation, etc.
      
      But worth fixing anyway.
      
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      462b60f6
    • David Woodhouse's avatar
      intel-iommu: Clean up handling of "caching mode" vs. IOTLB flushing. · 1f0ef2aa
      David Woodhouse authored
      
      
      As we just did for context cache flushing, clean up the logic around
      whether we need to flush the iotlb or just the write-buffer, depending
      on caching mode.
      
      Fix the same bug in qi_flush_iotlb() that qi_flush_context() had -- it
      isn't supposed to be returning an error; it's supposed to be returning a
      flag which triggers a write-buffer flush.
      
      Remove some superfluous conditional write-buffer flushes which could
      never have happened because they weren't for non-present-to-present
      mapping changes anyway.
      
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      1f0ef2aa
    • David Woodhouse's avatar
      intel-iommu: Clean up handling of "caching mode" vs. context flushing. · 4c25a2c1
      David Woodhouse authored
      
      
      It really doesn't make a lot of sense to have some of the logic to
      handle caching vs. non-caching mode duplicated in qi_flush_context() and
      __iommu_flush_context(), while the return value indicates whether the
      caller should take other action which depends on the same thing.
      
      Especially since qi_flush_context() thought it was returning something
      entirely different anyway.
      
      This patch makes qi_flush_context() and __iommu_flush_context() both
      return void, removes the 'non_present_entry_flush' argument and makes
      the only call site which _set_ that argument to 1 do the right thing.
      
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      4c25a2c1
  2. May 10, 2009
  3. May 01, 2009
  4. Apr 29, 2009
    • Fenghua Yu's avatar
      Intel IOMMU Pass Through Support · 4ed0d3e6
      Fenghua Yu authored
      
      
      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: default avatarFenghua Yu <fenghua.yu@intel.com>
      Acked-by: default avatarWeidong Han <weidong@intel.com>
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      4ed0d3e6
  5. Apr 22, 2009