Skip to contentSkip to conversation

xen/arm: create_xen_entries has to flush TLBs on every CPU

PATCH In review Julien Grall 2 participants 4 messages Apr 23, 2014 – May 2, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xen/arm: create_xen_entries has to flush TLBs on every CPU

The function create_xen_entries creates mappings in second-level page tables which is shared between every CPU.

Only flushing TLBs on local processor may result to wrong behaviour when io{re,un}map is used.

---

This patch is candidate to be backported to Xen 4.4.

create_p2m_entries is only used by vmap ( iore{,un}map functions.

Upstream Xen 4.4 calls these functions only when 1 CPU is online so it's "safe". But people who make product based on Xen 4.4 might want to use theses functions when all CPUs are UP.

Changes in v2:
- The patch change create_xen_entries not create_p2m_entries

---
 xen/arch/arm/mm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/mm.c +1 -1
index 362bc8d..eac228c 100644
@@ -845,7 +845,7 @@ static int create_xen_entries(enum xenmap_operation op,
                 BUG();
         }
     }
-    flush_xen_data_tlb_range_va_local(virt, PAGE_SIZE * nr_mfns);
+    flush_xen_data_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
 
     rc = 0;
 
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 7 lines · Julien Grall

The function create_xen_entries creates mappings in second-level page tables which is shared between every CPU.

Only flushing TLBs on local processor may result to wrong behaviour when io{re,un}map is used.

Acked + applied.

Quoted 3 lines

---

This patch is candidate to be backported to Xen 4.4.

Noted. I think you said this would need some backporting? Given that I'm inclined to hold off on backporting this until someone who is using 4.4 and tripping over the issue reports/requests it.

#2 lore raw
In reply to Julien Grall
Quoted 7 lines · Julien Grall

The function create_xen_entries creates mappings in second-level page tables which is shared between every CPU.

Only flushing TLBs on local processor may result to wrong behaviour when io{re,un}map is used.

Acked + applied.

Quoted 3 lines

---

This patch is candidate to be backported to Xen 4.4.

Noted. I think you said this would need some backporting? Given that I'm inclined to hold off on backporting this until someone who is using 4.4 and tripping over the issue reports/requests it.

Quoted 26 lines

create_p2m_entries is only used by vmap ( iore{,un}map functions.

Upstream Xen 4.4 calls these functions only when 1 CPU is online so it's "safe". But people who make product based on Xen 4.4 might want to use theses functions when all CPUs are UP.

Changes in v2:
- The patch change create_xen_entries not create_p2m_entries

---
 xen/arch/arm/mm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/mm.c +1 -1
index 362bc8d..eac228c 100644
@@ -845,7 +845,7 @@ static int create_xen_entries(enum xenmap_operation op,
                 BUG();
         }
     }
-    flush_xen_data_tlb_range_va_local(virt, PAGE_SIZE * nr_mfns);
+    flush_xen_data_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
 
     rc = 0;
 
#3 lore raw
Quoted 7 lines · Ian Campbell
Quoted 3 lines

---

This patch is candidate to be backported to Xen 4.4.

Noted. I think you said this would need some backporting? Given that I'm inclined to hold off on backporting this until someone who is using 4.4 and tripping over the issue reports/requests it.

I'm fine with this solution.

Regards,

Signature · 1 line
Julien Grall