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: Andrei Borzenkov
Subject: Re: [PATCH] calibrate_tsc(): use the Stall() EFI boot service on GRUB_MACHINE_EFI
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

01.12.2015 11:34, Vitaly Kuznetsov пишет:
> Michael Chang <address@hidden> 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 <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?
>>>>
>>
>> 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 via email to

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