]> git.ipfire.org Git - thirdparty/qemu.git/commit
accel/tcg: mttcg remove false-negative halted assertion
authorNicholas Piggin <npiggin@gmail.com>
Tue, 29 Aug 2023 01:06:58 +0000 (11:06 +1000)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 2 Oct 2023 23:00:54 +0000 (02:00 +0300)
commitb9b84b2d4190eef78fffdb1f1063e3e37ebbc91a
treeb904f473ca3b4fdf5801b0a5e7dd73ec8749bfc1
parent0215e8e872cd8db6f2c40111ed045b7829967a46
accel/tcg: mttcg remove false-negative halted assertion

mttcg asserts that an execution ending with EXCP_HALTED must have
cpu->halted. However between the event or instruction that sets
cpu->halted and requests exit and the assertion here, an
asynchronous event could clear cpu->halted.

This leads to crashes running AIX on ppc/pseries because it uses
H_CEDE/H_PROD hcalls, where H_CEDE sets self->halted = 1 and
H_PROD sets other cpu->halted = 0 and kicks it.

H_PROD could be turned into an interrupt to wake, but several other
places in ppc, sparc, and semihosting follow what looks like a similar
pattern setting halted = 0 directly. So remove this assertion.

Reported-by: Ivan Warren <ivan@vmfacility.fr>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20230829010658.8252-1-npiggin@gmail.com>
[rth: Keep the case label and adjust the comment.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
(cherry picked from commit 0e5903436de712844b0e6cdd862b499c767e09e9)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
accel/tcg/tcg-accel-ops-mttcg.c