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

[Xen-changelog] [xen master] xen/arm: move the tlb_flush in create_p2m_entries to the end of the function



commit 11d8866da50a75ef5089faebdfa37164bdcb7545
Author:     Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
AuthorDate: Mon Apr 29 18:04:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Tue Apr 30 11:31:33 2013 +0100

    xen/arm: move the tlb_flush in create_p2m_entries to the end of the function
    
    Move the flush after the pagetable entry has actually been written to
    avoid races with other vcpus refreshing the same entriy.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 xen/arch/arm/p2m.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 1e8c8b4..9fc5534 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -133,7 +133,7 @@ static int create_p2m_entries(struct domain *d,
                      paddr_t maddr,
                      int mattr)
 {
-    int rc;
+    int rc, flush;
     struct p2m_domain *p2m = &d->arch.p2m;
     lpae_t *first = NULL, *second = NULL, *third = NULL;
     paddr_t addr;
@@ -186,10 +186,8 @@ static int create_p2m_entries(struct domain *d,
             third = 
map_domain_page(second[second_table_offset(addr)].p2m.base);
             cur_second_offset = second_table_offset(addr);
         }
-        /* else: third already valid */
 
-        if ( third[third_table_offset(addr)].p2m.valid )
-            flush_tlb_all_local();
+        flush = third[third_table_offset(addr)].p2m.valid;
 
         /* Allocate a new RAM page and attach */
         switch (op) {
@@ -226,6 +224,9 @@ static int create_p2m_entries(struct domain *d,
                 }
                 break;
         }
+
+        if ( flush )
+            flush_tlb_all_local();
     }
 
     rc = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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