From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1a3WRt-0006t2-6b for mharc-grub-devel@gnu.org; Mon, 30 Nov 2015 16:57:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3T2f-0005Vx-I6 for grub-devel@gnu.org; Mon, 30 Nov 2015 13:19:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3T2c-0005Pi-El for grub-devel@gnu.org; Mon, 30 Nov 2015 13:19:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3T2c-0005PY-9j for grub-devel@gnu.org; Mon, 30 Nov 2015 13:19:10 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id D191BC802; Mon, 30 Nov 2015 18:19:09 +0000 (UTC) Received: from vitty.brq.redhat.com.smtpmail-local-domain (vitty.brq.redhat.com [10.34.26.3]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAUIJ6hb014802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Nov 2015 13:19:08 -0500 From: Vitaly Kuznetsov To: Andrei Borzenkov Subject: Re: [PATCH] calibrate_tsc(): use the Stall() EFI boot service on GRUB_MACHINE_EFI References: <1416992361-4167-1-git-send-email-lersek@redhat.com> <56589925.20207@gmail.com> <87h9k3jvp7.fsf@vitty.brq.redhat.com> <565C7E3A.3090004@gmail.com> <565C889A.6030409@gmail.com> Date: Mon, 30 Nov 2015 19:19:06 +0100 In-Reply-To: <565C889A.6030409@gmail.com> (Andrei Borzenkov's message of "Mon, 30 Nov 2015 20:34:18 +0300") Message-ID: <87610jjqp1.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-Mailman-Approved-At: Mon, 30 Nov 2015 16:57:28 -0500 Cc: The development of GNU GRUB , mchang@suse.com, decui@microsoft.com, lersek@redhat.com X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2015 18:19:14 -0000 Andrei Borzenkov writes: > 30.11.2015 19:50, Andrei Borzenkov =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> 30.11.2015 19:31, Vitaly Kuznetsov =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>> Andrei Borzenkov writes: >>> >>>> 26.11.2014 11:59, Laszlo Ersek =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>>>> HyperV Gen2 virtual machines have no PIT; guest code should rely on= UEFI >>>>> services instead. >>>>> >>>> >>>> Could you retest with current master? It now supports multiple metho= ds >>>> to calibrate TSC and should avoid PIT on UEFI systems. >>> >>> Unfortunately, current master (grub-2.02-beta2-561-g346a494) still >>> doesn't work for me, timer keeps running like crazy on Gen2 Hyper-V V= Ms. >>> >>=20 >> @Michael: I remember you tested version of Vladimir patch on Hyper-V? >> Could you test current master? >>=20 > > if ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH)) { > ret =3D 1; > /* Wait. */ > while ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) > =3D=3D 0x00); > } > > If PIT is not present all reads should return 0xff I've instrumented pit_calibrate_tsc() in Linux and can confirm inb(0x61) returns 0xff on Hyper-V Gen2 VMs. > so this will always > succeed, right? Linux kernel is using some sanity checks, if loop > terminated too early it assumes calibration failure. --=20 Vitaly