diff options
author | Joerg Roedel <jroedel@suse.de> | 2015-08-25 10:54:28 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-09-29 19:26:14 +0200 |
commit | feab9b2a1002c23d415f7a2db4f4777c60d3eb52 (patch) | |
tree | 369c8e64339b1982f406ce3de92a53d854de25fc /drivers | |
parent | 1f398b31044845397b5e2fefdb7ac247180e6a7c (diff) | |
download | lwn-feab9b2a1002c23d415f7a2db4f4777c60d3eb52.tar.gz lwn-feab9b2a1002c23d415f7a2db4f4777c60d3eb52.zip |
iommu/vt-d: Really use upper context table when necessary
commit 4df4eab168c1c4058603be55a3169d4a45779cc0 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iommu/intel-iommu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index c87c4b1bfc00..c23427951ec1 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -681,6 +681,7 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu struct context_entry *context; u64 *entry; + entry = &root->lo; if (ecs_enabled(iommu)) { if (devfn >= 0x80) { devfn -= 0x80; @@ -688,7 +689,6 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu } devfn *= 2; } - entry = &root->lo; if (*entry & 1) context = phys_to_virt(*entry & VTD_PAGE_MASK); else { |