From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [patch 2/3] QEMU/KVM: BIOS: revert TSC zeroing Date: Mon, 08 Dec 2008 23:12:49 -0200 Message-ID: <20081209012212.093152663@localhost.localdomain> References: <20081209011247.570596925@localhost.localdomain> Cc: kvm@vger.kernel.org, Benjamin Serebrin , Marcelo Tosatti To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:53543 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751054AbYLIBZy (ORCPT ); Mon, 8 Dec 2008 20:25:54 -0500 Content-Disposition: inline; filename=bios-tsc-fix Sender: kvm-owner@vger.kernel.org List-ID: The TSC is zeroed at RESET, and not at SMP initialization. This avoids the TSC from going out of sync between vcpu's on SMP guests. Signed-off-by: Marcelo Tosatti Index: kvm-userspace.tip/bios/rombios32.c =================================================================== --- kvm-userspace.tip.orig/bios/rombios32.c +++ kvm-userspace.tip/bios/rombios32.c @@ -610,12 +610,6 @@ void smp_probe(void) writel(APIC_BASE + APIC_ICR_LOW, 0x000C4500); sipi_vector = AP_BOOT_ADDR >> 12; writel(APIC_BASE + APIC_ICR_LOW, 0x000C4600 | sipi_vector); - asm volatile( - "xor %%eax, %%eax \n\t" - "xor %%edx, %%edx \n\t" - "mov $0x10, %%ecx \n\t" - "wrmsr" - : : : "eax", "ecx", "edx"); #ifndef BX_QEMU delay_ms(10); Index: kvm-userspace.tip/bios/rombios32start.S =================================================================== --- kvm-userspace.tip.orig/bios/rombios32start.S +++ kvm-userspace.tip/bios/rombios32start.S @@ -43,10 +43,6 @@ smp_ap_boot_code_start: cli xor %ax, %ax mov %ax, %ds - xor %eax, %eax - xor %edx, %edx - mov $0x10, %ecx - wrmsr mov $SMP_MSR_ADDR, %ebx 11: --