Skip to contentSkip to conversation

vt-d: Fix IM bit unmask of Fault Event Control Register in init_vtd_hw().

PATCH In review Quan Xu 2 participants 2 messages Sep 25, 2015

lore
Share & tools
lore

Quan Xu

author
#0 lore raw

PATCH 1/1 vt-d: Fix IM bit unmask of Fault Event Control Register in init_vtd_hw().

Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved', software cannot write 0 to it unconditionally. Software must preserve the value read for writes.

---
 xen/drivers/passthrough/vtd/iommu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
xen/drivers/passthrough/vtd/iommu.c +4 -1
index f31d41b..bf9d6e8 100644
@@ -2277,6 +2277,7 @@ static int init_vtd_hw(void)
     struct iommu_flush *flush = NULL;
     int ret;
     unsigned long flags;
+    u32 sts;
 
     /*
      * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
@@ -2290,7 +2291,9 @@ static int init_vtd_hw(void)
         clear_fault_bits(iommu);
 
         spin_lock_irqsave(&iommu->register_lock, flags);
-        dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+        sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+        sts &= ~DMA_FECTL_IM;
+        dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
         spin_unlock_irqrestore(&iommu->register_lock, flags);
     }
 
Signature · 1 line
1.8.3.2