WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH 0/5] VT-d support for PV guests

To: "Espen Skoglund" <espen.skoglund@xxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH 0/5] VT-d support for PV guests
From: "Yang, Xiaowei" <xiaowei.yang@xxxxxxxxx>
Date: Tue, 20 May 2008 15:52:28 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 20 May 2008 00:53:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aci6TnNggVVMPxANTN6x6UZrI3+uuw==
Thread-topic: RE: [Xen-devel] [PATCH 0/5] VT-d support for PV guests
>
>I've added some preliminary support for VT-d for paravirtualized
>guests.  This must be enabled using an 'iommu_pv' boot parameter
>(disabled by default).
>
>I've added some python bindigs to allow xend to assign PCI devices to
>IOMMU for PV guests.  For HVM guests this is handled in ioemu.  Not
>sure if it makes sense to handle both cases in one place.
>
>The changes currently hook into get_page_type() in xen/arch/x86/mm.c
>to map/unmap IOMMU pages when the page types change.  This might
>not be the apropriate place to hook these calls.
>
>The patches I've added are as follows:
>
>   xen-vtd-unmap.patch --- Make the VT-d iommu_unmap_page() code
>       actually do something close to useful.
>
>   xen-ptab-dump.path --- There's no point in using 'current' when an
>       IOMMU page fault is raised.  Also, add some page type
>       statistics for DomPage debug output.
>
>   xen-iommu-pv.patch --- Add support for iommu_pv_enable boot
>       parameter and IOMMU assignment of PCI devices to guests.
>
>   xen-iommu-pv-mappings.patch --- Hook iommu_{un}map_page() calls
>       into various Xen locations.
>

Espen,
The patches look good to me with some comments:

- For the occasions when P2M is changed, the hooks of
iommu_{un}map_page() can be added cleaner. Only the hooks inside
guest_physmap_add/remove_page() are necessary. The hooks in
populate_physmap() and memory_exchange() can be omitted by some small
code rearrangement like removing if(paging_mode_translate(d)) before
calling guest_physmap_add_page(). 

- gnttab_map/unmap_grant_ref() need to be hooked also. There are no P2M
changes at that time while the guest PT is updated directly. The mapped
pages can also be used for DMA by backend drivers.

- dom0 can be treated as the same as other PV domains with regard to VTd
PT updating. Unfortunately, it need some special care. All of devices
are assigned to it by default and usually it ones the most of devices.
iommu_{un}map_page() could be called very frequently by it while it
serves other domains IO requests. It will bring performance penalty and
CPU overhead. 

Thanks,
Xiaowei

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel