All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Hongyan Xia <hx242@xen.org>
Cc: xen-devel@lists.xenproject.org, julien@xen.org
Subject: Re: [PATCH v7 09/15] efi: use new page table APIs in copy_mapping
Date: Mon, 27 Jul 2020 21:33:54 +0200	[thread overview]
Message-ID: <176a8e78-9924-e5af-df2a-1e2eaae681c5@suse.com> (raw)
In-Reply-To: <0c421dee1729295eb8504ee81abbc8e57f220b12.camel@xen.org>

On 27.07.2020 14:45, Hongyan Xia wrote:
> On Tue, 2020-07-14 at 14:42 +0200, Jan Beulich wrote:
>> On 29.05.2020 13:11, Hongyan Xia wrote:
>>> @@ -1442,29 +1443,42 @@ static __init void copy_mapping(unsigned
>>> long mfn, unsigned long end,
>>>                                                    unsigned long
>>> emfn))
>>>   {
>>>       unsigned long next;
>>> +    l3_pgentry_t *l3src = NULL, *l3dst = NULL;
>>>   
>>>       for ( ; mfn < end; mfn = next )
>>>       {
>>>           l4_pgentry_t l4e = efi_l4_pgtable[l4_table_offset(mfn <<
>>> PAGE_SHIFT)];
>>> -        l3_pgentry_t *l3src, *l3dst;
>>>           unsigned long va = (unsigned long)mfn_to_virt(mfn);
>>>   
>>> +        if ( !((mfn << PAGE_SHIFT) & ((1UL << L4_PAGETABLE_SHIFT)
>>> - 1)) )
>>
>> To be in line with ...
>>
>>> +        {
>>> +            UNMAP_DOMAIN_PAGE(l3src);
>>> +            UNMAP_DOMAIN_PAGE(l3dst);
>>> +        }
>>>           next = mfn + (1UL << (L3_PAGETABLE_SHIFT - PAGE_SHIFT));
>>
>> ... this, please avoid the left shift of mfn in the if(). Judgingfrom
> 
> What do you mean by "in line" here? It does not look to me that "next
> =" can be easily squashed into the if() condition.

I'm not thinking about squashing anything into an if(). I've talked
about avoiding the left shift of mfn, as this last quoted line does
(by instead subtracting PAGE_SHIFT from the left-shift count.

Jan

Jan


  parent reply	other threads:[~2020-07-27 19:34 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
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 [this message]
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=176a8e78-9924-e5af-df2a-1e2eaae681c5@suse.com \
    --to=jbeulich@suse.com \
    --cc=hx242@xen.org \
    --cc=julien@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.