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

Re: [Xen-devel] [PATCH] amd iommu: Fix a return value of guest_iommu_set_base()



>>> On 03.02.12 at 16:29, Wei Wang <wei.wang2@xxxxxxx> wrote:
> # HG changeset patch
> # User Wei Wang <wei.wang2@xxxxxxx>
> # Date 1328282938 -3600
> # Node ID 58a2281581a4c4171ca52549b3e8062b9733ec2b
> # Parent  3432abcf9380d3840ca38439a304f74a37d155fc
> amd iommu: Fix a return value of guest_iommu_set_base()
> Remove a unnecessary check in guest_iommu_destroy()
> 
> Signed-off-by: Wei Wang <wei.wang2@xxxxxxx>
> 
> diff -r 3432abcf9380 -r 58a2281581a4 xen/drivers/passthrough/amd/iommu_guest.c
> --- a/xen/drivers/passthrough/amd/iommu_guest.c       Thu Feb 02 15:47:26 
> 2012 +0000
> +++ b/xen/drivers/passthrough/amd/iommu_guest.c       Fri Feb 03 16:28:58 
> 2012 
> +0100
> @@ -806,7 +806,7 @@ int guest_iommu_set_base(struct domain *
>      struct guest_iommu *iommu = domain_iommu(d);
>  
>      if ( !is_hvm_domain(d) || !iommu_enabled || !iommuv2_enabled )
> -        return 0;
> +        return -EACCES;

But as indicated before, all three checks above are redundant with
the one check below. Hence I suggested to remove the checks above,
and if you wish put an ASSERT() past the !iommu check below.

Jan

>  
>      if ( !iommu )
>          return -EACCES;
> @@ -896,9 +896,6 @@ void guest_iommu_destroy(struct domain *
>  {
>      struct guest_iommu *iommu;
>  
> -    if ( !is_hvm_domain(d) || !iommu_enabled || !iommuv2_enabled )
> -        return;
> -
>      iommu = domain_iommu(d);
>      if ( !iommu )
>          return;




_______________________________________________
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®.