From 6c8dca5d53f95009d4fff00195bf38f277dc4366 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 27 Jul 2007 13:42:52 +1000 Subject: 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 Signed-off-by: Linus Torvalds --- include/linux/lguest.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/linux/lguest.h') 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 @@ #define LHCALL_TS 8 #define LHCALL_SET_CLOCKEVENT 9 #define LHCALL_HALT 10 -#define LHCALL_GET_WALLCLOCK 11 #define LHCALL_BIND_DMA 12 #define LHCALL_SEND_DMA 13 #define LHCALL_SET_PTE 14 @@ -88,6 +87,9 @@ struct lguest_data * this address would normally be found. */ unsigned long cr2; + /* Wallclock time set by the Host. */ + struct timespec time; + /* Async hypercall ring. Instead of directly making hypercalls, we can * place them in here for processing the next time the Host wants. * This batching can be quite efficient. */ -- cgit v1.2.3-59-g8ed1b