aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2015-08-25 04:54:28 -0400
committerJoerg Roedel <jroedel@suse.de>2015-08-25 05:39:27 -0400
commit4df4eab168c1c4058603be55a3169d4a45779cc0 (patch)
treedb1db338f1453cae5012eb3fa58c532733a2c167 /drivers/iommu
parentca30475698696af3a03f6eaee16472ae09d42269 (diff)
iommu/vt-d: Really use upper context table when necessary
There is a bug in iommu_context_addr() which will always use the lower context table, even when the upper context table needs to be used. Fix this issue. Fixes: 03ecc32c5274 ("iommu/vt-d: support extended root and context entries") Reported-by: Xiao, Nan <nan.xiao@hp.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/intel-iommu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index a85077d4335b..63daf1ba04b7 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -803,6 +803,7 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu
803 struct context_entry *context; 803 struct context_entry *context;
804 u64 *entry; 804 u64 *entry;
805 805
806 entry = &root->lo;
806 if (ecs_enabled(iommu)) { 807 if (ecs_enabled(iommu)) {
807 if (devfn >= 0x80) { 808 if (devfn >= 0x80) {
808 devfn -= 0x80; 809 devfn -= 0x80;
@@ -810,7 +811,6 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu
810 } 811 }
811 devfn *= 2; 812 devfn *= 2;
812 } 813 }
813 entry = &root->lo;
814 if (*entry & 1) 814 if (*entry & 1)
815 context = phys_to_virt(*entry & VTD_PAGE_MASK); 815 context = phys_to_virt(*entry & VTD_PAGE_MASK);
816 else { 816 else {