qemu-e2k/include
Frederic Barrat f657721187 ppc/xive: Update the state of the External interrupt signal
When pulling or pushing an OS context from/to a CPU, we should
re-evaluate the state of the External interrupt signal. Otherwise, we
can end up catching the External interrupt exception in hypervisor
mode, which is unexpected.

The problem is best illustrated with the following scenario:

1. an External interrupt is raised while the guest is on the CPU.

2. before the guest can ack the External interrupt, an hypervisor
interrupt is raised, for example the Hypervisor Decrementer or
Hypervisor Virtualization interrupt. The hypervisor interrupt forces
the guest to exit while the External interrupt is still pending.

3. the hypervisor handles the hypervisor interrupt. At this point, the
External interrupt is still pending. So it's very likely to be
delivered while the hypervisor is running. That's unexpected and can
result in an infinite loop where the hypervisor catches the External
interrupt, looks for an interrupt in its hypervisor queue, doesn't
find any, exits the interrupt handler with the External interrupt
still raised, repeat...

The fix is simply to always lower the External interrupt signal when
pulling an OS context. It means it needs to be raised again when
re-pushing the OS context. Fortunately, it's already the case, as we
now always call xive_tctx_ipb_update(), which will raise the signal if
needed.

Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
Message-Id: <20220429071620.177142-3-fbarrat@linux.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-05-05 15:36:17 -03:00
..
authz Prefer 'on' | 'off' over 'yes' | 'no' for bool options 2021-01-29 17:07:53 +00:00
block block: Classify bdrv_get_flags() as I/O function 2022-05-04 15:55:23 +02:00
chardev Replace GCC_FMT_ATTR with G_GNUC_PRINTF 2022-03-22 14:40:51 +04:00
crypto crypto: move sm4_sbox from target/arm 2022-04-29 10:47:45 +10:00
disas disas: Remove old libopcode s390 disassembler 2022-05-04 08:47:19 +02:00
exec compiler.h: replace QEMU_NORETURN with G_NORETURN 2022-04-21 17:03:51 +04:00
fpu softfloat: add float128_to_int128 2022-04-20 18:00:30 -03:00
hw ppc/xive: Update the state of the External interrupt signal 2022-05-05 15:36:17 -03:00
io io: make qio_channel_command_new_pid() static 2022-05-03 15:47:59 +04:00
libdecnumber Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
migration migration: Remove load_state_old and minimum_version_id_old 2022-03-02 18:20:45 +00:00
monitor Move error_printf_unless_qmp() with monitor unit 2022-04-21 17:09:09 +04:00
net Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
qapi include: move qdict_{crumple,flatten} declarations 2022-04-21 17:03:51 +04:00
qemu Revert "main-loop: Disable GLOBAL_STATE_CODE() assertions" 2022-05-04 15:55:23 +02:00
qom compiler.h: replace QEMU_SENTINEL with G_GNUC_NULL_TERMINATED 2022-03-22 14:40:51 +04:00
scsi scsi: inline sg_io_sense_from_errno() into the callers. 2021-03-06 11:42:56 +01:00
semihosting semihosting: Move include/hw/semihosting/ -> include/semihosting/ 2021-03-10 15:34:12 +00:00
standard-headers headers: Add pvpanic.h 2022-03-06 05:08:23 -05:00
sysemu block: move fcntl_setfl() 2022-05-03 15:17:53 +04:00
tcg tcg: Implement tcg_gen_{h,w}swap_{i32,i64} 2022-05-04 08:47:19 +02:00
ui qapi/ui: add 'display-update' command for changing listen address 2022-04-27 07:51:01 +02:00
user common-user: Move safe-syscall.* from linux-user 2021-12-20 10:12:24 -08:00
elf.h elf: Add machine type value for LoongArch 2021-12-21 13:17:06 -08:00
glib-compat.h compiler.h: replace QEMU_NORETURN with G_NORETURN 2022-04-21 17:03:51 +04:00
qemu-io.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
qemu-main.h Simplify softmmu/main.c 2022-04-21 16:56:55 +04:00