On 13/3/25 04:45, Richard Henderson wrote:
This is include/system, so CONFIG_USER_ONLY will never be true.
Ideally yes. I started moving headers in include/system/ to clarify
APIs, but that doesn't mean some of these APIs aren't being
(incorrectly) used in user emulation.
Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
include/system/cpu-timers.h | 2 +-
include/system/qtest.h | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/system/cpu-timers.h b/include/system/cpu-timers.h
index 64ae54f6d6..f10cb5e7d4 100644
--- a/include/system/cpu-timers.h
+++ b/include/system/cpu-timers.h
@@ -30,7 +30,7 @@ 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
For example accel/tcg/tcg-all.c include this header in user and
gets icount_enabled() = 0.
So first we'd need preparatory changes in to form of:
-- >8 --
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index c1a30b01219..daa629e5b72 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -74,4 +74,7 @@ DECLARE_INSTANCE_CHECKER(TCGState, TCG_STATE,
static bool default_mttcg_enabled(void)
{
+#ifdef CONFIG_USER_ONLY
+ return false;
+#else
if (icount_enabled()) {
return false;
@@ -85,4 +88,5 @@ static bool default_mttcg_enabled(void)
return false;
#endif
+#endif
}
---