diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-14 20:17:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-14 20:17:34 -0400 |
commit | f2772a0e4833d1af1901b6f1a38136fb71d1350c (patch) | |
tree | 28bf6f0944d745e19947273022224ebc6b2d07c8 /arch/um/include | |
parent | fcd98147ac71f35b69e2f50b5fddc5524dd2dfa8 (diff) | |
parent | b482e48d29f1461fd0d059a17f32bcfa274127b3 (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.h | 2 | ||||
-rw-r--r-- | arch/um/include/shared/os.h | 10 | ||||
-rw-r--r-- | arch/um/include/shared/timer-internal.h | 48 |
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 */ |
252 | extern void os_idle_sleep(unsigned long long nsecs); | 252 | extern void os_idle_sleep(unsigned long long nsecs); |
253 | extern int os_timer_create(void* timer); | 253 | extern int os_timer_create(void); |
254 | extern int os_timer_set_interval(void* timer, void* its); | 254 | extern int os_timer_set_interval(unsigned long long nsecs); |
255 | extern int os_timer_one_shot(int ticks); | 255 | extern int os_timer_one_shot(unsigned long long nsecs); |
256 | extern long long os_timer_disable(void); | 256 | extern void os_timer_disable(void); |
257 | extern long os_timer_remain(void* timer); | ||
258 | extern void uml_idle_timer(void); | 257 | extern void uml_idle_timer(void); |
259 | extern long long os_persistent_clock_emulation(void); | 258 | extern long long os_persistent_clock_emulation(void); |
260 | extern long long os_nsecs(void); | 259 | extern long long os_nsecs(void); |
261 | extern long long os_vnsecs(void); | ||
262 | 260 | ||
263 | /* skas/mem.c */ | 261 | /* skas/mem.c */ |
264 | extern long run_syscall_stub(struct mm_id * mm_idp, | 262 | extern 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 | ||
13 | enum time_travel_mode { | ||
14 | TT_MODE_OFF, | ||
15 | TT_MODE_BASIC, | ||
16 | TT_MODE_INFCPU, | ||
17 | }; | ||
18 | |||
19 | enum 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 | ||
26 | extern enum time_travel_mode time_travel_mode; | ||
27 | extern unsigned long long time_travel_time; | ||
28 | extern enum time_travel_timer_mode time_travel_timer_mode; | ||
29 | extern unsigned long long time_travel_timer_expiry; | ||
30 | extern unsigned long long time_travel_timer_interval; | ||
31 | |||
32 | static inline void time_travel_set_time(unsigned long long ns) | ||
33 | { | ||
34 | time_travel_time = ns; | ||
35 | } | ||
36 | |||
37 | static 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 | |||
49 | static inline void time_travel_set_time(unsigned long long ns) | ||
50 | { | ||
51 | } | ||
52 | |||
53 | static 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 |