vt-d: Fix IM bit unmask of Fault Event Control Register in init_vtd_hw().
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.
Signed-off-by Quan Xu <[email protected]>
Reported-by Jan Beulich <[email protected]>
--- xen/drivers/passthrough/vtd/iommu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
xen/drivers/passthrough/vtd/iommu.c +4 -1
@@ -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
Quoted 6 lines · Quan Xu
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.
Signed-off-by Quan Xu <[email protected]>Reported-by Jan Beulich <[email protected]>
Release-acked-by Wei Liu <[email protected]>