[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] cpu-exec: Exit exclusive region on longjmp f
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v2] cpu-exec: Exit exclusive region on longjmp from step_atomic |
Date: |
Thu, 2 Nov 2017 21:43:45 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 11/02/2017 05:35 PM, Peter Maydell wrote:
> Commit ac03ee5331612e44be narrowed the scope of the exclusive
> region so it only covers when we're executing the TB, not when
> we're generating it. However it missed that there is more than
> one execution path out of cpu_tb_exec -- if the atomic insn
> causes an exception then the code will longjmp out, skipping
> the code to end the exclusive region. This causes QEMU to hang
> the next time the CPU calls start_exclusive(), waiting for
> itself to exit the region.
>
> Move the "end the region" code out to the end of the
> function so that it is run for both normal exit and also
> for exit-via-longjmp. We have to use a volatile bool flag
> to decide whether we need to end the region, because we
> can longjump out of the codegen as well as the execution.
>
> (For some reason this only reproduces for me with a clang
> optimized build, not a gcc debug build.)
>
> Fixes: ac03ee5331612e44beb393df2b578c951d27dc0d
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> Changes v1->v2: use a flag so we get the "longjump out of the
> codegen" case right.
Reviewed-by: Richard Henderson <address@hidden>
I've got one other tcg patch queued for 2.11.
I could take this via tcg-next if you like.
r~