All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Peng Fan <van.freenix@gmail.com>,
	xen-devel@lists.xen.org, sstabellini@kernel.org
Subject: Re: [PATCH V2 2/2] xen/arm: mm: clean up code in setup_pagetables
Date: Thu, 12 May 2016 11:59:02 +0100	[thread overview]
Message-ID: <573461F6.9060400@arm.com> (raw)
In-Reply-To: <1463018504-26432-2-git-send-email-van.freenix@gmail.com>

Hi Peng,

Hi Peng,

On 12/05/16 03:01, Peng Fan wrote:
> In setup_pagetables, need to map BOOT_RELOC_VIRT_START
> in xen_second and boot_second, so we can merge the two
> pieces code into one code block.

There is a missing subject for "need". I would say:

"The base of address for the relocated xen needs to be mapped at the 
same virtual address (BOOT_RELOC_VIRT_START) in both the boot and 
runtime page tables. So we can merge the two pieces of code into on code 
block."

>
> Also no need to use write_pte when map BOOT_RELOC_VIRT_START
> in xen_second, because CPU0 is using boot page tables now.
>
> Signed-off-by: Peng Fan <van.freenix@gmail.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Julien Grall <julien.grall@arm.com>
> ---
>
> V2:
>   Follow Julien's comments:
>     split the V1 patch into two patches, this patch is the code movement part.
>
>   xen/arch/arm/mm.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index addd699..0a4f845 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -443,11 +443,6 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
>       lpae_t pte, *p;
>       int i;
>
> -    /* Map the destination in the boot misc area. */
> -    dest_va = BOOT_RELOC_VIRT_START;
> -    pte = mfn_to_xen_entry(xen_paddr >> PAGE_SHIFT, WRITEALLOC);
> -    write_pte(xen_second + second_table_offset(dest_va), pte);
> -
>       /* Calculate virt-to-phys offset for the new location */
>       phys_offset = xen_paddr - (unsigned long) _start;
>
> @@ -494,9 +489,12 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
>       pte = boot_second[second_table_offset(BOOT_FDT_VIRT_START)];
>       xen_second[second_table_offset(BOOT_FDT_VIRT_START)] = pte;
>
> -    /* Map the destination in the boot misc area. */
> +    /* ... Boot Misc area for xen relocation */
>       dest_va = BOOT_RELOC_VIRT_START;
>       pte = mfn_to_xen_entry(xen_paddr >> PAGE_SHIFT, WRITEALLOC);
> +    /* Map the destination in xen_second. */
> +    xen_second[second_table_offset(dest_va)] = pte;
> +    /* Map the destination in boot_second. */
>       write_pte(boot_second + second_table_offset(dest_va), pte);
>       flush_xen_data_tlb_range_va_local(dest_va, SECOND_SIZE);
>   #ifdef CONFIG_ARM_64
>

Regards,

-- 
Julien Grall

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

  reply	other threads:[~2016-05-12 10:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-12  2:01 [PATCH V2 1/2] xen/arm: mm: remove unnecessary tlb flush in setup_pagetables Peng Fan
2016-05-12  2:01 ` [PATCH V2 2/2] xen/arm: mm: clean up code " Peng Fan
2016-05-12 10:59   ` Julien Grall [this message]
2016-05-12 10:50 ` [PATCH V2 1/2] xen/arm: mm: remove unnecessary tlb flush " Julien Grall

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=573461F6.9060400@arm.com \
    --to=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=van.freenix@gmail.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 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.