diff options
Diffstat (limited to 'arch/x86/xen/time.c')
| -rw-r--r-- | arch/x86/xen/time.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 72bf446c3fee..6e29794573b7 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
| @@ -361,8 +361,6 @@ void xen_timer_resume(void) | |||
| 361 | { | 361 | { |
| 362 | int cpu; | 362 | int cpu; |
| 363 | 363 | ||
| 364 | pvclock_resume(); | ||
| 365 | |||
| 366 | if (xen_clockevent != &xen_vcpuop_clockevent) | 364 | if (xen_clockevent != &xen_vcpuop_clockevent) |
| 367 | return; | 365 | return; |
| 368 | 366 | ||
| @@ -379,12 +377,15 @@ static const struct pv_time_ops xen_time_ops __initconst = { | |||
| 379 | }; | 377 | }; |
| 380 | 378 | ||
| 381 | static struct pvclock_vsyscall_time_info *xen_clock __read_mostly; | 379 | static struct pvclock_vsyscall_time_info *xen_clock __read_mostly; |
| 380 | static u64 xen_clock_value_saved; | ||
| 382 | 381 | ||
| 383 | void xen_save_time_memory_area(void) | 382 | void xen_save_time_memory_area(void) |
| 384 | { | 383 | { |
| 385 | struct vcpu_register_time_memory_area t; | 384 | struct vcpu_register_time_memory_area t; |
| 386 | int ret; | 385 | int ret; |
| 387 | 386 | ||
| 387 | xen_clock_value_saved = xen_clocksource_read() - xen_sched_clock_offset; | ||
| 388 | |||
| 388 | if (!xen_clock) | 389 | if (!xen_clock) |
| 389 | return; | 390 | return; |
| 390 | 391 | ||
| @@ -404,7 +405,7 @@ void xen_restore_time_memory_area(void) | |||
| 404 | int ret; | 405 | int ret; |
| 405 | 406 | ||
| 406 | if (!xen_clock) | 407 | if (!xen_clock) |
| 407 | return; | 408 | goto out; |
| 408 | 409 | ||
| 409 | t.addr.v = &xen_clock->pvti; | 410 | t.addr.v = &xen_clock->pvti; |
| 410 | 411 | ||
| @@ -421,6 +422,11 @@ void xen_restore_time_memory_area(void) | |||
| 421 | if (ret != 0) | 422 | if (ret != 0) |
| 422 | pr_notice("Cannot restore secondary vcpu_time_info (err %d)", | 423 | pr_notice("Cannot restore secondary vcpu_time_info (err %d)", |
| 423 | ret); | 424 | ret); |
| 425 | |||
| 426 | out: | ||
| 427 | /* Need pvclock_resume() before using xen_clocksource_read(). */ | ||
| 428 | pvclock_resume(); | ||
| 429 | xen_sched_clock_offset = xen_clocksource_read() - xen_clock_value_saved; | ||
| 424 | } | 430 | } |
| 425 | 431 | ||
| 426 | static void xen_setup_vsyscall_time_info(void) | 432 | static void xen_setup_vsyscall_time_info(void) |
