From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1a45BY-0004pO-GD for mharc-grub-devel@gnu.org; Wed, 02 Dec 2015 06:02:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a45BV-0004md-Mh for grub-devel@gnu.org; Wed, 02 Dec 2015 06:02:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a45BQ-0005oO-OF for grub-devel@gnu.org; Wed, 02 Dec 2015 06:02:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a45BQ-0005ms-GL for grub-devel@gnu.org; Wed, 02 Dec 2015 06:02:48 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 6CFAE12BBF; Wed, 2 Dec 2015 11:02:47 +0000 (UTC) Received: from vitty.brq.redhat.com.smtpmail-local-domain (vitty.brq.redhat.com [10.34.26.3]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB2B2iUj003497 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 2 Dec 2015 06:02:45 -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> <20151201031129.GA28205@linux-dsax.tai.apac.novell.com> <871tb6k1nz.fsf@vitty.brq.redhat.com> <565DC2C6.5000806@gmail.com> Date: Wed, 02 Dec 2015 12:02:44 +0100 In-Reply-To: <565DC2C6.5000806@gmail.com> (Andrei Borzenkov's message of "Tue, 1 Dec 2015 18:54:46 +0300") Message-ID: <87oae9865n.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.22 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: The development of GNU GRUB , Michael Chang , 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: Wed, 02 Dec 2015 11:02:54 -0000 Andrei Borzenkov writes: > 01.12.2015 11:34, Vitaly Kuznetsov =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> Michael Chang writes: >>=20 >>> On Mon, Nov 30, 2015 at 08:34:18PM +0300, Andrei Borzenkov wrote: >>>> 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 me= thods >>>>>>> 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 VMs. >>>>>> >>>>> >>>>> @Michael: I remember you tested version of Vladimir patch on Hyper-= V? >>>>> Could you test current master? >>>>> >>> >>> I don't have access to Hyper-V either. My initial patch was tested on >>> Hyper-V from my colleage in Nuremburg. For Vladimir's patch I did tes= ts >>> on my EFI machine and mostly intersted in pmtimer to function properl= y, >>> as that's new introduced timer to the patch ..=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_LAT= CH) >>>> =3D=3D 0x00); >>>> } >>>> >>>> >>>> If PIT is not present all reads should return 0xff so this will alwa= ys >>>> succeed, right? Linux kernel is using some sanity checks, if loop >>>> terminated too early it assumes calibration failure. >>> >>> Well, yes the detection is bogus, I think the condition should check = for >>> return 0x00, which means the timer is counting and can continue to wa= it >>> for it to finish. >>> >>> if ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) =3D= =3D 0) { >>> ret =3D 1; >>> /* Wait. */ >>> while ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LAT= CH) >>> =3D=3D 0x00); >>> } >>> >>> Vitaly, could you please help to retest ? >>> >>=20 >> Sure, >>=20 >> just did and with this change timer seems to be working as expected. >>=20 > > Thank you! I pushed fix, if you could verify that master now works on > Hyper-V would be great. Just tested grub-2.02-beta2-562-ga03c103, works as well. Thanks! --=20 Vitaly