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

Re: [PATCH 1/2] x86/time: use relative counts in calibration loops


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 13 Jan 2022 11:44:08 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OJgE/lnFG4lbdOsHNhP4NZqM1TfQh5y+gwICQ3tkiUI=; b=BEOXkA7456rzfjTRHFOT70EAUKC5JEeyBU3+CxPMErA+N4N5YWW9q3h43Gg58JHZHG/RQZKD8VOAVIdS1vmw60hszdTtfTiZhOKxIkm40HKd4fNpRiUnCKR/c5if8JFaAR6/SldqK8tdJO9lFoq5vGApMlCLdce855hhPFMVNnaQi7ND8j4oxlluNZMRHOlpWs1ckUJ6oV0bysbXXMYCTOP1qhtMFIWe4Fx+W+U3FLvr5SbqkXaF9cKB/nUzb/CmknK/rDo2iO+qqkbLQ+Yt4XEctnnfUsoOZZLDTy3AHbTmYTe9OoqRK0T5LFxurGJLb1FXt1gWTI9kymU0KRvmXA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O6zhd1o4BkHpDJ/rk6qPpu6DLeS7ZrXezTGywai1KLLlDHTHxxgzsw9rf1FbC1LWKeG12FqkgaJYupHWTQjHWrZa4Yl7dRAsQyo9dLLv33CyLjero40rY77y6frTv//HAeraCNWbhsHrdv8UrqnB9M/H5k/WZ4LSvaRLM0Q+8498l17X35ScoiyeEtc3njAk5G977vwni1gaU/Ms96qs6Ga0KaTH6ooqVabALISxTXfrr3i963IueLqSWRDUBSFVQfX/9h8HvM08/+O7l9dxiChoSSoZ4lggtAjTBjTwH7MQCNDla+FngT4KOX8uQ1AbX2e/HesMCeaFL8rdbaWZ6w==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 13 Jan 2022 10:44:21 +0000
  • Ironport-data: A9a23:eYLkS6jle516uJsbgk05Kh/VX161hhcKZh0ujC45NGQN5FlHY01je htvUWnVP/zbM2ejL98lbYm2p0IGvp7Xm99lSwBsritmFSwb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oAMKRCQ7InQLlbGILes1htZGEk0GE/NtTo5w7Rj2tcx2oDga++wk YiaT/P3aQfNNwFcagr424rbwP+4lK2v0N+wlgVWicFj5DcypVFMZH4sDfjZw0/DaptVBoaHq 9Prl9lVyI97EyAFUbtJmp6jGqEDryW70QKm0hK6UID66vROS7BbPg/W+5PwZG8O4whlkeydx /1fpMK9ZzgWZZaVwugjciYFNjNEEpd/reqvzXiX6aR/zmXDenrohf5vEFs3LcsT/eMf7WNmr KJCbmpXN1ba2rzwkOnTpupE36zPKOHxO4wSoDd4xCzxBvc6W5HTBa7N4Le02R9u2pgVRqiCN 6L1bxJWTEjLOAweBW4aM7MdhL+XhWCldRBX/Qf9Sa0fvDGIkV0ZPKLWGMXRUsyHQ4NShEnwj nLL+SH1Dw8XMPSbyCGZ6TS8i+nXhyT5VYkOUrqi+ZZCglee22gSAx0+TkagrL+yjUvWZj5EA xVKoGx09/F0rRH1CImmN/GlnJKalgwNBdd+LNJh01jXxpT13Fu8FFIrdAcUPbTKq/QKbTAt0 1aImfbgCjpurKCZRBqh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r: eEjk8EvFIyNFesVo4+7ThAnQFTdWSxTMt110wEHW2hpUGQbJGyvAWT/JsI7KZu27H97d+tml+g +lYWkw7F+ZimtjcC6uyQWuHT/652r6anCv5EiPf73YjNXUNVEw3Z3tI2lyQ3ahKmjrk2aJS0gS djPjRxLlWLVxW3KtU/gLP7qw/xD8llZvNjbZZVpRpLnvyc3whAw8F0ubq1pyJh7T6+24ZwhejF INA7cq08KivmTBEreJ1NmKbkY8kS5UbQvI/Zn4I4WVjPjtohid4ppBcZGicYxMJxqa7eisCIxc u9xkOyLgHqg3Bq62xsFSe72R
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Jan 13, 2022 at 10:37:53AM +0100, Jan Beulich wrote:
> On 12.01.2022 09:55, Jan Beulich wrote:
> > @@ -504,11 +501,8 @@ static s64 __init init_pmtimer(struct pl
> >  
> >      count = inl(pmtmr_ioport) & mask;
> >      start = rdtsc_ordered();
> > -    target = count + CALIBRATE_VALUE(ACPI_PM_FREQUENCY);
> > -    if ( target < count )
> > -        while ( (inl(pmtmr_ioport) & mask) >= count )
> > -            continue;
> > -    while ( (inl(pmtmr_ioport) & mask) < target )
> > +    target = CALIBRATE_VALUE(ACPI_PM_FREQUENCY);
> > +    while ( (elapsed = (inl(pmtmr_ioport) & mask) - count) < target )
> 
> I think this is wrong, and instead needs to be
> 
>     while ( (elapsed = (inl(pmtmr_ioport) - count) & mask) < target )
> 
> There no similar issue with HPET as there we always have full 32 bits
> available.
> 
> Roger - you gave your R-b. If you agree, I'd like to retain that with
> the fix in place. But I'm not going to commit either variant ahead of
> hearing back from you.

Indeed, or else overflows past the mask boundary could make the loop
exit early.

Please keep the R-b.

Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.