Re: [PATCH 4/7] um: time-travel/signals: fix ndelay() in interrupt

From: Johannes Berg
Date: Thu Feb 25 2021 - 08:14:29 EST


On Tue, 2021-02-23 at 16:27 +0100, Johannes Berg wrote:
>
> +void unblock_signals_hard(void)
> +{
> + if (!signals_blocked)
> + return;
> +
> + if (signals_pending && signals_enabled) {
> + /* this is a bit inefficient, but that's not really important */
> + block_signals();
> + unblock_signals();
> + } else if (signals_pending & SIGIO_MASK) {
> + /* we need to run time-travel handlers even if not enabled */
> + sigio_run_timetravel_handlers();
> + }
> +
> + signals_blocked = 0;
> +}

This is, of course, racy & wrong - we could set signals_pending just
after checking it.

Need to make this

{
if (!signals_blocked)
return;
signals_blocked = 0;
barrier();

if (signals_pending && signals_enabled) {
...


Anyway, I need to repost this series, but I'll wait a bit longer for
further feedback before that, since I know Arnd and others wanted to
take a look at the IOMEM and PCI bits.

johannes