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

Re: [Xen-devel] [PATCH 2/3] x86/p2mâpt: use preâcalculated IOMMU flags



Andrew pointed me to this one and suggested it go into 4.6 because it's
prerequisite for a bug fix patch.

On Mon, Sep 21, 2015 at 08:03:22AM -0600, Jan Beulich wrote:
> ... instead of recalculating them.
> 
> At once clean up formatting of the touched code and drop a stray loop
> local variable shadowing a function scope one.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 

Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>

> --- a/xen/arch/x86/mm/p2m-pt.c
> +++ b/xen/arch/x86/mm/p2m-pt.c
> @@ -655,17 +655,13 @@ p2m_pt_set_entry(struct p2m_domain *p2m,
>              if ( old_flags & _PAGE_PRESENT )
>                  amd_iommu_flush_pages(p2m->domain, gfn, page_order);
>          }
> +        else if ( iommu_pte_flags )
> +            for ( i = 0; i < (1UL << page_order); i++ )
> +                iommu_map_page(p2m->domain, gfn + i, mfn_x(mfn) + i,
> +                               iommu_pte_flags);
>          else
> -        {
> -            unsigned int flags = p2m_get_iommu_flags(p2mt);
> -
> -            if ( flags != 0 )
> -                for ( i = 0; i < (1UL << page_order); i++ )
> -                    iommu_map_page(p2m->domain, gfn+i, mfn_x(mfn)+i, flags);
> -            else
> -                for ( int i = 0; i < (1UL << page_order); i++ )
> -                    iommu_unmap_page(p2m->domain, gfn+i);
> -        }
> +            for ( i = 0; i < (1UL << page_order); i++ )
> +                iommu_unmap_page(p2m->domain, gfn + i);
>      }
>  
>      /*
> 
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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