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

Re: [Xen-devel] [PATCH v2] boot allocator: Use arch helper for virt_to_mfn on DIRECTMAP



>>> On 13.03.17 at 12:43, <vijay.kilari@xxxxxxxxx> wrote:
> --- a/xen/include/asm-arm/mm.h
> +++ b/xen/include/asm-arm/mm.h
> @@ -260,6 +260,13 @@ static inline int gvirt_to_maddr(vaddr_t va, paddr_t 
> *pa, unsigned int flags)
>  #define virt_to_mfn(va)   (virt_to_maddr(va) >> PAGE_SHIFT)
>  #define mfn_to_virt(mfn)  (maddr_to_virt((paddr_t)(mfn) << PAGE_SHIFT))
>  
> +/*
> + * On ARM DIRECTMAP_VIRT region is directly mapped. Hence return true;
> + */
> +static inline bool_t arch_mfn_below_directmap_max_mfn(unsigned long mfn)
> +{
> +    return 1;
> +}

bool and true respectively, please (also on the x86 side).

> --- a/xen/include/asm-x86/page.h
> +++ b/xen/include/asm-x86/page.h
> @@ -18,6 +18,7 @@
>  #ifndef __ASSEMBLY__
>  # include <asm/types.h>
>  # include <xen/lib.h>
> +# include <xen/kernel.h>

Why?

> @@ -374,6 +375,21 @@ perms_strictly_increased(uint32_t old_flags, uint32_t 
> new_flags)
>      return ((of | (of ^ nf)) == nf);
>  }
>  
> +/*
> + * x86 maps DIRECTMAP_VIRT to physical memory. Get the mfn for directmap
> + * memory region.
> + */
> +static inline bool_t arch_mfn_below_directmap_max_mfn(unsigned long mfn)
> +{
> +#ifdef DIRECTMAP_VIRT_END

The symbol is always defined on x86 afaics - no need for the #ifdef.

Jan


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

 


Rackspace

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