Weidong, I agree that supporting multiple devices is important, but I think that supporting a single device is good enough for a first merge with the main kvm tree. I suggest that we focus on merging with the main tree and work on this in the background.
Note that I made quite a few cleanups to the vtd.c code (checkpatch fixes etc.), also the memory pinning fix is directly related to the multiple devices and we need to merge it all. Since Amit is going to be out of the office, I'll setup a tree that we can use. Regarding the specific patch, can we do it simpler? It seems to me that we can get what we need without the vtd domain list and device list per domain. Also, I could not find where you checked if we can use the same domain for two device. It seems that it creates a new domain for each new device. Here is an alternative approach that does not require new lists: Each device has a link to a domain (like in the original implementation). Each domain has a reference count (probably need a wrapper around dmar_domain for that). When adding a new device: Loop the pt devices and check if there is a device in the same iommu that can share its domain. If no: create a domain and set ref count to 1 If yes: point to that domain and increment the domain reference count. Removing a device: Decrement the domain reference count. If reference count is 0, release domain resources. kvm_iommu_map_pages: need to make sure that we do it once for each domain, there are some simple options that does not require additional list. Do you see any reason why this is not good enough? Thanks, Ben -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
