Skip to content

Commit

Permalink
KVM guest: Move a printk that's using the clock before it's ready
Browse files Browse the repository at this point in the history
Fix a hang during SMP kernel boot on KVM that showed up
after commit 489fb49
(2.6.35) and 59aab522154a2f17b25335b63c1cf68a51fb6ae0
(2.6.34.1). The problem only occurs when
CONFIG_PRINTK_TIME is set.

KVM-Stable-Tag.
Signed-off-by: Arjan Koers <0h61vkll2ly8@xutrox.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Arjan Koers authored and Avi Kivity committed Oct 24, 2010
1 parent c285545 commit 19b6a85
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/x86/kernel/kvmclock.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,15 @@ static struct clocksource kvm_clock = {
static int kvm_register_clock(char *txt)
{
int cpu = smp_processor_id();
int low, high;
int low, high, ret;

low = (int)__pa(&per_cpu(hv_clock, cpu)) | 1;
high = ((u64)__pa(&per_cpu(hv_clock, cpu)) >> 32);
ret = native_write_msr_safe(msr_kvm_system_time, low, high);
printk(KERN_INFO "kvm-clock: cpu %d, msr %x:%x, %s\n",
cpu, high, low, txt);

return native_write_msr_safe(msr_kvm_system_time, low, high);
return ret;
}

#ifdef CONFIG_X86_LOCAL_APIC
Expand Down

0 comments on commit 19b6a85

Please sign in to comment.