[PATCH 05/24] accel/tcg: Assert most of cpu_handle_interrupt() is sysemu-specific

Philippe Mathieu-Daudé posted 24 patches 4 years, 5 months ago
Maintainers: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Aurelien Jarno <aurelien@aurel32.net>
There is a newer version of this series
[PATCH 05/24] accel/tcg: Assert most of cpu_handle_interrupt() is sysemu-specific
Posted by Philippe Mathieu-Daudé 4 years, 5 months ago
To prove TCGCPUOps::cpu_exec_interrupt() is limited to system
emulation, start by asserting it is not called under user emulation.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 accel/tcg/cpu-exec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 3e387c944c5..5f4836946c1 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -725,6 +725,9 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
             qemu_mutex_unlock_iothread();
             return true;
         }
+#if defined(CONFIG_USER_ONLY)
+        g_assert_not_reached();
+#endif
         if (replay_mode == REPLAY_MODE_PLAY && !replay_has_interrupt()) {
             /* Do nothing */
         } else if (interrupt_request & CPU_INTERRUPT_HALT) {
-- 
2.31.1

Re: [PATCH 05/24] accel/tcg: Assert most of cpu_handle_interrupt() is sysemu-specific
Posted by Richard Henderson 4 years, 5 months ago
On 9/2/21 5:16 PM, Philippe Mathieu-Daudé wrote:
> To prove TCGCPUOps::cpu_exec_interrupt() is limited to system
> emulation, start by asserting it is not called under user emulation.
> 
> Suggested-by: Richard Henderson<richard.henderson@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
>   accel/tcg/cpu-exec.c | 3 +++
>   1 file changed, 3 insertions(+)

Eh, sure, I guess.  I meant this merely as a diagnostic aid.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~