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

Re: [Xen-devel] [PATCH for-next 9/9] xen: Remove mfn_to_gmfn macro



On Mon, 18 Feb 2019, Julien Grall wrote:
> On x86, mfn_to_gmfn can be replaced with mfn_to_gfn. On Arm, there are
> no more call to mfn_to_gmfn, so the helper can be dropped.
> 
> At the same time rework a comment in Arm code that does not make sense.
> 
> Signed-off-by: Julien Grall <julien.grall@xxxxxxx>

Lovely.

Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>

> ---
>  xen/drivers/passthrough/iommu.c | 6 +++---
>  xen/include/asm-arm/mm.h        | 4 +---
>  xen/include/asm-x86/mm.h        | 5 -----
>  3 files changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
> index 5742cd05b8..04ac46239e 100644
> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -193,8 +193,8 @@ void __hwdom_init iommu_hwdom_init(struct domain *d)
>  
>          page_list_for_each ( page, &d->page_list )
>          {
> -            unsigned long mfn = mfn_x(page_to_mfn(page));
> -            unsigned long dfn = mfn_to_gmfn(d, mfn);
> +            mfn_t mfn = page_to_mfn(page);
> +            unsigned long dfn = mfn_to_gfn(d, mfn);
>              unsigned int mapping = IOMMUF_readable;
>              int ret;
>  
> @@ -203,7 +203,7 @@ void __hwdom_init iommu_hwdom_init(struct domain *d)
>                    == PGT_writable_page) )
>                  mapping |= IOMMUF_writable;
>  
> -            ret = iommu_map(d, _dfn(dfn), _mfn(mfn), 0, mapping,
> +            ret = iommu_map(d, _dfn(dfn), mfn, 0, mapping,
>                              &flush_flags);
>  
>              if ( !rc )
> diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
> index a9c8352b94..a9cb98a6c7 100644
> --- a/xen/include/asm-arm/mm.h
> +++ b/xen/include/asm-arm/mm.h
> @@ -321,10 +321,8 @@ struct page_info *get_page_from_gva(struct vcpu *v, 
> vaddr_t va,
>  #define SHARED_M2P_ENTRY         (~0UL - 1UL)
>  #define SHARED_M2P(_e)           ((_e) == SHARED_M2P_ENTRY)
>  
> -/* Xen always owns P2M on ARM */
> +/* We don't have a M2P on Arm */
>  #define set_gpfn_from_mfn(mfn, pfn) do { (void) (mfn), (void)(pfn); } while 
> (0)
> -#define mfn_to_gmfn(_d, mfn)  (mfn)
> -
>  
>  /* Arch-specific portion of memory_op hypercall. */
>  long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg);

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