Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: expose time-travel mode to userspace side

This will be necessary in the userspace side to fix the
signal/interrupt handling in time-travel=ext mode, which
is the next patch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

authored by

Johannes Berg and committed by
Richard Weinberger
33c7d061 fbb42e7f

+23 -11
+1 -11
arch/um/include/linux/time-internal.h
··· 8 8 #define __TIMER_INTERNAL_H__ 9 9 #include <linux/list.h> 10 10 #include <asm/bug.h> 11 + #include <shared/timetravel.h> 11 12 12 13 #define TIMER_MULTIPLIER 256 13 14 #define TIMER_MIN_DELTA 500 14 - 15 - enum time_travel_mode { 16 - TT_MODE_OFF, 17 - TT_MODE_BASIC, 18 - TT_MODE_INFCPU, 19 - TT_MODE_EXTERNAL, 20 - }; 21 15 22 16 #ifdef CONFIG_UML_TIME_TRAVEL_SUPPORT 23 17 struct time_travel_event { ··· 20 26 struct list_head list; 21 27 bool pending, onstack; 22 28 }; 23 - 24 - extern enum time_travel_mode time_travel_mode; 25 29 26 30 void time_travel_sleep(void); 27 31 ··· 53 61 #else 54 62 struct time_travel_event { 55 63 }; 56 - 57 - #define time_travel_mode TT_MODE_OFF 58 64 59 65 static inline void time_travel_sleep(void) 60 66 {
+22
arch/um/include/shared/timetravel.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright (C) 2019-2021 Intel Corporation 4 + */ 5 + #ifndef _UM_TIME_TRAVEL_H_ 6 + #define _UM_TIME_TRAVEL_H_ 7 + 8 + enum time_travel_mode { 9 + TT_MODE_OFF, 10 + TT_MODE_BASIC, 11 + TT_MODE_INFCPU, 12 + TT_MODE_EXTERNAL, 13 + }; 14 + 15 + #if defined(UML_CONFIG_UML_TIME_TRAVEL_SUPPORT) || \ 16 + defined(CONFIG_UML_TIME_TRAVEL_SUPPORT) 17 + extern enum time_travel_mode time_travel_mode; 18 + #else 19 + #define time_travel_mode TT_MODE_OFF 20 + #endif /* (UML_)CONFIG_UML_TIME_TRAVEL_SUPPORT */ 21 + 22 + #endif /* _UM_TIME_TRAVEL_H_ */