diff options
author | David Hildenbrand <david@redhat.com> | 2017-06-22 11:41:50 +0200 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2017-06-23 09:17:45 -0700 |
commit | 97b95aae3bc47eccb06c522a5945a8566b64cc86 (patch) | |
tree | d155852e5abbe553cd0908dc7eb3c8d5b60bcfd1 /target/s390x/mem_helper.c | |
parent | faf1c63d34861734895521277153c6c0e72b395c (diff) |
target/s390x: Improve heuristic for ipte
If only the page index is set, most likely we don't have a valid
virtual address. Let's do a full tlb flush for that case.
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20170622094151.28633-3-david@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target/s390x/mem_helper.c')
-rw-r--r-- | target/s390x/mem_helper.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index 182c46f6b5..20cef9a3e5 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -1630,16 +1630,23 @@ void HELPER(ipte)(CPUS390XState *env, uint64_t pto, uint64_t vaddr, /* XXX we exploit the fact that Linux passes the exact virtual address here - it's not obliged to! */ if (m4 & 1) { - tlb_flush_page(cs, page); - } else { - tlb_flush_page_all_cpus_synced(cs, page); - } - - /* XXX 31-bit hack */ - if (m4 & 1) { - tlb_flush_page(cs, page ^ 0x80000000); + if (vaddr & ~VADDR_PX) { + tlb_flush_page(cs, page); + /* XXX 31-bit hack */ + tlb_flush_page(cs, page ^ 0x80000000); + } else { + /* looks like we don't have a valid virtual address */ + tlb_flush(cs); + } } else { - tlb_flush_page_all_cpus_synced(cs, page ^ 0x80000000); + if (vaddr & ~VADDR_PX) { + tlb_flush_page_all_cpus_synced(cs, page); + /* XXX 31-bit hack */ + tlb_flush_page_all_cpus_synced(cs, page ^ 0x80000000); + } else { + /* looks like we don't have a valid virtual address */ + tlb_flush_all_cpus_synced(cs); + } } } |