]> www.infradead.org Git - linux.git/commit
um: chan: use blocking IO for console output for time-travel
authorBenjamin Berg <benjamin.berg@intel.com>
Wed, 18 Oct 2023 12:36:43 +0000 (14:36 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 3 Jul 2024 10:18:02 +0000 (12:18 +0200)
commitb2f9b77c7f7f377534ba75508162390432a9945a
tree79c2ee6c280d9fc31519a8a3cf4e166983f2a44e
parent4cfb44df8d12a5fc2b801d18dc41b03bf7e6cd7b
um: chan: use blocking IO for console output for time-travel

When in time-travel mode (infinite-cpu or external) time should not pass
for writing to the console. As such, it makes sense to put the FD for
the output side into blocking mode and simply let any write to it hang.

If we did not do this, then time could pass waiting for the console to
become writable again. This is not desirable as it has random effects on
the clock between runs.

Implement this by duplicating the FD if output is active in a relevant
mode and setting the duplicate to be blocking. This avoids changing the
input channel to be blocking should it exists. After this, use the
blocking FD for all write operations and do not allocate an IRQ it is
set.

Without time-travel mode fd_out will always match fd_in and IRQs are
registered.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20231018123643.1255813-4-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/um/drivers/chan.h
arch/um/drivers/chan_kern.c
arch/um/include/shared/os.h
arch/um/os-Linux/file.c