From: George Dunlap <george.dunlap@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
Xen-devel <xen-devel@lists.xen.org>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
Tim Deegan <tim@xen.org>, Wei Liu <wei.liu2@citrix.com>,
Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH 2/3] x86/mm: Replace opencoded forms of map_l?t_from_l?e()
Date: Fri, 25 Aug 2017 15:57:30 +0100 [thread overview]
Message-ID: <2f793479-888c-93ff-7ed7-c9a97927b9b1@citrix.com> (raw)
In-Reply-To: <1503580497-22936-3-git-send-email-andrew.cooper3@citrix.com>
On 08/24/2017 02:14 PM, Andrew Cooper wrote:
> No functional change (confirmed by diffing the disassembly).
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Tim Deegan <tim@xen.org>
> CC: George Dunlap <george.dunlap@eu.citrix.com>
> ---
> xen/arch/x86/mm.c | 8 ++++----
> xen/arch/x86/mm/p2m-pt.c | 6 +++---
> xen/arch/x86/pv/dom0_build.c | 6 +++---
> 3 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
> index e6b7829..1e0ae2f 100644
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -6131,7 +6131,7 @@ int create_perdomain_mapping(struct domain *d, unsigned long va,
> l3tab[l3_table_offset(va)] = l3e_from_page(pg, __PAGE_HYPERVISOR_RW);
> }
> else
> - l2tab = map_domain_page(_mfn(l3e_get_pfn(l3tab[l3_table_offset(va)])));
> + l2tab = map_l2t_from_l3e(l3tab[l3_table_offset(va)]);
>
> unmap_domain_page(l3tab);
>
> @@ -6173,7 +6173,7 @@ int create_perdomain_mapping(struct domain *d, unsigned long va,
> *pl2e = l2e_from_page(pg, __PAGE_HYPERVISOR_RW);
> }
> else if ( !l1tab )
> - l1tab = map_domain_page(_mfn(l2e_get_pfn(*pl2e)));
> + l1tab = map_l1t_from_l2e(*pl2e);
>
> if ( ppg &&
> !(l1e_get_flags(l1tab[l1_table_offset(va)]) & _PAGE_PRESENT) )
> @@ -6224,7 +6224,7 @@ void destroy_perdomain_mapping(struct domain *d, unsigned long va,
>
> if ( l3e_get_flags(*pl3e) & _PAGE_PRESENT )
> {
> - const l2_pgentry_t *l2tab = map_domain_page(_mfn(l3e_get_pfn(*pl3e)));
> + const l2_pgentry_t *l2tab = map_l2t_from_l3e(*pl3e);
> const l2_pgentry_t *pl2e = l2tab + l2_table_offset(va);
> unsigned int i = l1_table_offset(va);
>
> @@ -6232,7 +6232,7 @@ void destroy_perdomain_mapping(struct domain *d, unsigned long va,
> {
> if ( l2e_get_flags(*pl2e) & _PAGE_PRESENT )
> {
> - l1_pgentry_t *l1tab = map_domain_page(_mfn(l2e_get_pfn(*pl2e)));
> + l1_pgentry_t *l1tab = map_l1t_from_l2e(*pl2e);
>
> for ( ; nr && i < L1_PAGETABLE_ENTRIES; --nr, ++i )
> {
> diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
> index 628a53e..f0d8076 100644
> --- a/xen/arch/x86/mm/p2m-pt.c
> +++ b/xen/arch/x86/mm/p2m-pt.c
> @@ -1026,7 +1026,7 @@ long p2m_pt_audit_p2m(struct p2m_domain *p2m)
> gfn += 1 << (L4_PAGETABLE_SHIFT - PAGE_SHIFT);
> continue;
> }
> - l3e = map_domain_page(_mfn(l4e_get_pfn(l4e[i4])));
> + l3e = map_l3t_from_l4e(l4e[i4]);
> for ( i3 = 0;
> i3 < L3_PAGETABLE_ENTRIES;
> i3++ )
> @@ -1061,7 +1061,7 @@ long p2m_pt_audit_p2m(struct p2m_domain *p2m)
> }
> }
>
> - l2e = map_domain_page(_mfn(l3e_get_pfn(l3e[i3])));
> + l2e = map_l2t_from_l3e(l3e[i3]);
> for ( i2 = 0; i2 < L2_PAGETABLE_ENTRIES; i2++ )
> {
> if ( !(l2e_get_flags(l2e[i2]) & _PAGE_PRESENT) )
> @@ -1097,7 +1097,7 @@ long p2m_pt_audit_p2m(struct p2m_domain *p2m)
> continue;
> }
>
> - l1e = map_domain_page(_mfn(l2e_get_pfn(l2e[i2])));
> + l1e = map_l1t_from_l2e(l2e[i2]);
>
> for ( i1 = 0; i1 < L1_PAGETABLE_ENTRIES; i1++, gfn++ )
> {
> diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
> index e67ffdd..ec7f96d 100644
> --- a/xen/arch/x86/pv/dom0_build.c
> +++ b/xen/arch/x86/pv/dom0_build.c
> @@ -142,7 +142,7 @@ static __init void setup_pv_physmap(struct domain *d, unsigned long pgtbl_pfn,
> clear_page(pl3e);
> *pl4e = l4e_from_page(page, L4_PROT);
> } else
> - pl3e = map_domain_page(_mfn(l4e_get_pfn(*pl4e)));
> + pl3e = map_l3t_from_l4e(*pl4e);
>
> pl3e += l3_table_offset(vphysmap_start);
> if ( !l3e_get_intpte(*pl3e) )
> @@ -169,7 +169,7 @@ static __init void setup_pv_physmap(struct domain *d, unsigned long pgtbl_pfn,
> *pl3e = l3e_from_page(page, L3_PROT);
> }
> else
> - pl2e = map_domain_page(_mfn(l3e_get_pfn(*pl3e)));
> + pl2e = map_l2t_from_l3e(*pl3e);
>
> pl2e += l2_table_offset(vphysmap_start);
> if ( !l2e_get_intpte(*pl2e) )
> @@ -195,7 +195,7 @@ static __init void setup_pv_physmap(struct domain *d, unsigned long pgtbl_pfn,
> *pl2e = l2e_from_page(page, L2_PROT);
> }
> else
> - pl1e = map_domain_page(_mfn(l2e_get_pfn(*pl2e)));
> + pl1e = map_l1t_from_l2e(*pl2e);
>
> pl1e += l1_table_offset(vphysmap_start);
> BUG_ON(l1e_get_intpte(*pl1e));
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-08-25 14:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-24 13:14 [PATCH 0/3] x86/mm: Nonfunctional code hygene improvements Andrew Cooper
2017-08-24 13:14 ` [PATCH 1/3] x86/mm: Replace opencoded forms of l?e_{get, from}_page() Andrew Cooper
2017-08-24 13:26 ` Jan Beulich
2017-08-24 14:19 ` Wei Liu
2017-08-25 14:56 ` George Dunlap
2017-08-24 13:14 ` [PATCH 2/3] x86/mm: Replace opencoded forms of map_l?t_from_l?e() Andrew Cooper
2017-08-24 13:28 ` Jan Beulich
2017-08-24 14:19 ` Wei Liu
2017-08-25 14:57 ` George Dunlap [this message]
2017-08-24 13:14 ` [PATCH 3/3] x86/mm: Introduce and use l?e_{get, from}_mfn() Andrew Cooper
2017-08-24 13:32 ` Jan Beulich
2017-08-24 13:34 ` Andrew Cooper
2017-08-24 14:17 ` Tim Deegan
2017-08-24 14:19 ` Wei Liu
2017-08-25 15:00 ` George Dunlap
2017-08-25 15:03 ` George Dunlap
2017-08-25 15:11 ` Andrew Cooper
2017-08-25 15:07 ` George Dunlap
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=2f793479-888c-93ff-7ed7-c9a97927b9b1@citrix.com \
--to=george.dunlap@citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.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).