diff mbox

[02/26] target/s390x: make IPTE SMP aware

Message ID 20170525210508.4910-3-aurelien@aurel32.net
State New
Headers show

Commit Message

Aurelien Jarno May 25, 2017, 9:04 p.m. UTC
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target/s390x/mem_helper.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Richard Henderson May 26, 2017, 1:53 p.m. UTC | #1
On 05/25/2017 02:04 PM, Aurelien Jarno wrote:
>       /* XXX we exploit the fact that Linux passes the exact virtual
>          address here - it's not obliged to! */
> -    tlb_flush_page(cs, page);
> +    tlb_flush_page_all_cpus_synced(cs, page);
>   
>       /* XXX 31-bit hack */
>       if (page & 0x80000000) {
> -        tlb_flush_page(cs, page & ~0x80000000);
> +        tlb_flush_page_all_cpus_synced(cs, page & ~0x80000000);
>       } else {
> -        tlb_flush_page(cs, page | 0x80000000);
> +        tlb_flush_page_all_cpus_synced(cs, page | 0x80000000);
>       }

Ideally we would, at the same time, implement the local-pte facility, which 
examines a bit in the M4 field to *not* do this.  That said,

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~
diff mbox

Patch

diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
index 4b96c279e3..88e2a0f60d 100644
--- a/target/s390x/mem_helper.c
+++ b/target/s390x/mem_helper.c
@@ -1109,8 +1109,6 @@  void HELPER(ipte)(CPUS390XState *env, uint64_t pte_addr, uint64_t vaddr)
     uint64_t page = vaddr & TARGET_PAGE_MASK;
     uint64_t pte = 0;
 
-    /* XXX broadcast to other CPUs */
-
     /* XXX Linux is nice enough to give us the exact pte address.
        According to spec we'd have to find it out ourselves */
     /* XXX Linux is fine with overwriting the pte, the spec requires
@@ -1119,13 +1117,13 @@  void HELPER(ipte)(CPUS390XState *env, uint64_t pte_addr, uint64_t vaddr)
 
     /* XXX we exploit the fact that Linux passes the exact virtual
        address here - it's not obliged to! */
-    tlb_flush_page(cs, page);
+    tlb_flush_page_all_cpus_synced(cs, page);
 
     /* XXX 31-bit hack */
     if (page & 0x80000000) {
-        tlb_flush_page(cs, page & ~0x80000000);
+        tlb_flush_page_all_cpus_synced(cs, page & ~0x80000000);
     } else {
-        tlb_flush_page(cs, page | 0x80000000);
+        tlb_flush_page_all_cpus_synced(cs, page | 0x80000000);
     }
 }