summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2025-03-14 13:15:07 -0700
committerRichard Henderson <richard.henderson@linaro.org>2025-04-23 14:08:44 -0700
commit1751889b5a63f7b246525fad4cfd6902e674dcc4 (patch)
tree17d9132ac62e63aee0717420eaf531ef3de14488
parent161f5bc8e965fa8255db435683e6b52042037bb7 (diff)
downloadfocaccia-qemu-1751889b5a63f7b246525fad4cfd6902e674dcc4.tar.gz
focaccia-qemu-1751889b5a63f7b246525fad4cfd6902e674dcc4.zip
include/exec: Protect icount_enabled from poisoned symbols
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--include/exec/icount.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/exec/icount.h b/include/exec/icount.h
index 4964987ae4..7a26b40084 100644
--- a/include/exec/icount.h
+++ b/include/exec/icount.h
@@ -22,13 +22,21 @@ typedef enum {
     ICOUNT_ADAPTATIVE,
 } ICountMode;
 
-#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
+#ifdef CONFIG_TCG
 extern ICountMode use_icount;
 #define icount_enabled() (use_icount)
 #else
 #define icount_enabled() ICOUNT_DISABLED
 #endif
 
+/* Protect the CONFIG_USER_ONLY test vs poisoning. */
+#if defined(COMPILING_PER_TARGET) || defined(COMPILING_SYSTEM_VS_USER)
+# ifdef CONFIG_USER_ONLY
+#  undef  icount_enabled
+#  define icount_enabled() ICOUNT_DISABLED
+# endif
+#endif
+
 /*
  * Update the icount with the executed instructions. Called by
  * cpus-tcg vCPU thread so the main-loop can see time has moved forward.