mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
vt-d: fix IM bit mask and unmask of Fault Event Control Register
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 <quan.xu@intel.com> Acked-by: Yang Zhang <yang.z.zhang@intel.com>
This commit is contained in:
1 parent
f96b29118a
commit
86f3ff9fc4
1 file changed
+8
-2
@@ -991,10 +991,13 @@ static void dma_msi_unmask(struct irq_desc *desc)
|
||||
{
|
||||
struct iommu *iommu = desc->action->dev_id;
|
||||
unsigned long flags;
|
||||
u32 sts;
|
||||
|
||||
/* unmask it */
|
||||
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);
|
||||
iommu->msi.msi_attrib.host_masked = 0;
|
||||
}
|
||||
@@ -1003,10 +1006,13 @@ static void dma_msi_mask(struct irq_desc *desc)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct iommu *iommu = desc->action->dev_id;
|
||||
u32 sts;
|
||||
|
||||
/* mask it */
|
||||
spin_lock_irqsave(&iommu->register_lock, flags);
|
||||
dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
|
||||
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);
|
||||
iommu->msi.msi_attrib.host_masked = 1;
|
||||
}
|
||||
|
||||