aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-14 20:17:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-14 20:17:34 -0400
commitf2772a0e4833d1af1901b6f1a38136fb71d1350c (patch)
tree28bf6f0944d745e19947273022224ebc6b2d07c8 /arch/um/include
parentfcd98147ac71f35b69e2f50b5fddc5524dd2dfa8 (diff)
parentb482e48d29f1461fd0d059a17f32bcfa274127b3 (diff)
Merge tag 'for-linus-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
Pull UML updates from Richard Weinberger: - A new timer mode, time travel, for testing with UML - Many bugixes/improvements for the serial line driver - Various bugfixes * tag 'for-linus-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: um: fix build without CONFIG_UML_TIME_TRAVEL_SUPPORT um: Fix kcov crash during startup um: configs: Remove useless UEVENT_HELPER_PATH um: Support time travel mode um: Pass nsecs to os timer functions um: Remove drivers/ssl.h um: Don't garbage collect in deactivate_all_fds() um: Silence lockdep complaint about mmap_sem um: Remove locking in deactivate_all_fds() um: Timer code cleanup um: fix os_timer_one_shot() um: Fix IRQ controller regression on console read
Diffstat (limited to 'arch/um/include')
-rw-r--r--arch/um/include/asm/mmu_context.h2
-rw-r--r--arch/um/include/shared/os.h10
-rw-r--r--arch/um/include/shared/timer-internal.h48
3 files changed, 53 insertions, 7 deletions
diff --git a/arch/um/include/asm/mmu_context.h b/arch/um/include/asm/mmu_context.h
index 9f4b4bb78120..00cefd33afdd 100644
--- a/arch/um/include/asm/mmu_context.h
+++ b/arch/um/include/asm/mmu_context.h
@@ -52,7 +52,7 @@ static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
52 * when the new ->mm is used for the first time. 52 * when the new ->mm is used for the first time.
53 */ 53 */
54 __switch_mm(&new->context.id); 54 __switch_mm(&new->context.id);
55 down_write(&new->mmap_sem); 55 down_write_nested(&new->mmap_sem, 1);
56 uml_setup_stubs(new); 56 uml_setup_stubs(new);
57 up_write(&new->mmap_sem); 57 up_write(&new->mmap_sem);
58} 58}
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h
index ebf23012a59b..4a62ac4251a5 100644
--- a/arch/um/include/shared/os.h
+++ b/arch/um/include/shared/os.h
@@ -250,15 +250,13 @@ extern void os_warn(const char *fmt, ...)
250 250
251/* time.c */ 251/* time.c */
252extern void os_idle_sleep(unsigned long long nsecs); 252extern void os_idle_sleep(unsigned long long nsecs);
253extern int os_timer_create(void* timer); 253extern int os_timer_create(void);
254extern int os_timer_set_interval(void* timer, void* its); 254extern int os_timer_set_interval(unsigned long long nsecs);
255extern int os_timer_one_shot(int ticks); 255extern int os_timer_one_shot(unsigned long long nsecs);
256extern long long os_timer_disable(void); 256extern void os_timer_disable(void);
257extern long os_timer_remain(void* timer);
258extern void uml_idle_timer(void); 257extern void uml_idle_timer(void);
259extern long long os_persistent_clock_emulation(void); 258extern long long os_persistent_clock_emulation(void);
260extern long long os_nsecs(void); 259extern long long os_nsecs(void);
261extern long long os_vnsecs(void);
262 260
263/* skas/mem.c */ 261/* skas/mem.c */
264extern long run_syscall_stub(struct mm_id * mm_idp, 262extern long run_syscall_stub(struct mm_id * mm_idp,
diff --git a/arch/um/include/shared/timer-internal.h b/arch/um/include/shared/timer-internal.h
index 03e6f217f807..8574338bf23b 100644
--- a/arch/um/include/shared/timer-internal.h
+++ b/arch/um/include/shared/timer-internal.h
@@ -10,4 +10,52 @@
10#define TIMER_MULTIPLIER 256 10#define TIMER_MULTIPLIER 256
11#define TIMER_MIN_DELTA 500 11#define TIMER_MIN_DELTA 500
12 12
13enum time_travel_mode {
14 TT_MODE_OFF,
15 TT_MODE_BASIC,
16 TT_MODE_INFCPU,
17};
18
19enum time_travel_timer_mode {
20 TT_TMR_DISABLED,
21 TT_TMR_ONESHOT,
22 TT_TMR_PERIODIC,
23};
24
25#ifdef CONFIG_UML_TIME_TRAVEL_SUPPORT
26extern enum time_travel_mode time_travel_mode;
27extern unsigned long long time_travel_time;
28extern enum time_travel_timer_mode time_travel_timer_mode;
29extern unsigned long long time_travel_timer_expiry;
30extern unsigned long long time_travel_timer_interval;
31
32static inline void time_travel_set_time(unsigned long long ns)
33{
34 time_travel_time = ns;
35}
36
37static inline void time_travel_set_timer(enum time_travel_timer_mode mode,
38 unsigned long long expiry)
39{
40 time_travel_timer_mode = mode;
41 time_travel_timer_expiry = expiry;
42}
43#else
44#define time_travel_mode TT_MODE_OFF
45#define time_travel_time 0
46#define time_travel_timer_expiry 0
47#define time_travel_timer_interval 0
48
49static inline void time_travel_set_time(unsigned long long ns)
50{
51}
52
53static inline void time_travel_set_timer(enum time_travel_timer_mode mode,
54 unsigned long long expiry)
55{
56}
57
58#define time_travel_timer_mode TT_TMR_DISABLED
59#endif
60
13#endif 61#endif