diff options
author | Benjamin Berg <benjamin.berg@intel.com> | 2023-10-18 14:36:43 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-07-03 12:18:02 +0200 |
commit | b2f9b77c7f7f377534ba75508162390432a9945a (patch) | |
tree | 79c2ee6c280d9fc31519a8a3cf4e166983f2a44e /arch/um/include | |
parent | 4cfb44df8d12a5fc2b801d18dc41b03bf7e6cd7b (diff) | |
download | linux-stable-b2f9b77c7f7f377534ba75508162390432a9945a.tar.gz linux-stable-b2f9b77c7f7f377534ba75508162390432a9945a.tar.bz2 linux-stable-b2f9b77c7f7f377534ba75508162390432a9945a.zip |
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>
Diffstat (limited to 'arch/um/include')
-rw-r--r-- | arch/um/include/shared/os.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index aff8906304ea..6516ff5a0ecc 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h @@ -163,6 +163,7 @@ extern int os_set_fd_block(int fd, int blocking); extern int os_accept_connection(int fd); extern int os_create_unix_socket(const char *file, int len, int close_on_exec); extern int os_shutdown_socket(int fd, int r, int w); +extern int os_dup_file(int fd); extern void os_close_file(int fd); extern int os_rcv_fd(int fd, int *helper_pid_out); extern int os_connect_socket(const char *name); |