From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tokarev Subject: Re: TSC in qem[-kvm] 1.1+ and in-kernel irqchip Date: Sun, 12 Aug 2012 13:24:01 +0400 Message-ID: <50277631.2080808@msgid.tls.msk.ru> References: <5024011F.2020200@msgid.tls.msk.ru> <20120810073346.GD24410@redhat.com> <5024D336.5090108@msgid.tls.msk.ru> <20120812081038.GJ3341@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , Gerd Hoffmann , qemu-devel , KVM list , Avi Kivity To: Gleb Natapov Return-path: In-Reply-To: <20120812081038.GJ3341@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org On 12.08.2012 12:10, Gleb Natapov wrote: [] > Any chance to bisect it? The bisecion leads to this commit: commit 17ee47418e65b1593defb30edbab33ccd47fc1f8 Merge: 13b0496 5d17c0d Author: Jan Kiszka Date: Tue Apr 10 16:26:23 2012 +0200 Merge commit '5d17c0d2df4998598e6002b27b8e47e792899a0f' into queues/qemu-merge Conflicts: hw/pc.c diff --cc Makefile.target index 33a7255,1bd25a8..32c8e42 --- a/Makefile.target +++ b/Makefile.target @@@ -245,13 -244,8 +245,13 @@@ obj-i386-y += pci-hotplug.o smbios.o wd obj-i386-y += debugcon.o multiboot.o obj-i386-y += pc_piix.o obj-i386-y += pc_sysfw.o - obj-i386-$(CONFIG_KVM) += kvm/clock.o kvm/apic.o kvm/i8259.o kvm/ioapic.o + obj-i386-$(CONFIG_KVM) += kvm/clock.o kvm/apic.o kvm/i8259.o kvm/ioapic.o kvm/i8254.o obj-i386-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o +obj-i386-y += testdev.o +obj-i386-y += acpi.o acpi_piix4.o + +obj-i386-y += i8254_common.o i8254.o +obj-i386-$(CONFIG_KVM_DEVICE_ASSIGNMENT) += device-assignment.o # shared objects obj-ppc-y = ppc.o ppc_booke.o diff --cc hw/pc.c index 74c19b9,bb9867b..feb6ef3 --- a/hw/pc.c +++ b/hw/pc.c @@@ -1116,8 -1118,12 +1122,12 @@@ void pc_basic_device_init(ISABus *isa_b qemu_register_boot_set(pc_boot_set, *rtc_state); - pit = pit_init(isa_bus, 0x40, pit_isa_irq, pit_alt_irq); + if (kvm_irqchip_in_kernel()) { + pit = kvm_pit_init(isa_bus, 0x40); + } else { + pit = pit_init(isa_bus, 0x40, pit_isa_irq, pit_alt_irq); + } - if (hpet) { + if (hpet && !(kvm_enabled() && kvm_irqchip_in_kernel())) { /* connect PIT to output control line of the HPET */ qdev_connect_gpio_out(hpet, 0, qdev_get_gpio_in(&pit->qdev, 0)); } Note this commit itself talks about pit and irqchip. But I don't know what does it mean. Cc'ing Jan for help. The short story: tsc timer calibration broke in 1.1+ with in-kernel irqchip (only) for several apps (seabios and grub are two examples), the time is ticking about 100 times faster. In grub the timer is calibrated using pit. The above commit is the result of bisection. Thanks, /mjt From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0UOz-00039B-PB for qemu-devel@nongnu.org; Sun, 12 Aug 2012 05:24:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0UOy-0005NS-HG for qemu-devel@nongnu.org; Sun, 12 Aug 2012 05:24:05 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:50016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0UOy-0005NG-9c for qemu-devel@nongnu.org; Sun, 12 Aug 2012 05:24:04 -0400 Message-ID: <50277631.2080808@msgid.tls.msk.ru> Date: Sun, 12 Aug 2012 13:24:01 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <5024011F.2020200@msgid.tls.msk.ru> <20120810073346.GD24410@redhat.com> <5024D336.5090108@msgid.tls.msk.ru> <20120812081038.GJ3341@redhat.com> In-Reply-To: <20120812081038.GJ3341@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] TSC in qem[-kvm] 1.1+ and in-kernel irqchip List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: Jan Kiszka , Gerd Hoffmann , qemu-devel , KVM list , Avi Kivity On 12.08.2012 12:10, Gleb Natapov wrote: [] > Any chance to bisect it? The bisecion leads to this commit: commit 17ee47418e65b1593defb30edbab33ccd47fc1f8 Merge: 13b0496 5d17c0d Author: Jan Kiszka Date: Tue Apr 10 16:26:23 2012 +0200 Merge commit '5d17c0d2df4998598e6002b27b8e47e792899a0f' into queues/qemu-merge Conflicts: hw/pc.c diff --cc Makefile.target index 33a7255,1bd25a8..32c8e42 --- a/Makefile.target +++ b/Makefile.target @@@ -245,13 -244,8 +245,13 @@@ obj-i386-y += pci-hotplug.o smbios.o wd obj-i386-y += debugcon.o multiboot.o obj-i386-y += pc_piix.o obj-i386-y += pc_sysfw.o - obj-i386-$(CONFIG_KVM) += kvm/clock.o kvm/apic.o kvm/i8259.o kvm/ioapic.o + obj-i386-$(CONFIG_KVM) += kvm/clock.o kvm/apic.o kvm/i8259.o kvm/ioapic.o kvm/i8254.o obj-i386-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o +obj-i386-y += testdev.o +obj-i386-y += acpi.o acpi_piix4.o + +obj-i386-y += i8254_common.o i8254.o +obj-i386-$(CONFIG_KVM_DEVICE_ASSIGNMENT) += device-assignment.o # shared objects obj-ppc-y = ppc.o ppc_booke.o diff --cc hw/pc.c index 74c19b9,bb9867b..feb6ef3 --- a/hw/pc.c +++ b/hw/pc.c @@@ -1116,8 -1118,12 +1122,12 @@@ void pc_basic_device_init(ISABus *isa_b qemu_register_boot_set(pc_boot_set, *rtc_state); - pit = pit_init(isa_bus, 0x40, pit_isa_irq, pit_alt_irq); + if (kvm_irqchip_in_kernel()) { + pit = kvm_pit_init(isa_bus, 0x40); + } else { + pit = pit_init(isa_bus, 0x40, pit_isa_irq, pit_alt_irq); + } - if (hpet) { + if (hpet && !(kvm_enabled() && kvm_irqchip_in_kernel())) { /* connect PIT to output control line of the HPET */ qdev_connect_gpio_out(hpet, 0, qdev_get_gpio_in(&pit->qdev, 0)); } Note this commit itself talks about pit and irqchip. But I don't know what does it mean. Cc'ing Jan for help. The short story: tsc timer calibration broke in 1.1+ with in-kernel irqchip (only) for several apps (seabios and grub are two examples), the time is ticking about 100 times faster. In grub the timer is calibrated using pit. The above commit is the result of bisection. Thanks, /mjt