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

Re: [Xen-devel] [PATCH v3 09/14] xen/x86: mm: Re-implement set_gpfn_from_mfn() as a static inline function



>>> On 03.06.19 at 18:03, <julien.grall@xxxxxxx> wrote:
> --- a/xen/include/asm-x86/mm.h
> +++ b/xen/include/asm-x86/mm.h
> @@ -442,6 +442,8 @@ int check_descriptor(const struct domain *d, seg_desc_t 
> *desc);
>  
>  extern paddr_t mem_hotplug;
>  
> +extern struct domain *dom_xen, *dom_io, *dom_cow;    /* for vmcoreinfo */

Ah, now I see what Andrew was talking about. In my patch, I'll move
the declarations ahead of the asm/mm.h inclusion point then.

> @@ -483,24 +485,25 @@ extern paddr_t mem_hotplug;
>  #define SHARED_M2P(_e)           ((_e) == SHARED_M2P_ENTRY)
>  
>  #define compat_machine_to_phys_mapping ((unsigned int 
> *)RDWR_COMPAT_MPT_VIRT_START)
> -#define _set_gpfn_from_mfn(mfn, pfn) ({                        \
> -    struct domain *d = page_get_owner(mfn_to_page(_mfn(mfn))); \
> -    unsigned long entry = (d && (d == dom_cow)) ?              \
> -        SHARED_M2P_ENTRY : (pfn);                              \
> -    ((void)((mfn) >= (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) 
> / 4 || \
> -            (compat_machine_to_phys_mapping[(mfn)] = (unsigned 
> int)(entry))), \
> -     machine_to_phys_mapping[(mfn)] = (entry));                \
> -    })
>  
>  /*
>   * Disable some users of set_gpfn_from_mfn() (e.g., free_heap_pages()) until
>   * the machine_to_phys_mapping is actually set up.
>   */
>  extern bool machine_to_phys_mapping_valid;
> -#define set_gpfn_from_mfn(mfn, pfn) do {        \
> -    if ( machine_to_phys_mapping_valid )        \
> -        _set_gpfn_from_mfn(mfn, pfn);           \
> -} while (0)
> +
> +static inline void set_gpfn_from_mfn(unsigned long mfn, unsigned long pfn)
> +{
> +    struct domain *d = page_get_owner(mfn_to_page(_mfn(mfn)));

const? And with that then
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan



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