qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 27/27] target/s390x: Enable TARGET_TB_PCREL


From: Thomas Huth
Subject: Re: [PATCH v4 27/27] target/s390x: Enable TARGET_TB_PCREL
Date: Tue, 21 Feb 2023 15:35:51 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 20/02/2023 19.40, Richard Henderson wrote:
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  target/s390x/cpu-param.h     |  4 ++
  target/s390x/cpu.c           | 12 +++++
  target/s390x/tcg/translate.c | 86 +++++++++++++++++++++++-------------
  3 files changed, 71 insertions(+), 31 deletions(-)

diff --git a/target/s390x/cpu-param.h b/target/s390x/cpu-param.h
index bf951a002e..52bb95de57 100644
--- a/target/s390x/cpu-param.h
+++ b/target/s390x/cpu-param.h
@@ -14,4 +14,8 @@
  #define TARGET_VIRT_ADDR_SPACE_BITS 64
  #define NB_MMU_MODES 4
+#ifndef CONFIG_USER_ONLY
+# define TARGET_TB_PCREL 1
+#endif
+
  #endif
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index b10a8541ff..933ff06395 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -37,6 +37,7 @@
  #ifndef CONFIG_USER_ONLY
  #include "sysemu/reset.h"
  #endif
+#include "exec/exec-all.h"
#define CR0_RESET 0xE0UL
  #define CR14_RESET      0xC2000000UL;
@@ -83,6 +84,16 @@ uint64_t s390_cpu_get_psw_mask(CPUS390XState *env)
      return r;
  }
+static void s390_cpu_synchronize_from_tb(CPUState *cs,
+                                         const TranslationBlock *tb)
+{
+    /* The program counter is always up to date with TARGET_TB_PCREL. */
+    if (!TARGET_TB_PCREL) {
+        S390CPU *cpu = S390_CPU(cs);
+        cpu->env.psw.addr = tb_pc(tb);
+    }
+}

FYI, this causes a build failure with --disable-tcg:

 https://gitlab.com/thuth/qemu/-/jobs/3806828645#L1885

I'll add this to fix it, no need to respin:

diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -84,6 +84,7 @@ uint64_t s390_cpu_get_psw_mask(CPUS390XState *env)
     return r;
 }
+#ifdef CONFIG_TCG
 static void s390_cpu_synchronize_from_tb(CPUState *cs,
                                          const TranslationBlock *tb)
 {
@@ -93,6 +94,7 @@ static void s390_cpu_synchronize_from_tb(CPUState *cs,
         cpu->env.psw.addr = tb_pc(tb);
     }
 }
+#endif
static void s390_cpu_set_pc(CPUState *cs, vaddr value)
 {

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]