From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1a3nGc-0000Nd-Sm for mharc-grub-devel@gnu.org; Tue, 01 Dec 2015 10:54:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3nGa-0000N0-4D for grub-devel@gnu.org; Tue, 01 Dec 2015 10:54:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3nGV-0007Ho-2t for grub-devel@gnu.org; Tue, 01 Dec 2015 10:54:56 -0500 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]:34178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3nGU-0007Hj-SM for grub-devel@gnu.org; Tue, 01 Dec 2015 10:54:51 -0500 Received: by lffu14 with SMTP id u14so14165611lff.1 for ; Tue, 01 Dec 2015 07:54:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=qNZfAyow19ppTgmK1wqsqvvMeHSyKavdkx1CPCrZ72o=; b=d52lklijGTLk1jiLG7QK4lEFo8a01Q6/nAtqrWhDyVQ2Xg+h7yFdzejmWm22w/HyrO NecEnLcUySQNw0qcQa6eTqd9csA30ho90Nchk/WthYUh37hUpZUESkLE8PPwkv2XfoAc jyRNxuGQ33a+FccFM7QO/PVPFYKLoBmbzmp/HrfwD2Adio8+RtQxhrQlEBP0hL1ftO2h icxCaUm4iX3iPHHsKMkHf3nkiUS5PKuKdmrKRFXVs5woBRgIkU24iwhkJ13zSVVqJYlY 2JPrh3TnHfMZMOIraNdHVJRwg6BmVdmiGpBDXXoeBe7PKI93loouI2DflllivzwCLwAW QLkg== X-Received: by 10.25.42.208 with SMTP id q199mr30542304lfq.67.1448985289502; Tue, 01 Dec 2015 07:54:49 -0800 (PST) Received: from [192.168.1.41] (ppp91-76-25-247.pppoe.mtu-net.ru. [91.76.25.247]) by smtp.gmail.com with ESMTPSA id zc2sm8091114lbb.40.2015.12.01.07.54.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Dec 2015 07:54:48 -0800 (PST) Subject: Re: [PATCH] calibrate_tsc(): use the Stall() EFI boot service on GRUB_MACHINE_EFI To: Vitaly Kuznetsov , Michael Chang 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> From: Andrei Borzenkov Message-ID: <565DC2C6.5000806@gmail.com> Date: Tue, 1 Dec 2015 18:54:46 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <871tb6k1nz.fsf@vitty.brq.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22a Cc: The development of GNU GRUB , 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: Tue, 01 Dec 2015 15:54:57 -0000 01.12.2015 11:34, Vitaly Kuznetsov пишет: > Michael Chang writes: > >> On Mon, Nov 30, 2015 at 08:34:18PM +0300, Andrei Borzenkov wrote: >>> 30.11.2015 19:50, Andrei Borzenkov пишет: >>>> 30.11.2015 19:31, Vitaly Kuznetsov пишет: >>>>> Andrei Borzenkov writes: >>>>> >>>>>> 26.11.2014 11:59, Laszlo Ersek пишет: >>>>>>> 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 methods >>>>>> 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 tests >> on my EFI machine and mostly intersted in pmtimer to function properly, >> as that's new introduced timer to the patch .. >> >>> >>> >>> if ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH)) { >>> ret = 1; >>> /* Wait. */ >>> while ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) >>> == 0x00); >>> } >>> >>> >>> If PIT is not present all reads should return 0xff so this will always >>> 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 wait >> for it to finish. >> >> if ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) == 0) { >> ret = 1; >> /* Wait. */ >> while ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) >> == 0x00); >> } >> >> Vitaly, could you please help to retest ? >> > > Sure, > > just did and with this change timer seems to be working as expected. > Thank you! I pushed fix, if you could verify that master now works on Hyper-V would be great.