[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 2/3] target/s390x: Improve heuristic for ipte
From: |
David Hildenbrand |
Subject: |
[Qemu-devel] [PATCH v1 2/3] target/s390x: Improve heuristic for ipte |
Date: |
Tue, 20 Jun 2017 14:35:52 +0200 |
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 <address@hidden>
---
target/s390x/mem_helper.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
index 1de0494..bce7750 100644
--- a/target/s390x/mem_helper.c
+++ b/target/s390x/mem_helper.c
@@ -1559,13 +1559,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 (s390_has_feat(S390_FEAT_LOCAL_TLB_CLEARING) && (m4 & 1)) {
- tlb_flush_page(cs, page);
- /* 31 bit hack */
- tlb_flush_page(cs, page ^ 0x80000000);
+ if (vaddr & ~VADDR_PX) {
+ tlb_flush_page(cs, page);
+ /* 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);
- /* 31 bit hack */
- tlb_flush_page_all_cpus_synced(cs, page ^ 0x80000000);
+ if (vaddr & ~VADDR_PX) {
+ tlb_flush_page_all_cpus_synced(cs, page);
+ /* 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);
+ }
}
}
--
2.9.4