diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2007-07-26 23:42:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-28 22:54:33 -0400 |
commit | 6c8dca5d53f95009d4fff00195bf38f277dc4366 (patch) | |
tree | 60cc83cf949d6e598e6dc80dc668aebd42c65540 /include | |
parent | a8a11f06973fa63ad692a8f97694cb5eeb70b3f3 (diff) |
Provide timespec to guests rather than jiffies clock.
A non-periodic clock_event_device and the "jiffies" clock don't mix well:
tick_handle_periodic() can go into an infinite loop.
Currently lguest guests use the jiffies clock when the TSC is
unusable. Instead, make the Host write the current time into the lguest
page on every interrupt. This doesn't cost much but is more precise
and at least as accurate as the jiffies clock. It also gets rid of
the GET_WALLCLOCK hypercall.
Also, delay setting sched_clock until our clock is set up, otherwise
the early printk timestamps can go backwards (not harmful, just ugly).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/lguest.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/lguest.h b/include/linux/lguest.h index e76c151c7129..157ad64aa7ce 100644 --- a/include/linux/lguest.h +++ b/include/linux/lguest.h | |||
@@ -17,7 +17,6 @@ | |||
17 | #define LHCALL_TS 8 | 17 | #define LHCALL_TS 8 |
18 | #define LHCALL_SET_CLOCKEVENT 9 | 18 | #define LHCALL_SET_CLOCKEVENT 9 |
19 | #define LHCALL_HALT 10 | 19 | #define LHCALL_HALT 10 |
20 | #define LHCALL_GET_WALLCLOCK 11 | ||
21 | #define LHCALL_BIND_DMA 12 | 20 | #define LHCALL_BIND_DMA 12 |
22 | #define LHCALL_SEND_DMA 13 | 21 | #define LHCALL_SEND_DMA 13 |
23 | #define LHCALL_SET_PTE 14 | 22 | #define LHCALL_SET_PTE 14 |
@@ -88,6 +87,9 @@ struct lguest_data | |||
88 | * this address would normally be found. */ | 87 | * this address would normally be found. */ |
89 | unsigned long cr2; | 88 | unsigned long cr2; |
90 | 89 | ||
90 | /* Wallclock time set by the Host. */ | ||
91 | struct timespec time; | ||
92 | |||
91 | /* Async hypercall ring. Instead of directly making hypercalls, we can | 93 | /* Async hypercall ring. Instead of directly making hypercalls, we can |
92 | * place them in here for processing the next time the Host wants. | 94 | * place them in here for processing the next time the Host wants. |
93 | * This batching can be quite efficient. */ | 95 | * This batching can be quite efficient. */ |