[PATCH 05/24] target/i386/helper: Include missing 'exec/translation-block.h' header

Philippe Mathieu-Daudé posted 24 patches 1 week, 2 days ago
[PATCH 05/24] target/i386/helper: Include missing 'exec/translation-block.h' header
Posted by Philippe Mathieu-Daudé 1 week, 2 days ago
TB compile flags are defined in "exec/translation-block.h".
Include it in order to avoid when refactoring:

  target/i386/helper.c:536:28: error: use of undeclared identifier 'CF_PCREL'
    536 |     if (tcg_cflags_has(cs, CF_PCREL)) {
        |                            ^

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

diff --git a/target/i386/helper.c b/target/i386/helper.c
index 01a268a30b..75c52e2143 100644
--- a/target/i386/helper.c
+++ b/target/i386/helper.c
@@ -21,6 +21,7 @@
 #include "qapi/qapi-events-run-state.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
+#include "exec/translation-block.h"
 #include "sysemu/runstate.h"
 #ifndef CONFIG_USER_ONLY
 #include "sysemu/hw_accel.h"
-- 
2.45.2


Re: [PATCH 05/24] target/i386/helper: Include missing 'exec/translation-block.h' header
Posted by Richard Henderson 1 week, 1 day ago
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote:
> TB compile flags are defined in "exec/translation-block.h".
> Include it in order to avoid when refactoring:
> 
>    target/i386/helper.c:536:28: error: use of undeclared identifier 'CF_PCREL'
>      536 |     if (tcg_cflags_has(cs, CF_PCREL)) {
>          |                            ^
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/i386/helper.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/target/i386/helper.c b/target/i386/helper.c
> index 01a268a30b..75c52e2143 100644
> --- a/target/i386/helper.c
> +++ b/target/i386/helper.c
> @@ -21,6 +21,7 @@
>   #include "qapi/qapi-events-run-state.h"
>   #include "cpu.h"
>   #include "exec/exec-all.h"
> +#include "exec/translation-block.h"
>   #include "sysemu/runstate.h"
>   #ifndef CONFIG_USER_ONLY
>   #include "sysemu/hw_accel.h"

Hmm.  The usage there in get_memio_eip really ought to be using tb_cflags(tb) with the 
translation block found during unwinding.  But none of the interfaces we provide from 
translate-all.c provide that.

Currently, tcg_cflags_has() is in exec/cpu-common.h.  Perhaps we ought to have the include 
there, so that all uses of tcg_cflags_has are fixed at once, or perhaps tcg_cflags_has 
should be moved.

Anyway, just musing.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~

Re: [PATCH 05/24] target/i386/helper: Include missing 'exec/translation-block.h' header
Posted by Pierrick Bouvier 1 week, 2 days ago

On 11/13/24 17:12, Philippe Mathieu-Daudé wrote:
> TB compile flags are defined in "exec/translation-block.h".
> Include it in order to avoid when refactoring:
> 
>    target/i386/helper.c:536:28: error: use of undeclared identifier 'CF_PCREL'
>      536 |     if (tcg_cflags_has(cs, CF_PCREL)) {
>          |                            ^
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/i386/helper.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/target/i386/helper.c b/target/i386/helper.c
> index 01a268a30b..75c52e2143 100644
> --- a/target/i386/helper.c
> +++ b/target/i386/helper.c
> @@ -21,6 +21,7 @@
>   #include "qapi/qapi-events-run-state.h"
>   #include "cpu.h"
>   #include "exec/exec-all.h"
> +#include "exec/translation-block.h"
>   #include "sysemu/runstate.h"
>   #ifndef CONFIG_USER_ONLY
>   #include "sysemu/hw_accel.h"

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>