qemu-devel
[Top][All Lists]
Advanced

[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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]