aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-03-27 11:47:20 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-03-27 11:47:20 +0100
commit8c832af369b2203df288f3a8da047b1a663b4de1 (patch)
treef81d5b3016e83e77918f5516b55cab061d7e2277 /xen/common
parenta4ae757f0ffc2fd6b44555a753a598edcb0f71fa (diff)
downloadxen-8c832af369b2203df288f3a8da047b1a663b4de1.tar.gz
xen-8c832af369b2203df288f3a8da047b1a663b4de1.tar.bz2
xen-8c832af369b2203df288f3a8da047b1a663b4de1.zip
Fix time reporting to guest.
The recent change to guest time handling dropped a call to update_vcpu_system_time(), leading to time-went-backwards messages and guest hangs (the latter were observed only in 2.6.21-rc4 and only when no serial console was in use). Debugging the issue also revealed that some commented out debug printk-s in x86's time handling code didn't compile under x86-64. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/common')
-rw-r--r--xen/common/domain.c4
-rw-r--r--xen/common/schedule.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 3008a4cc90..5e6cc3486c 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -96,14 +96,16 @@ struct vcpu *alloc_vcpu(
v->domain = d;
v->vcpu_id = vcpu_id;
- v->vcpu_info = shared_info_addr(d, vcpu_info[vcpu_id]);
spin_lock_init(&v->pause_lock);
v->runstate.state = is_idle_vcpu(v) ? RUNSTATE_running : RUNSTATE_offline;
v->runstate.state_entry_time = NOW();
if ( !is_idle_domain(d) )
+ {
set_bit(_VCPUF_down, &v->vcpu_flags);
+ v->vcpu_info = shared_info_addr(d, vcpu_info[vcpu_id]);
+ }
if ( sched_init_vcpu(v, cpu_id) != 0 )
{
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index c361261ae7..0dee0d19fe 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -659,11 +659,8 @@ static void schedule(void)
stop_timer(&prev->periodic_timer);
/* Ensure that the domain has an up-to-date time base. */
- if ( !is_idle_vcpu(next) )
- {
- update_vcpu_system_time(next);
- vcpu_periodic_timer_work(next);
- }
+ update_vcpu_system_time(next);
+ vcpu_periodic_timer_work(next);
TRACE_4D(TRC_SCHED_SWITCH,
prev->domain->domain_id, prev->vcpu_id,