lkml.org 
[lkml]   [2015]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Fix bug in iommu_context_addr: Always get pointer to lower extended-context-table
Date
Hi David & joerg,

In iommu_context_addr() function, we always use lower extended-context-table
even though upper-half of the extended root-entry is present.

Signed-off-by: Nan Xiao <nan.xiao@hp.com>
---
drivers/iommu/intel-iommu.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 0649b94..4213598 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -759,10 +759,11 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu
if (devfn >= 0x80) {
devfn -= 0x80;
entry = &root->hi;
- }
+ } else
+ entry = &root->lo;
devfn *= 2;
- }
- entry = &root->lo;
+ } else
+ entry = &root->lo;
if (*entry & 1)
context = phys_to_virt(*entry & VTD_PAGE_MASK);
else {
--
2.4.3
Best Regards
Nan Xiao



\
 
 \ /
  Last update: 2015-08-24 09:01    [W:0.100 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site