# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1214908903 -3600
# Node ID d4cf12d128eda92fc461571f2454e00ef7090e45
# Parent 0b7f7c564c83fafeecc5a08aeeda2d69dcfd73ae
VT-d: Fix queue invalidation
Correct invalidate_sync(), and clean up qinval_setup().
Signed-off-by: Weidong Han <weidong.han@xxxxxxxxx>
---
xen/drivers/passthrough/vtd/qinval.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff -r 0b7f7c564c83 -r d4cf12d128ed xen/drivers/passthrough/vtd/qinval.c
--- a/xen/drivers/passthrough/vtd/qinval.c Tue Jul 01 11:40:55 2008 +0100
+++ b/xen/drivers/passthrough/vtd/qinval.c Tue Jul 01 11:41:43 2008 +0100
@@ -222,7 +222,7 @@ int invalidate_sync(struct iommu *iommu)
int ret = -1;
struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
- if ( qi_ctrl->qinval_maddr == 0 )
+ if ( qi_ctrl->qinval_maddr != 0 )
{
ret = queue_invalidate_wait(iommu,
0, 1, 1, 1, &qi_ctrl->qinval_poll_status);
@@ -416,7 +416,6 @@ int qinval_setup(struct iommu *iommu)
int qinval_setup(struct iommu *iommu)
{
s_time_t start_time;
- u32 status = 0;
struct qi_ctrl *qi_ctrl;
struct iommu_flush *flush;
@@ -450,15 +449,12 @@ int qinval_setup(struct iommu *iommu)
/* Make sure hardware complete it */
start_time = NOW();
- for ( ; ; )
- {
- status = dmar_readl(iommu->reg, DMAR_GSTS_REG);
- if ( status & DMA_GSTS_QIES )
- break;
+ while ( !(dmar_readl(iommu->reg, DMAR_GSTS_REG) & DMA_GSTS_QIES) )
+ {
if ( NOW() > (start_time + DMAR_OPERATION_TIMEOUT) )
panic("Cannot set QIE field for queue invalidation\n");
cpu_relax();
}
- status = 0;
- return status;
-}
+
+ return 0;
+}
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|