From: Jan Beulich <jbeulich@suse.com>
To: Hongyan Xia <hx242@xen.org>
Cc: xen-devel@lists.xenproject.org,
"Roger Pau Monné" <roger.pau@citrix.com>,
julien@xen.org, "Wei Liu" <wl@xen.org>,
"Andrew Cooper" <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v7 08/15] x86_64/mm: switch to new APIs in setup_m2p_table
Date: Tue, 14 Jul 2020 14:32:13 +0200 [thread overview]
Message-ID: <625a5450-daca-0837-6977-4b0ae237d988@suse.com> (raw)
In-Reply-To: <14aec5f25e8226a45dbc6b26fcc9981ea5f66a90.1590750232.git.hongyxia@amazon.com>
On 29.05.2020 13:11, Hongyan Xia wrote:
> From: Wei Liu <wei.liu2@citrix.com>
>
> Avoid repetitive mapping of l2_ro_mpt by keeping it across loops, and
> only unmap and map it when crossing 1G boundaries.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
I do think, however, that ...
> @@ -438,32 +443,29 @@ static int setup_m2p_table(struct mem_hotadd_info *info)
>
> ASSERT(!(l3e_get_flags(l3_ro_mpt[l3_table_offset(va)]) &
> _PAGE_PSE));
> - if ( l3e_get_flags(l3_ro_mpt[l3_table_offset(va)]) &
> - _PAGE_PRESENT )
> - l2_ro_mpt = l3e_to_l2e(l3_ro_mpt[l3_table_offset(va)]) +
> - l2_table_offset(va);
> - else
> + if ( (l3e_get_flags(l3_ro_mpt[l3_table_offset(va)]) &
> + _PAGE_PRESENT) && !l2_ro_mpt)
> + l2_ro_mpt = map_l2t_from_l3e(l3_ro_mpt[l3_table_offset(va)]);
> + else if ( !l2_ro_mpt )
> {
... this would be slightly neater as
if ( l2_ro_mpt )
/* nothing */;
else if ( l3e_get_flags(l3_ro_mpt[l3_table_offset(va)]) &
_PAGE_PRESENT )
l2_ro_mpt = map_l2t_from_l3e(l3_ro_mpt[l3_table_offset(va)]);
else
{
...
My R-b holds if you would change it like this.
Jan
next prev parent reply other threads:[~2020-07-14 12:32 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-29 11:11 [PATCH v7 00/15] switch to domheap for Xen page tables Hongyan Xia
2020-05-29 11:11 ` [PATCH v7 01/15] x86/mm: map_pages_to_xen would better have one exit path Hongyan Xia
2020-05-29 11:11 ` [PATCH v7 02/15] x86/mm: make sure there is one exit path for modify_xen_mappings Hongyan Xia
2020-05-29 11:11 ` [PATCH v7 03/15] x86/mm: rewrite virt_to_xen_l*e Hongyan Xia
2020-07-14 10:47 ` Jan Beulich
2020-07-27 9:09 ` Hongyan Xia
2020-07-27 19:31 ` Jan Beulich
2020-05-29 11:11 ` [PATCH v7 04/15] x86/mm: switch to new APIs in map_pages_to_xen Hongyan Xia
2020-07-14 11:52 ` Jan Beulich
2020-05-29 11:11 ` [PATCH v7 05/15] x86/mm: switch to new APIs in modify_xen_mappings Hongyan Xia
2020-07-14 11:55 ` Jan Beulich
2020-05-29 11:11 ` [PATCH v7 06/15] x86_64/mm: introduce pl2e in paging_init Hongyan Xia
2020-07-14 12:02 ` Jan Beulich
2020-05-29 11:11 ` [PATCH v7 07/15] x86_64/mm: switch to new APIs " Hongyan Xia
2020-07-14 12:03 ` Jan Beulich
2020-05-29 11:11 ` [PATCH v7 08/15] x86_64/mm: switch to new APIs in setup_m2p_table Hongyan Xia
2020-07-14 12:32 ` Jan Beulich [this message]
2020-07-14 12:33 ` Jan Beulich
2020-05-29 11:11 ` [PATCH v7 09/15] efi: use new page table APIs in copy_mapping Hongyan Xia
2020-07-14 12:42 ` Jan Beulich
2020-07-27 12:45 ` Hongyan Xia
2020-07-27 13:45 ` Hongyan Xia
2020-07-27 19:33 ` Jan Beulich
2020-05-29 11:11 ` [PATCH v7 10/15] efi: switch to new APIs in EFI code Hongyan Xia
2020-07-15 13:06 ` Jan Beulich
2020-05-29 11:11 ` [PATCH v7 11/15] x86/smpboot: add exit path for clone_mapping() Hongyan Xia
2020-05-29 11:11 ` [PATCH v7 12/15] x86/smpboot: switch clone_mapping() to new APIs Hongyan Xia
2020-07-15 13:11 ` Jan Beulich
2020-05-29 11:11 ` [PATCH v7 13/15] x86/mm: drop old page table APIs Hongyan Xia
2020-05-29 11:11 ` [PATCH v7 14/15] x86: switch to use domheap page for page tables Hongyan Xia
2020-07-15 13:16 ` Jan Beulich
2020-05-29 11:11 ` [PATCH v7 15/15] x86/mm: drop _new suffix for page table APIs Hongyan Xia
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=625a5450-daca-0837-6977-4b0ae237d988@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=hx242@xen.org \
--cc=julien@xen.org \
--cc=roger.pau@citrix.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.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).