qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] translate-all: fix uninitialized tb->orig_tb


From: Richard Henderson
Subject: Re: [PATCH] translate-all: fix uninitialized tb->orig_tb
Date: Wed, 23 Oct 2019 10:50:54 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 10/22/19 10:00 AM, Clement Deschamps wrote:
> This fixes a segmentation fault in icount mode when executing from an IO 
> region.
> 
> TB is marked as CF_NOCACHE but tb->orig_tb is not initialized (equals
> previous value in code_gen_buffer).
> 
> The issue happens in cpu_io_recompile() when it tries to invalidate orig_tb.
> 
> Signed-off-by: Clement Deschamps <address@hidden>
> ---
>  accel/tcg/translate-all.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
> index 66d4bc4341..f9b7ba159d 100644
> --- a/accel/tcg/translate-all.c
> +++ b/accel/tcg/translate-all.c
> @@ -1722,6 +1722,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
>      tb->cs_base = cs_base;
>      tb->flags = flags;
>      tb->cflags = cflags;
> +    tb->orig_tb = NULL;

Reviewed-by: Richard Henderson <address@hidden>

Yep, the key is the the I/O region, when phys_pc == -1; previously the only
place that set CF_NOCACHE was cpu_exec_nocache, which is where orig_tb is
normally set.

Queued.


r~



reply via email to

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