qemu-devel
[Top][All Lists]
Advanced

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

[PATCH 01/14] target/i386: Simplify get_memio_eip()


From: Philippe Mathieu-Daudé
Subject: [PATCH 01/14] target/i386: Simplify get_memio_eip()
Date: Sat, 27 Apr 2024 17:57:01 +0200

The single call to get_memio_eip(), in cpu_report_tpr_access(),
is protected by a check on tcg_enabled(). Since the call only
exists when CONFIG_TCG is defined, we can slightly simplify.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/i386/helper.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/i386/helper.c b/target/i386/helper.c
index 23ccb23a5b..a3e70a630a 100644
--- a/target/i386/helper.c
+++ b/target/i386/helper.c
@@ -512,9 +512,9 @@ void cpu_x86_inject_mce(Monitor *mon, X86CPU *cpu, int bank,
     }
 }
 
+#ifdef CONFIG_TCG
 static inline target_ulong get_memio_eip(CPUX86State *env)
 {
-#ifdef CONFIG_TCG
     uint64_t data[TARGET_INSN_START_WORDS];
     CPUState *cs = env_cpu(env);
 
@@ -528,10 +528,8 @@ static inline target_ulong get_memio_eip(CPUX86State *env)
     } else {
         return data[0] - env->segs[R_CS].base;
     }
-#else
-    qemu_build_not_reached();
-#endif
 }
+#endif
 
 void cpu_report_tpr_access(CPUX86State *env, TPRAccess access)
 {
-- 
2.41.0




reply via email to

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