linux/arch/um/os-Linux
Johannes Berg d6b399a0e0 um: time-travel/signals: fix ndelay() in interrupt
We should be able to ndelay() from any context, even from an
interrupt context! However, this is broken (not functionally,
but locking-wise) in time-travel because we'll get into the
time-travel code and enable interrupts to handle messages on
other time-travel aware subsystems (only virtio for now).

Luckily, I've already reworked the time-travel aware signal
(interrupt) delivery for suspend/resume to have a time travel
handler, which runs directly in the context of the signal and
not from the Linux interrupt.

In order to fix this time-travel issue then, we need to do a
few things:

 1) rework the signal handling code to call time-travel handlers
    (only) if interrupts are disabled but signals aren't blocked,
    instead of marking it only pending there. This is needed to
    not deadlock other communication.
 2) rework time-travel to not enable interrupts while it's
    waiting for a message;
 3) rework time-travel to not (just) disable interrupts but
    rather block signals at a lower level while it needs them
    disabled for communicating with the controller.

Finally, since now we can actually spend even virtual time
in interrupts-disabled sections, the delay warning when we
deliver a time-travel delayed interrupt is no longer valid,
things can (and should) now get delayed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2021-06-17 21:44:52 +02:00
..
drivers um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
skas um: remove process stub VMA 2021-02-12 21:37:38 +01:00
elf_aux.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
execvp.c um: Use os_warn to print out pre-boot warning/error messages 2017-07-05 23:18:25 +02:00
file.c um: Use fdatasync() when mapping the UBD FSYNC command 2020-06-02 22:37:55 +02:00
helper.c Revert "um: allocate a guard page to helper threads" 2021-01-26 22:11:38 +01:00
irq.c um: Monitor error events in IRQ controller 2020-12-13 22:38:28 +01:00
main.c um: Don't trace irqflags during shutdown 2019-11-25 22:42:57 +01:00
Makefile um: Increase stack frame size threshold for signal.c 2020-12-13 22:22:00 +01:00
mem.c um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
process.c um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
registers.c um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
sigio.c um: irq/sigio: Support suspend/resume handling of workaround IRQs 2020-12-13 22:42:01 +01:00
signal.c um: time-travel/signals: fix ndelay() in interrupt 2021-06-17 21:44:52 +02:00
start_up.c um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
time.c um: fix os_idle_sleep() to not hang 2021-01-26 22:11:38 +01:00
tty.c um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
umid.c um: Remove use of asprinf in umid.c 2020-12-13 22:21:07 +01:00
user_syms.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
util.c um: Some fixes to build UML with musl 2020-10-11 23:13:06 +02:00