[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] amd iommu: disable iommu emulation on non-iommu systems



>>> On 26.01.12 at 11:56, Wei Wang <wei.wang2@xxxxxxx> wrote:
>--- a/xen/drivers/passthrough/amd/iommu_guest.c        Tue Jan 24 16:46:17 
>2012 +0000
>+++ b/xen/drivers/passthrough/amd/iommu_guest.c        Thu Jan 26 11:50:02 
>2012 +0100
>@@ -805,6 +805,9 @@ int guest_iommu_set_base(struct domain *
>     p2m_type_t t;
>     struct guest_iommu *iommu = domain_iommu(d);
> 
>+    if ( !is_hvm_domain(d) || !iommu_enabled || !iommuv2_enabled )
>+        return 0;

Is it really appropriate/correct to return 0 here, while ...

>+
>     if ( !iommu )
>         return -EACCES;
> 

... here it is -EACCES? Further, are the extra checks needed at all
(i.e. wouldn't domain_iommu() return NULL in all of these cases
anyway due to the same checks being added to guest_iommu_init())?
If so, the checks you add to guest_iommu_destroy() are pointless
too.

Jan


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.