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

Re: [Xen-devel] [PATCH for-next 7/9] xen: Convert is_xen_heap_mfn to use typesafe MFN



On Mon, 18 Feb 2019, Julien Grall wrote:
> diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
> index b56018aace..a9c8352b94 100644
> --- a/xen/include/asm-arm/mm.h
> +++ b/xen/include/asm-arm/mm.h
> @@ -138,16 +138,16 @@ extern vaddr_t xenheap_virt_start;
>  #endif
>  
>  #ifdef CONFIG_ARM_32
> -#define is_xen_heap_page(page) is_xen_heap_mfn(mfn_x(page_to_mfn(page)))
> +#define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
>  #define is_xen_heap_mfn(mfn) ({                                 \
> -    unsigned long mfn_ = (mfn);                                 \
> +    unsigned long mfn_ = mfn_x(mfn);                            \
>      (mfn_ >= mfn_x(xenheap_mfn_start) &&                        \
>       mfn_ < mfn_x(xenheap_mfn_end));                            \
>  })
>  #else
>  #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
>  #define is_xen_heap_mfn(mfn) \
> -    (mfn_valid(_mfn(mfn)) && is_xen_heap_page(mfn_to_page(_mfn(mfn))))
> +    (mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(mfn)))
>  #endif
>  
>  #define is_xen_fixed_mfn(mfn)                                   \
> @@ -246,7 +246,7 @@ static inline paddr_t __virt_to_maddr(vaddr_t va)
>  #ifdef CONFIG_ARM_32
>  static inline void *maddr_to_virt(paddr_t ma)
>  {
> -    ASSERT(is_xen_heap_mfn(ma >> PAGE_SHIFT));
> +    ASSERT(is_xen_heap_mfn(maddr_to_mfn(ma)));
>      ma -= mfn_to_maddr(xenheap_mfn_start);
>      return (void *)(unsigned long) ma + XENHEAP_VIRT_START;
>  }

For the ARM parts:

Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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