xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Wei Liu <wei.liu2@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 1/2] x86/mm: Override mfn_to_page() and page_to_mfn() to use mfn_t
Date: Fri, 18 Aug 2017 13:17:04 +0100	[thread overview]
Message-ID: <33bbea06-8f7d-709e-bfd9-3e290f772a90@citrix.com> (raw)
In-Reply-To: <5996F6BB0200007800171156@prv-mh.provo.novell.com>

On 18/08/17 13:16, Jan Beulich wrote:
>>>> On 18.08.17 at 12:27, <andrew.cooper3@citrix.com> 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@citrix.com>
> Acked-by: Jan Beulich <jbeulich@suse.com>
> 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?

Will do.

~Andrew

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

      reply	other threads:[~2017-08-18 12:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18 10:27 [PATCH 1/2] x86/mm: Override mfn_to_page() and page_to_mfn() to use mfn_t Andrew Cooper
2017-08-18 10:27 ` [PATCH 2/2] x86/smp: Misc cleanup Andrew Cooper
2017-08-18 11:52   ` Wei Liu
2017-08-18 12:17   ` Jan Beulich
2017-08-18 11:51 ` [PATCH 1/2] x86/mm: Override mfn_to_page() and page_to_mfn() to use mfn_t Wei Liu
2017-08-18 12:16 ` Jan Beulich
2017-08-18 12:17   ` Andrew Cooper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33bbea06-8f7d-709e-bfd9-3e290f772a90@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).