On 2/17/21 9:19 PM, Richard Henderson wrote:
> Use the provided cpu_ldst.h interfaces. This fixes the build vs
> the unconverted uses of g2h(), adds missed memory trace events,
> and correctly recognizes when a SIGSEGV belongs to the guest via
> set_helper_retaddr().
>
> Fixes: 3e8f1628e864
> Signed-off-by: Richard Henderson <[email protected]>
> ---
> tcg/tci.c | 73 +++++++++++++++++++++----------------------------------
> 1 file changed, 28 insertions(+), 45 deletions(-)
Hit that today:
../tcg/tci.c: In function ‘tcg_qemu_tb_exec’:
../tcg/tci.c:379:37: error: passing argument 1 of ‘g2h’ makes pointer
from integer without a cast [-Werror=int-conversion]
379 | # define qemu_ld_ub ldub_p(g2h(taddr))
| ^~~~~
| |
| target_ulong {aka unsigned int}
../tcg/tci.c:1034:25: note: in expansion of macro ‘qemu_ld_ub’
1034 | tmp32 = qemu_ld_ub;
| ^~~~~~~~~~
In file included from ../tcg/tci.c:32:
include/exec/cpu_ldst.h:85:35: note: expected ‘CPUState *’ but argument
is of type ‘target_ulong’ {aka ‘unsigned int’}
85 | static inline void *g2h(CPUState *cs, abi_ptr x)
| ~~~~~~~~~~^~
../tcg/tci.c:379:33: error: too few arguments to function ‘g2h’
379 | # define qemu_ld_ub ldub_p(g2h(taddr))
| ^~~
../tcg/tci.c:1034:25: note: in expansion of macro ‘qemu_ld_ub’
1034 | tmp32 = qemu_ld_ub;
| ^~~~~~~~~~
So:
Tested-by: Philippe Mathieu-Daudé <[email protected]>