grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>, Michael Chang <mchang@suse.com>
Cc: The development of GNU GRUB <grub-devel@gnu.org>,
	decui@microsoft.com, lersek@redhat.com
Subject: Re: [PATCH] calibrate_tsc(): use the Stall() EFI boot service on GRUB_MACHINE_EFI
Date: Tue, 1 Dec 2015 18:54:46 +0300	[thread overview]
Message-ID: <565DC2C6.5000806@gmail.com> (raw)
In-Reply-To: <871tb6k1nz.fsf@vitty.brq.redhat.com>

01.12.2015 11:34, Vitaly Kuznetsov пишет:
> Michael Chang <mchang@suse.com> 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 <arvidjaar@gmail.com> 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.


  reply	other threads:[~2015-12-01 15:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26  8:59 [PATCH] calibrate_tsc(): use the Stall() EFI boot service on GRUB_MACHINE_EFI Laszlo Ersek
2014-11-26 13:42 ` Andrei Borzenkov
2014-11-26 13:49   ` Laszlo Ersek
2014-11-28 19:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-12-03 18:59   ` Andrei Borzenkov
2015-11-27 17:55 ` Andrei Borzenkov
2015-11-28  5:25   ` Elliott, Robert (Persistent Memory)
2015-11-28  6:02     ` Andrei Borzenkov
2015-11-30 16:31   ` Vitaly Kuznetsov
2015-11-30 16:50     ` Andrei Borzenkov
2015-11-30 17:34       ` Andrei Borzenkov
2015-11-30 18:19         ` Vitaly Kuznetsov
2015-12-01  3:11         ` Michael Chang
2015-12-01  8:34           ` Vitaly Kuznetsov
2015-12-01 15:54             ` Andrei Borzenkov [this message]
2015-12-02 11:02               ` Vitaly Kuznetsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=565DC2C6.5000806@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=decui@microsoft.com \
    --cc=grub-devel@gnu.org \
    --cc=lersek@redhat.com \
    --cc=mchang@suse.com \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).