From: Benjamin Berg <benjamin@sipsolutions.net>
To: Benjamin Beichler <Benjamin.Beichler@uni-rostock.de>,
linux-um@lists.infradead.org
Subject: Re: [PATCH 1/4] um: irqs: process outstanding IRQs when unblocking signals
Date: Fri, 20 Oct 2023 11:59:51 +0200 [thread overview]
Message-ID: <11ab4d47dd8fdcdc2148e00618cc496866016883.camel@sipsolutions.net> (raw)
In-Reply-To: <6082036a-c7f9-4bd5-8234-14957ed9953d@uni-rostock.de>
On Fri, 2023-10-20 at 11:15 +0200, Benjamin Beichler wrote:
> Am 18.10.2023 um 14:36 schrieb benjamin@sipsolutions.net:
> > From: Benjamin Berg <benjamin.berg@intel.com>
> >
> > When in time-travel mode, the eventfd events are read even when signals
> > are blocked as SIGIO still needs to be processed. In this case, the
> > event is cleared on the eventfd but the IRQ still needs to be fired
> > later.
> >
> > We did already ensure that the SIGIO handler is run again. However, the
> > FDs are configured to be level triggered, so that eventfd will not
> > notify again. As such, add some logic to mark the IRQ as pending and
> > process it at the next opportunity.
> >
> > To avoid duplication, reuse the logic used for the suspend/resume case.
> > This does not really change anything except for delaying running the
> > IRQs with timetravel_handler at a slightly later point in time (and
> > possibly running non-timetravel IRQs that shouldn't happen earlier).
> > While at it, move marking as pending into irq_event_handler as that is
> > the more logical place for it to happen.
> >
> > Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
>
> I also noticed this problem, but after a discussion with Johannes Berg
> about this, we come to the conclusion, that all drivers with interrupts
> need to deal with time travel mode via their own time travel handler.
> What I actually did, was to write a trivial handler for e.g., the serial
> line, which simply only call time_travel_add_irq_event(ev).
Yes, we could instead just assert that we do not have any IRQ without a
timetravel handler. We really shouldn't have, but we do have one for
stdin unfortunately (which is at least used by the hostap hwsim tests,
so we might want to not remove it until we have a different solution).
What we could do is just add an stdin timetravel handler as you have
done, but print a warning when the stdin IRQ is registered[1]. And
then, if someone tries to register an IRQ without a time-travel handler
we just panic(), it should never happen.
Benjamin
[1] We'll also need to set stdin to be a "null" channel and then
somehow avoid registering the IRQ in that case.
> I'm not entirely sure, what the right way to do it, although the outcome
> seems to be the same, as with no time advance the actual simulation
> time, when the interrupt is handled is the same.
>
> I actually also have some other significant bug fixes on time travel in
> my tree, but I was too lazy to send them here, are you interested in
> taking a look at them?
> _______________________________________________
> linux-um mailing list
> linux-um@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-um
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
next prev parent reply other threads:[~2023-10-20 10:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 12:36 [PATCH 1/4] um: irqs: process outstanding IRQs when unblocking signals benjamin
2023-10-18 12:36 ` [PATCH 2/4] um: chan_user: catch EINTR when reading and writing benjamin
2023-10-18 12:36 ` [PATCH 3/4] um: chan_user: retry partial writes benjamin
2023-10-18 12:36 ` [PATCH 4/4] um: chan: use blocking IO for console output for time-travel benjamin
2023-10-20 9:15 ` [PATCH 1/4] um: irqs: process outstanding IRQs when unblocking signals Benjamin Beichler
2023-10-20 9:26 ` Anton Ivanov
2023-10-20 10:33 ` Benjamin Beichler
2023-10-20 9:59 ` Benjamin Berg [this message]
2023-10-20 10:38 ` Benjamin Beichler
2023-10-20 11:39 ` Johannes Berg
2023-10-20 12:06 ` Benjamin Beichler
2023-10-20 12:20 ` Johannes Berg
2023-10-20 12:23 ` Johannes Berg
2023-10-20 12:43 ` Benjamin Beichler
2023-10-20 12:58 ` Johannes Berg
2023-10-20 12:58 ` Benjamin Beichler
2023-10-20 13:39 ` Johannes Berg
2023-10-20 15:47 ` Benjamin Beichler
2023-10-20 15:51 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11ab4d47dd8fdcdc2148e00618cc496866016883.camel@sipsolutions.net \
--to=benjamin@sipsolutions.net \
--cc=Benjamin.Beichler@uni-rostock.de \
--cc=linux-um@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox