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] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1806281421550.1778@nanos.tec.linutronix.de>
Date:   Thu, 28 Jun 2018 14:27:17 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Peter Zijlstra <peterz@...radead.org>
cc:     Pavel Tatashin <pasha.tatashin@...cle.com>,
        Steven Sistare <steven.sistare@...cle.com>,
        Daniel Jordan <daniel.m.jordan@...cle.com>,
        linux@...linux.org.uk, Martin Schwidefsky <schwidefsky@...ibm.com>,
        Heiko Carstens <heiko.carstens@...ibm.com>,
        John Stultz <john.stultz@...aro.org>, sboyd@...eaurora.org,
        x86@...nel.org, LKML <linux-kernel@...r.kernel.org>,
        mingo@...hat.com, "H. Peter Anvin" <hpa@...or.com>,
        douly.fnst@...fujitsu.com, Prarit Bhargava <prarit@...hat.com>,
        feng.tang@...el.com, Petr Mladek <pmladek@...e.com>,
        gnomes@...rguk.ukuu.org.uk, linux-s390@...r.kernel.org,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>
Subject: Re: [PATCH v12 09/11] x86/tsc: prepare for early sched_clock

On Thu, 28 Jun 2018, Peter Zijlstra wrote:
> On Thu, Jun 28, 2018 at 12:43:59PM +0200, Thomas Gleixner wrote:
> > 	init_hypervisor_platform()
> > 	   vmware:
> > 	           Retrieves frequency and store it for the
> > 		   calibration function
> > 
> > 		   khz = vmware_get_khz_magic()
> > 		   vmware_tsc_khz = khz
> > 		   calibrate_cpu = vmware_get_tsc_khz
> > 	   	   calibrate_tsc = vmware_get_tsc_khz
> > 		   preset_lpj(khz)
> > 
> >  	   hyperv:
> > 		   if special hyperv MSRs are available:
> > 
> > 		      calibrate_cpu = hv_get_tsc_khz
> > 		      calibrate_tsc = hv_get_tsc_khz
> > 
> > 		   MSR is readable already in this function
> > 
> > 	   jailhouse:
> > 	   
> > 		   Frequency is available in this function and store
> > 		   in a variable for the calibration function
> > 
> > 		   calibrate_cpu	= jailhouse_get_tsc
> > 		   calibrate_tsc	= jailhouse_get_tsc
> > 
> > 	...
> > 	
> > 	kvmclock_init()
> > 
> > 		if (magic_conditions)
> > 			calibrate_tsc = kvm_get_tsc_khz
> > 			calibrate_cpu = kvm_get_tsc_khz
> > 
> > 			kvm_get_preset_lpj()
> > 			   khz = kvm_get_tsc_khz()
> > 			   preset_lpj(khz);
> 
> Note that all these which get TSC values from a HV _should_ set
> X86_FEATURE_TSC_KNOWN_FREQ to avoid the late recalibrate.

True.

> Calibrating against a virtual PIT/HPET/PMTIMER is utterly pointless.

It kinda works :)
 
> > The generic initilizaiton does everything twice, which makes no sense,
> > except for the unlikely case were no fast functions are available and the
> > quick PIT calibration fails (PMTIMER/HPET) are not available in early
> > calibration. HPET 
> 
> Incomplete; but I suspect you want to talk about how we can make HPET
> available early by putting it in a fixmap.

As I figured out now that's only part of the picture. We also need to do
that past x86_dtb_init() because early_quirks() and the early acpi/sfi/dtb
stuff needs to be completed before it makes sense to access hpet. But at
that point we also have the PMTIMER info.

> And only if we fail, do we at a later stage try again using PMTIMER.
> 
> Currently it all works by accident, since !hpet and acpi_pm_read_early()
> returns 0, but really we should not be running the fallback crap at all
> that early.

Right.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ