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

Re: [PATCH] xen/arm: p2m_set_entry duplicate calculation.



On Fri, 22 Apr 2022, Paran Lee wrote:
> It doesn't seem necessary to do that calculation of order shift again.
> 
> Signed-off-by: Paran Lee <p4ranlee@xxxxxxxxx>

Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>


> ---
>  xen/arch/arm/p2m.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index 1d1059f7d2..533afc830a 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -1092,7 +1092,7 @@ int p2m_set_entry(struct p2m_domain *p2m,
>      while ( nr )
>      {
>          unsigned long mask;
> -        unsigned long order;
> +        unsigned long order, pages;
>  
>          /*
>           * Don't take into account the MFN when removing mapping (i.e
> @@ -1118,11 +1118,12 @@ int p2m_set_entry(struct p2m_domain *p2m,
>          if ( rc )
>              break;
>  
> -        sgfn = gfn_add(sgfn, (1 << order));
> +        pages = 1 << order;
> +        sgfn = gfn_add(sgfn, pages);
>          if ( !mfn_eq(smfn, INVALID_MFN) )
> -           smfn = mfn_add(smfn, (1 << order));
> +           smfn = mfn_add(smfn, pages);
>  
> -        nr -= (1 << order);
> +        nr -= pages;
>      }
>  
>      return rc;
> -- 
> 2.25.1
> 



 


Rackspace

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