[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.6] vt-d: fix IM bit mask and unmask of Fault Event Control Register
commit 6307ebcbd7d3c2db3adb087d1d614b97cb5e64cc Author: Quan Xu <quan.xu@xxxxxxxxx> AuthorDate: Mon Sep 28 17:38:09 2015 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Mon Sep 28 17:38:09 2015 +0200 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@xxxxxxxxx> Acked-by: Yang Zhang <yang.z.zhang@xxxxxxxxx> Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx> 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. Suggested-by: Jan Beulich <jbeulich@xxxxxxxx> Signed-off-by: Quan Xu <quan.xu@xxxxxxxxx> master commit: 86f3ff9fc4cc3cb69b96c1de74bcc51f738fe2b9 master date: 2015-09-25 09:08:22 +0200 master commit: 26b300bd727ef00a8f60329212a83c3b027a48f7 master date: 2015-09-25 18:03:04 +0200 --- xen/drivers/passthrough/vtd/iommu.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index b67b624..dd13865 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -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; } @@ -2006,6 +2012,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. @@ -2019,7 +2026,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); } -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.6 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |