grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] calibrate_tsc(): use the Stall() EFI boot service on GRUB_MA


From: Vitaly Kuznetsov
Subject: Re: [PATCH] calibrate_tsc(): use the Stall() EFI boot service on GRUB_MACHINE_EFI
Date: Mon, 30 Nov 2015 19:19:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Andrei Borzenkov <address@hidden> writes:

> 30.11.2015 19:50, Andrei Borzenkov пишет:
>> 30.11.2015 19:31, Vitaly Kuznetsov пишет:
>>> Andrei Borzenkov <address@hidden> 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?
>> 
>
>   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

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.

-- 
  Vitaly



reply via email to

[Prev in Thread] Current Thread [Next in Thread]