All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Hongyan Xia <hx242@xen.org>
Cc: jgrall@amazon.com, "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v10 01/13] x86/mm: rewrite virt_to_xen_l*e
Date: Thu, 22 Apr 2021 13:54:30 +0200	[thread overview]
Message-ID: <b667c7ab-b12d-d46a-9318-925c4a19faaa@suse.com> (raw)
In-Reply-To: <0ccd3883b0ec2e05d600bb593f8f0afd058adc43.1619014052.git.hongyxia@amazon.com>

On 21.04.2021 16:15, Hongyan Xia wrote:
> From: Wei Liu <wei.liu2@citrix.com>
> 
> Rewrite those functions to use the new APIs. Modify its callers to unmap
> the pointer returned. Since alloc_xen_pagetable_new() is almost never
> useful unless accompanied by page clearing and a mapping, introduce a
> helper alloc_map_clear_xen_pt() for this sequence.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Signed-off-by: Hongyan Xia <hongyxia@amazon.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
albeit ...

> @@ -4941,33 +4961,33 @@ static l3_pgentry_t *virt_to_xen_l3e(unsigned long v)
>      if ( !(l4e_get_flags(*pl4e) & _PAGE_PRESENT) )
>      {
>          bool locking = system_state > SYS_STATE_boot;
> -        l3_pgentry_t *l3t = alloc_xen_pagetable();
> +        mfn_t l3mfn;
> +        l3_pgentry_t *l3t = alloc_mapped_pagetable(&l3mfn);
>  
>          if ( !l3t )
>              return NULL;
> -        clear_page(l3t);
> +        UNMAP_DOMAIN_PAGE(l3t);

... this immediate unmapping (and then re-mapping below) will imo
want re-doing down the road as well. Even if it's not a severe
performance hit, it's simply odd, at least to me.

Jan


  reply	other threads:[~2021-04-22 11:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 14:15 [PATCH v10 00/13] switch to domheap for Xen page tables Hongyan Xia
2021-04-21 14:15 ` [PATCH v10 01/13] x86/mm: rewrite virt_to_xen_l*e Hongyan Xia
2021-04-22 11:54   ` Jan Beulich [this message]
2021-04-21 14:15 ` [PATCH v10 02/13] x86/mm: switch to new APIs in map_pages_to_xen Hongyan Xia
2021-04-22 12:01   ` Jan Beulich
2021-04-21 14:15 ` [PATCH v10 03/13] x86/mm: switch to new APIs in modify_xen_mappings Hongyan Xia
2021-04-22 13:10   ` Hongyan Xia
2021-04-21 14:15 ` [PATCH v10 04/13] x86_64/mm: introduce pl2e in paging_init Hongyan Xia
2021-04-21 14:15 ` [PATCH v10 05/13] x86_64/mm: switch to new APIs " Hongyan Xia
2021-04-21 14:15 ` [PATCH v10 06/13] x86_64/mm: switch to new APIs in setup_m2p_table Hongyan Xia
2021-04-21 14:15 ` [PATCH v10 07/13] efi: use new page table APIs in copy_mapping Hongyan Xia
2021-04-21 14:15 ` [PATCH v10 08/13] efi: switch to new APIs in EFI code Hongyan Xia
2021-04-21 14:15 ` [PATCH v10 09/13] x86/smpboot: add exit path for clone_mapping() Hongyan Xia
2021-04-21 14:15 ` [PATCH v10 10/13] x86/smpboot: switch clone_mapping() to new APIs Hongyan Xia
2021-04-21 14:15 ` [PATCH v10 11/13] x86/mm: drop old page table APIs Hongyan Xia
2021-04-21 14:15 ` [PATCH v10 12/13] x86: switch to use domheap page for page tables Hongyan Xia
2021-04-21 14:15 ` [PATCH v10 13/13] x86/mm: drop _new suffix for page table APIs Hongyan Xia
2021-04-22 16:21 ` [PATCH v10 00/13] switch to domheap for Xen page tables Andrew Cooper
2021-04-22 16:35   ` Hongyan Xia
2021-04-22 17:27     ` Julien Grall
2021-04-22 17:28     ` Andrew Cooper

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=b667c7ab-b12d-d46a-9318-925c4a19faaa@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=hx242@xen.org \
    --cc=jgrall@amazon.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.