Let's allow to enable it for the qemu cpu model and correctly emulate it. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu_models.c | 1 + target/s390x/mem_helper.c | 13 ++++--------- 2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 478bcc6..8fce957 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -685,6 +685,7 @@ static void add_qemu_cpu_model_features(S390FeatBitmap fbm) S390_FEAT_GENERAL_INSTRUCTIONS_EXT, S390_FEAT_EXECUTE_EXT, S390_FEAT_STFLE_45, + S390_FEAT_LOCAL_TLB_CLEARING, }; int i; diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index 80caab9..1de0494 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -1558,18 +1558,13 @@ 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! */ - /* XXX: the LC bit should be considered as 0 if the local-TLB-clearing - facility is not installed. */ - if (m4 & 1) { + if (s390_has_feat(S390_FEAT_LOCAL_TLB_CLEARING) && (m4 & 1)) { tlb_flush_page(cs, page); - } else { - tlb_flush_page_all_cpus_synced(cs, page); - } - - /* XXX 31-bit hack */ - if (m4 & 1) { + /* 31 bit hack */ tlb_flush_page(cs, page ^ 0x80000000); } else { + tlb_flush_page_all_cpus_synced(cs, page); + /* 31 bit hack */ tlb_flush_page_all_cpus_synced(cs, page ^ 0x80000000); } } -- 2.9.4