[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 16/43] tcg: Use Error with alloc_code_gen_buffer
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v5 16/43] tcg: Use Error with alloc_code_gen_buffer |
Date: |
Tue, 5 Jan 2021 19:55:51 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
On 1/5/21 6:19 PM, Richard Henderson wrote:
> Report better error messages than just "could not allocate".
> Let alloc_code_gen_buffer set ctx->code_gen_buffer_size
> and ctx->code_gen_buffer, and simply return bool.
>
> Reviewed-by: Joelle van Dyne <j@getutm.app>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> accel/tcg/translate-all.c | 60 ++++++++++++++++++++++-----------------
> 1 file changed, 34 insertions(+), 26 deletions(-)
...
> static bool tb_cmp(const void *ap, const void *bp)
> {
> const TranslationBlock *a = ap;
> @@ -1144,11 +1147,16 @@ static void tb_htable_init(void)
> size. */
> void tcg_exec_init(unsigned long tb_size)
> {
> + bool ok;
> +
> tcg_allowed = true;
> cpu_gen_init();
> page_init();
> tb_htable_init();
> - code_gen_alloc(tb_size);
> +
> + ok = alloc_code_gen_buffer(size_code_gen_buffer(tb_size), &error_fatal);
> + assert(ok);
Pointless assert() due to &error_fatal, but harmless.
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
- [PATCH v5 11/43] tcg: Adjust tcg_out_label for const, (continued)
- [PATCH v5 11/43] tcg: Adjust tcg_out_label for const, Richard Henderson, 2021/01/05
- [PATCH v5 14/43] tcg: Make DisasContextBase.tb const, Richard Henderson, 2021/01/05
- [PATCH v5 13/43] tcg: Adjust tb_target_set_jmp_target for split-wx, Richard Henderson, 2021/01/05
- [PATCH v5 21/43] tcg/i386: Support split-wx code generation, Richard Henderson, 2021/01/05
- [PATCH v5 12/43] tcg: Adjust tcg_register_jit for const, Richard Henderson, 2021/01/05
- [PATCH v5 15/43] tcg: Make tb arg to synchronize_from_tb const, Richard Henderson, 2021/01/05
- [PATCH v5 20/43] tcg: Return the TB pointer from the rx region from exit_tb, Richard Henderson, 2021/01/05
- [PATCH v5 08/43] tcg: Introduce tcg_splitwx_to_{rx,rw}, Richard Henderson, 2021/01/05
- [PATCH v5 10/43] tcg: Adjust tcg_out_call for const, Richard Henderson, 2021/01/05
- [PATCH v5 16/43] tcg: Use Error with alloc_code_gen_buffer, Richard Henderson, 2021/01/05
- Re: [PATCH v5 16/43] tcg: Use Error with alloc_code_gen_buffer,
Philippe Mathieu-Daudé <=
- [PATCH v5 17/43] tcg: Add --accel tcg,split-wx property, Richard Henderson, 2021/01/05
- [PATCH v5 19/43] accel/tcg: Support split-wx for darwin/iOS with vm_remap, Richard Henderson, 2021/01/05
- [PATCH v5 24/43] disas: Push const down through host disassembly, Richard Henderson, 2021/01/05
- [PATCH v5 23/43] tcg/aarch64: Support split-wx code generation, Richard Henderson, 2021/01/05
- [PATCH v5 25/43] tcg/tci: Push const down through bytecode reading, Richard Henderson, 2021/01/05
- [PATCH v5 28/43] tcg/ppc: Use tcg_out_mem_long to reset TCG_REG_TB, Richard Henderson, 2021/01/05
- [PATCH v5 18/43] accel/tcg: Support split-wx for linux with memfd, Richard Henderson, 2021/01/05
- [PATCH v5 22/43] tcg/aarch64: Use B not BL for tcg_out_goto_long, Richard Henderson, 2021/01/05