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

Re: [Xen-devel] [PATCH 1/2] x86/mm: Override mfn_to_page() and page_to_mfn() to use mfn_t



>>> On 18.08.17 at 12:27, <andrew.cooper3@xxxxxxxxxx> wrote:
> To avoid breaking the build elsewhere, the l{1..4}e_{from,get}_page() macros
> are switched to using __mfn_to_page() and __page_to_mfn().
> 
> Most changes are wrapping or removing _mfn()/mfn_x() from existing callsites.
> 
> However, {alloc,free}_l1_table() are switched to using __map_domain_page(), as
> their pfn parameters are otherwise unused.  get_page() has one pfn->mfn
> correction in a printk(), and __get_page_type()'s IOMMU handling has its gfn
> calculation broken out for clarity.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
with Wei's remark addressed and with one optional further request:

> --- a/xen/include/asm-x86/page.h
> +++ b/xen/include/asm-x86/page.h
> @@ -82,10 +82,10 @@
>      ((paddr_t)(((x).l4 & (PADDR_MASK&PAGE_MASK))))
>  
>  /* Get pointer to info structure of page mapped by pte (struct page_info *). 
> */
> -#define l1e_get_page(x)           (mfn_to_page(l1e_get_pfn(x)))
> -#define l2e_get_page(x)           (mfn_to_page(l2e_get_pfn(x)))
> -#define l3e_get_page(x)           (mfn_to_page(l3e_get_pfn(x)))
> -#define l4e_get_page(x)           (mfn_to_page(l4e_get_pfn(x)))
> +#define l1e_get_page(x)           (__mfn_to_page(l1e_get_pfn(x)))
> +#define l2e_get_page(x)           (__mfn_to_page(l2e_get_pfn(x)))
> +#define l3e_get_page(x)           (__mfn_to_page(l3e_get_pfn(x)))
> +#define l4e_get_page(x)           (__mfn_to_page(l4e_get_pfn(x)))
>  
>  /* Get pte access flags (unsigned int). */
>  #define l1e_get_flags(x)           (get_pte_flags((x).l1))
> @@ -145,10 +145,10 @@ static inline l4_pgentry_t l4e_from_paddr(paddr_t pa, 
> unsigned int flags)
>  #define l4e_from_intpte(intpte)    ((l4_pgentry_t) { (intpte_t)(intpte) })
>  
>  /* Construct a pte from a page pointer and access flags. */
> -#define l1e_from_page(page, flags) (l1e_from_pfn(page_to_mfn(page),(flags)))
> -#define l2e_from_page(page, flags) (l2e_from_pfn(page_to_mfn(page),(flags)))
> -#define l3e_from_page(page, flags) (l3e_from_pfn(page_to_mfn(page),(flags)))
> -#define l4e_from_page(page, flags) (l4e_from_pfn(page_to_mfn(page),(flags)))
> +#define l1e_from_page(page, flags) (l1e_from_pfn(__page_to_mfn(page), 
> (flags)))
> +#define l2e_from_page(page, flags) (l2e_from_pfn(__page_to_mfn(page), 
> (flags)))
> +#define l3e_from_page(page, flags) (l3e_from_pfn(__page_to_mfn(page), 
> (flags)))
> +#define l4e_from_page(page, flags) (l4e_from_pfn(__page_to_mfn(page), 
> (flags)))

Mind at once stripping the pointless outer parentheses from all
the macros you modify, and the ones around flags in the latter
set?

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