xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 1/2] xen/arm: mm: remove unnecessary tlb flush in setup_pagetables
@ 2016-05-12 11:48 Peng Fan
  2016-05-12 11:48 ` [PATCH V3 2/2] xen/arm: mm: clean up code " Peng Fan
  0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan @ 2016-05-12 11:48 UTC (permalink / raw)
  To: xen-devel, julien.grall, sstabellini; +Cc: van.freenix

CPU0 is using the boot pages table before relocating xen and
xen_second is not part of them. So, no need to flush the TLB
when filling xen_second.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Julien Grall <julien.grall@arm.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
---
V3:
 Add Julien's review tag.

V2:
 Following Julien's comments:
   split the V1 patch into two patches. This patch only remove tlb flush.
   refine commit log

 xen/arch/arm/mm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 94ea054..addd699 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -447,7 +447,6 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     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);
-    flush_xen_data_tlb_range_va_local(dest_va, SECOND_SIZE);
 
     /* Calculate virt-to-phys offset for the new location */
     phys_offset = xen_paddr - (unsigned long) _start;
-- 
2.6.2


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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH V3 2/2] xen/arm: mm: clean up code in setup_pagetables
  2016-05-12 11:48 [PATCH V3 1/2] xen/arm: mm: remove unnecessary tlb flush in setup_pagetables Peng Fan
@ 2016-05-12 11:48 ` Peng Fan
  2016-05-16  9:22   ` Julien Grall
  0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan @ 2016-05-12 11:48 UTC (permalink / raw)
  To: xen-devel, julien.grall, sstabellini; +Cc: van.freenix

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 mapping BOOT_RELOC_VIRT_START
in xen_second, because CPU0 is using boot page tables.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Julien Grall <julien.grall@arm.com>
---

V3:
 Refine the commit log.

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
-- 
2.6.2


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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH V3 2/2] xen/arm: mm: clean up code in setup_pagetables
  2016-05-12 11:48 ` [PATCH V3 2/2] xen/arm: mm: clean up code " Peng Fan
@ 2016-05-16  9:22   ` Julien Grall
  2016-05-16 10:23     ` Stefano Stabellini
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Grall @ 2016-05-16  9:22 UTC (permalink / raw)
  To: Peng Fan, xen-devel, sstabellini

Hi Peng,

On 12/05/16 12:48, Peng Fan wrote:
> 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

s/on/one/ and missing full stop.

>
> Also no need to use write_pte when mapping BOOT_RELOC_VIRT_START
> in xen_second, because CPU0 is using boot page tables.
>
> Signed-off-by: Peng Fan <van.freenix@gmail.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Julien Grall <julien.grall@arm.com>

With the typos above fixed:

Reviewed-by: Julien Grall <julien.grall@arm.com>


Stefano, could you fix the typos before applying this series to your Xen 
4.8 branch?

Regards,

-- 
Julien Grall

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V3 2/2] xen/arm: mm: clean up code in setup_pagetables
  2016-05-16  9:22   ` Julien Grall
@ 2016-05-16 10:23     ` Stefano Stabellini
  0 siblings, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2016-05-16 10:23 UTC (permalink / raw)
  To: Julien Grall; +Cc: Peng Fan, sstabellini, xen-devel

On Mon, 16 May 2016, Julien Grall wrote:
> Hi Peng,
> 
> On 12/05/16 12:48, Peng Fan wrote:
> > 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
> 
> s/on/one/ and missing full stop.
> 
> > 
> > Also no need to use write_pte when mapping BOOT_RELOC_VIRT_START
> > in xen_second, because CPU0 is using boot page tables.
> > 
> > Signed-off-by: Peng Fan <van.freenix@gmail.com>
> > Cc: Stefano Stabellini <sstabellini@kernel.org>
> > Cc: Julien Grall <julien.grall@arm.com>
> 
> With the typos above fixed:
> 
> Reviewed-by: Julien Grall <julien.grall@arm.com>
> 
> Stefano, could you fix the typos before applying this series to your Xen 4.8
> branch?

Done

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-16 10:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-12 11:48 [PATCH V3 1/2] xen/arm: mm: remove unnecessary tlb flush in setup_pagetables Peng Fan
2016-05-12 11:48 ` [PATCH V3 2/2] xen/arm: mm: clean up code " Peng Fan
2016-05-16  9:22   ` Julien Grall
2016-05-16 10:23     ` Stefano Stabellini

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).