* [PATCH] VT-d code cleanup
@ 2008-11-27 6:17 Han, Weidong
2008-12-05 7:33 ` Zhao, Yu
0 siblings, 1 reply; 2+ messages in thread
From: Han, Weidong @ 2008-11-27 6:17 UTC (permalink / raw)
To: 'Keir Fraser', xen-devel@lists.xensource.com; +Cc: Kay, Allen M
[-- Attachment #1: Type: text/plain, Size: 306 bytes --]
- remove a printk line. This printk may be output too many on some platforms, thus result in hang during dom0 booting.
- add write buffer flush in domain_context_unmap_one()
- when map/unmap context, if context is not flushed, needn't to flush iotlb.
Signed-off-by: Weidong Han <weidong.han@intel.com>
[-- Attachment #2: vtd-cleanup.patch --]
[-- Type: application/octet-stream, Size: 1968 bytes --]
diff -r e7c421510be9 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c Mon Nov 24 13:57:48 2008 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c Wed Nov 26 17:09:00 2008 +0800
@@ -446,10 +446,6 @@ static int flush_iotlb_reg(void *_iommu,
if ( DMA_TLB_IAIG(val) == 0 )
dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: flush IOTLB failed\n");
- if ( DMA_TLB_IAIG(val) != DMA_TLB_IIRG(type) )
- dprintk(XENLOG_INFO VTDPREFIX,
- "IOMMU: tlb flush request %x, actual %x\n",
- (u32)DMA_TLB_IIRG(type), (u32)DMA_TLB_IAIG(val));
/* flush iotlb entry will implicitly flush write buffer */
return 0;
}
@@ -1125,10 +1121,11 @@ static int domain_context_mapping_one(
unmap_vtd_domain_page(context_entries);
/* Context entry was previously non-present (with domid 0). */
- iommu_flush_context_device(iommu, 0, (((u16)bus) << 8) | devfn,
- DMA_CCMD_MASK_NOBIT, 1);
- if ( iommu_flush_iotlb_dsi(iommu, 0, 1) )
+ if ( iommu_flush_context_device(iommu, 0, (((u16)bus) << 8) | devfn,
+ DMA_CCMD_MASK_NOBIT, 1) )
iommu_flush_write_buffer(iommu);
+ else
+ iommu_flush_iotlb_dsi(iommu, 0, 1);
set_bit(iommu->index, &hd->iommu_bitmap);
spin_unlock_irqrestore(&iommu->lock, flags);
@@ -1308,8 +1305,12 @@ static int domain_context_unmap_one(
context_clear_present(*context);
context_clear_entry(*context);
iommu_flush_cache_entry(context);
- iommu_flush_context_domain(iommu, domain_iommu_domid(domain), 0);
- iommu_flush_iotlb_dsi(iommu, domain_iommu_domid(domain), 0);
+
+ if ( iommu_flush_context_domain(iommu, domain_iommu_domid(domain), 0) )
+ iommu_flush_write_buffer(iommu);
+ else
+ iommu_flush_iotlb_dsi(iommu, domain_iommu_domid(domain), 0);
+
unmap_vtd_domain_page(context_entries);
spin_unlock_irqrestore(&iommu->lock, flags);
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH] VT-d code cleanup
2008-11-27 6:17 [PATCH] VT-d code cleanup Han, Weidong
@ 2008-12-05 7:33 ` Zhao, Yu
0 siblings, 0 replies; 2+ messages in thread
From: Zhao, Yu @ 2008-12-05 7:33 UTC (permalink / raw)
To: xen-devel@lists.xensource.com
Cc: Kay, Allen M, Han, Weidong, 'Keir Fraser'
[-- Attachment #1: Type: text/plain, Size: 167 bytes --]
This patch narrow context caching flush range from the domain-selective
to the device-selective, when unmapping a device.
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
[-- Attachment #2: vtd-cci.patch --]
[-- Type: text/plain, Size: 700 bytes --]
diff -r f39673ce7d6e xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c Mon Dec 01 13:45:46 2008 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c Tue Dec 02 06:27:02 2008 -0500
@@ -1308,7 +1308,9 @@
context_clear_entry(*context);
iommu_flush_cache_entry(context);
- if ( iommu_flush_context_domain(iommu, domain_iommu_domid(domain), 0) )
+ if ( iommu_flush_context_device(iommu, domain_iommu_domid(domain),
+ (((u16)bus) << 8) | devfn,
+ DMA_CCMD_MASK_NOBIT, 0) )
iommu_flush_write_buffer(iommu);
else
iommu_flush_iotlb_dsi(iommu, domain_iommu_domid(domain), 0);
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-05 7:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-27 6:17 [PATCH] VT-d code cleanup Han, Weidong
2008-12-05 7:33 ` Zhao, Yu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.