aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/dmar.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2009-05-10 14:58:49 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-05-10 14:58:49 -0400
commit1f0ef2aa18802a8ce7eb5a5164aaaf4d59073801 (patch)
tree953fd29f1853b0773e9dcd72ab1ecb3231c6b457 /drivers/pci/dmar.c
parent4c25a2c1b90bf785fc2e2f0f0c74a80b3e070d39 (diff)
intel-iommu: Clean up handling of "caching mode" vs. IOTLB flushing.
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: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci/dmar.c')
-rw-r--r--drivers/pci/dmar.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 10a071ba3232..df6af0d4ec03 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -735,22 +735,14 @@ void qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, u8 fm,
735 qi_submit_sync(&desc, iommu); 735 qi_submit_sync(&desc, iommu);
736} 736}
737 737
738int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr, 738void qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
739 unsigned int size_order, u64 type, 739 unsigned int size_order, u64 type)
740 int non_present_entry_flush)
741{ 740{
742 u8 dw = 0, dr = 0; 741 u8 dw = 0, dr = 0;
743 742
744 struct qi_desc desc; 743 struct qi_desc desc;
745 int ih = 0; 744 int ih = 0;
746 745
747 if (non_present_entry_flush) {
748 if (!cap_caching_mode(iommu->cap))
749 return 1;
750 else
751 did = 0;
752 }
753
754 if (cap_write_drain(iommu->cap)) 746 if (cap_write_drain(iommu->cap))
755 dw = 1; 747 dw = 1;
756 748
@@ -762,7 +754,7 @@ int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
762 desc.high = QI_IOTLB_ADDR(addr) | QI_IOTLB_IH(ih) 754 desc.high = QI_IOTLB_ADDR(addr) | QI_IOTLB_IH(ih)
763 | QI_IOTLB_AM(size_order); 755 | QI_IOTLB_AM(size_order);
764 756
765 return qi_submit_sync(&desc, iommu); 757 qi_submit_sync(&desc, iommu);
766} 758}
767 759
768/* 760/*