Re: [PATCH v12 09/11] x86/tsc: prepare for early sched_clock

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

 



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.

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

> 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.

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux