[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen/arm: mm: optimize setup_pagetables



On Wed, May 11, 2016 at 11:03:06AM +0100, Julien Grall wrote:
>
>
>On 11/05/2016 10:57, Peng Fan wrote:
>>Hi Julien,
>
>Hi Peng,
>
>>On Wed, May 11, 2016 at 10:31:49AM +0100, Julien Grall wrote:
>>>
>>>[...]
>>>
>>>>diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
>>>>index 94ea054..bebd82f 100644
>>>>--- a/xen/arch/arm/mm.c
>>>>+++ b/xen/arch/arm/mm.c
>>>>@@ -443,12 +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);
>>>>-    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;
>>>>
>>>>@@ -498,6 +492,11 @@ void __init setup_pagetables(unsigned long 
>>>>boot_phys_offset, paddr_t xen_paddr)
>>>>      /* Map the destination in the boot misc area. */
>>>>      dest_va = BOOT_RELOC_VIRT_START;
>>>>      pte = mfn_to_xen_entry(xen_paddr >> PAGE_SHIFT, WRITEALLOC);
>>>>+    xen_second[second_table_offset(dest_va)] = pte;
>>>>+
>>>>+    /* Map the destination in the boot misc area. */
>>>>+    dest_va = BOOT_RELOC_VIRT_START;
>>>>+    pte = mfn_to_xen_entry(xen_paddr >> PAGE_SHIFT, WRITEALLOC);
>>>
>>>Why do you need to recompute "pte" and "dest_va"? They will be the same for
>>>"boot_second" and "xen_second".
>>
>>I just change "write_pte(xen_second + second_table_offset(dest_va), pte);" to
>>"xen_second[second_table_offset(dest_va)] = pte;".
>>
>>The pte and dest_va are not changed.
>
>So you could do some like:
>
>/* Comment */
>dest_va = BOOT...
>pte = ...
>/* Comment */
>xen_second[...] = pte
>/* Comment */
>write_pte(boot_second...);

This looks better. Will use this in V2.

Thanks,
Peng.

>
>Regards,
>
>-- 
>Julien Grall

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.