lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <db8d4046-4056-43c1-b73d-f2502ae69198@paulmck-laptop>
Date:   Thu, 8 Jun 2023 09:58:12 -0700
From:   "Paul E. McKenney" <paulmck@...nel.org>
To:     Feng Tang <feng.tang@...el.com>
Cc:     Dave Hansen <dave.hansen@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H . Peter Anvin" <hpa@...or.com>,
        Peter Zijlstra <peterz@...radead.org>, rui.zhang@...el.com,
        x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC] x86/tsc: Make recalibration default on for
 TSC_KNOWN_FREQ cases

On Mon, Jun 05, 2023 at 09:04:45AM +0800, Feng Tang wrote:
> On Fri, Jun 02, 2023 at 12:08:10PM -0700, Paul E. McKenney wrote:
> > On Fri, Jun 02, 2023 at 11:36:54AM -0700, Dave Hansen wrote:
> > > On 6/2/23 11:29, Paul E. McKenney wrote:
> > > >>> One downside is, many VMs also has X86_FEATURE_TSC_KNOWN_FREQ set,
> > > >>> and they will also do this recalibration.
> > > >> It's also pointless for those SoCs which lack legacy hardware.
> > > >>
> > > >> So why do you force this on everyone?
> > > > Just for the record, this patch could be helpful in allowing victims
> > > > of TSC mis-synchronization to more easily provide a more complete bug
> > > > report to the firmware people.  There is of course no point if there is
> > > > already a fix available.
> > > > 
> > > > But it is not all that hard to work around not having this patch upstream.
> > > > This can be hand-applied as needed, NTP drift rates can be pressed
> > > > into service for those of us having atomic clocks near all our servers,
> > > > or the firmware guys can be tasked with figuring it out.
> > > > 
> > > > So this patch would be nice to have, but we could live without it.
> > > 
> > > Is this the kind of thing we could relegate to a kernel unit test?  Like
> > > make the recalibration logic _available_, but don't have it affect the
> > > rest of the system.
> > > 
> > > I love patching my kernel as much as the next guy.  But, you know what I
> > > *don't* love?  Explaining how to patch kernels to other people. ;)
> > 
> > One could argue that we already have the TSC equivalent of a kernel unit
> > test with the tsc=recalibrate kernel boot parameter.
> > 
> > So, would it make sense to have something like tsc=recalibrate (already
> > present) in the guise of something like hpet=recalibrate and/or
> > pmtmr=recalibrate in order to allow people to opt into recalibrating
> > whatever timer is marked unstable?
>  
> This kind of hint parsing should be in tsc.c, so some name like
> 'tsc_recal=hpet/pmtmr' ?  
> 
> As hpet and pmtimer are the only 2 choices and hpet is the default
> one, if people want to use pmtimer, they can use combined parameter 
> "tsc=recalibrate nohpet".

Or something like "tsc=recalibrateother"?

I am not all that worried about what the boot parameters look like,
as long as we have a way of telling the kernel to recalibrate whatever
clocksource just got marked unstable.  ;-)

> Also, thanks for sharing your thoughts form a victim's viewpoint
> in the other mail! :)

Glad it helped!  ;-)

							Thanx, Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ