From: Richard Henderson Date: Fri, 14 Mar 2025 20:15:07 +0000 (-0700) Subject: include/exec: Protect icount_enabled from poisoned symbols X-Git-Tag: v10.1.0-rc0~117^2~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1751889b5a63f7b246525fad4cfd6902e674dcc4;p=thirdparty%2Fqemu.git include/exec: Protect icount_enabled from poisoned symbols Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- diff --git a/include/exec/icount.h b/include/exec/icount.h index 4964987ae49..7a26b40084d 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.