[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 22/57] tcg: Build ffi data structures for helpers
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v5 22/57] tcg: Build ffi data structures for helpers |
Date: |
Tue, 16 Mar 2021 23:35:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 |
Hi Richard,
On 3/11/21 3:39 PM, Richard Henderson wrote:
> We will shortly use libffi for tci, as that is the only
> portable way of calling arbitrary functions.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> meson.build | 9 +-
> include/exec/helper-ffi.h | 115 +++++++++++++++++++++++++
> include/exec/helper-tcg.h | 24 ++++--
> target/hppa/helper.h | 2 +
> target/i386/ops_sse_header.h | 6 ++
> target/m68k/helper.h | 1 +
> target/ppc/helper.h | 3 +
> tcg/tcg.c | 20 +++++
> tests/docker/dockerfiles/fedora.docker | 1 +
> 9 files changed, 172 insertions(+), 9 deletions(-)
> create mode 100644 include/exec/helper-ffi.h
> diff --git a/include/exec/helper-tcg.h b/include/exec/helper-tcg.h
> index 27870509a2..a71b848576 100644
> --- a/include/exec/helper-tcg.h
> +++ b/include/exec/helper-tcg.h
> @@ -10,50 +10,57 @@
> to get all the macros expanded first. */
> #define str(s) #s
>
> +#ifdef CONFIG_TCG_INTERPRETER
> +# define DO_CIF(NAME) .cif = &cif_##NAME,
The comma in the macro bugs me... What about adding it as last field?
> +#else
> +# define DO_CIF(NAME)
> +#endif
> +
> #define DEF_HELPER_FLAGS_0(NAME, FLAGS, ret) \
> - { .func = HELPER(NAME), .name = str(NAME), \
> + { .func = HELPER(NAME), DO_CIF(NAME) .name = str(NAME), \
> .flags = FLAGS | dh_callflag(ret), \
> .sizemask = dh_sizemask(ret, 0) },
>
> #define DEF_HELPER_FLAGS_1(NAME, FLAGS, ret, t1) \
> - { .func = HELPER(NAME), .name = str(NAME), \
> + { .func = HELPER(NAME), DO_CIF(NAME) .name = str(NAME), \
> .flags = FLAGS | dh_callflag(ret), \
> .sizemask = dh_sizemask(ret, 0) | dh_sizemask(t1, 1) },
> diff --git a/tests/docker/dockerfiles/fedora.docker
> b/tests/docker/dockerfiles/fedora.docker
> index 915fdc1845..8140fe67b2 100644
> --- a/tests/docker/dockerfiles/fedora.docker
> +++ b/tests/docker/dockerfiles/fedora.docker
> @@ -32,6 +32,7 @@ ENV PACKAGES \
> libcurl-devel \
> libepoxy-devel \
> libfdt-devel \
> + libffi-devel \
> libiscsi-devel \
> libjpeg-devel \
> libpmem-devel \
>
What happened to the other Docker images?
Otherwise the rest LGTM.
- [PATCH v5 18/57] tcg/tci: Split out tci_args_{rrm,rrrm,rrrrm}, (continued)
- [PATCH v5 18/57] tcg/tci: Split out tci_args_{rrm,rrrm,rrrrm}, Richard Henderson, 2021/03/11
- [PATCH v5 19/57] tcg/tci: Hoist op_size checking into tci_args_*, Richard Henderson, 2021/03/11
- [PATCH v5 20/57] tcg/tci: Remove tci_disas, Richard Henderson, 2021/03/11
- [PATCH v5 24/57] tcg/tci: Improve tcg_target_call_clobber_regs, Richard Henderson, 2021/03/11
- [PATCH v5 16/57] tcg/tci: Clean up deposit operations, Richard Henderson, 2021/03/11
- [PATCH v5 22/57] tcg: Build ffi data structures for helpers, Richard Henderson, 2021/03/11
- Re: [PATCH v5 22/57] tcg: Build ffi data structures for helpers,
Philippe Mathieu-Daudé <=
- [PATCH v5 21/57] tcg/tci: Implement the disassembler properly, Richard Henderson, 2021/03/11
- [PATCH v5 25/57] tcg/tci: Move call-return regs to end of tcg_target_reg_alloc_order, Richard Henderson, 2021/03/11
- [PATCH v5 23/57] tcg/tci: Use ffi for calls, Richard Henderson, 2021/03/11
- [PATCH v5 28/57] tcg/tci: Split out tcg_out_op_l, Richard Henderson, 2021/03/11
- [PATCH v5 27/57] tcg/tci: Split out tcg_out_op_rrs, Richard Henderson, 2021/03/11
- [PATCH v5 26/57] tcg/tci: Push opcode emit into each case, Richard Henderson, 2021/03/11