Re: [patch 15/38] ptp: ptp_vmclock: Replace get_cycles() usage
David Woodhouse <[email protected]>
| Newsgroups | gmane.linux.ports.riscv,gmane.linux.kernel,gmane.linux.network,gmane.linux.kernel.wireless.general,gmane.linux.kernel.cryptoapi,gmane.linux.kernel.mm,gmane.comp.file-systems.ext4,gmane.linux.hams,gmane.linux.ports.alpha,gmane.linux.ports.arm.kernel,gmane.linux.ports.parisc,gmane.linux.ports.ppc64.devel,gmane.linux.ports.sparc |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 2026-04-10 at 14:19 +0200, Thomas Gleixner wrote: > get_cycles() is not really well defined and similar to other usaage of the > underlying hardware CPU counters the PTP vmclock should use an explicit > interface as well. > > Implement ptp_vmclock_read_cpu_counter() in arm64 and x86 and simplify the > Kconfig selection while at it. > > No functional change. > > Signed-off-by: Thomas Gleixner <[email protected]> > Cc: David Woodhouse <[email protected]> Acked-by: David Woodhouse <[email protected]> Although I might follow up with a change to make this... > +static inline u64 ptp_vmclock_read_cpu_counter(void) > +{ > + return cpu_feature_enabled(X86_FEATURE_TSC) ? rdtsc() : 0; > +} > + ... depend on TSC_RELIABLE¹, since if the guest doesn't believe that it is, then the guest shouldn't be trying to use it as the basis for precise timing. ¹ (Or... one of the other zoo of TSC flags for the gradually reducing brokenness over the years...) _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
smime.p7s
(application/pkcs7-signature, 5 KB) - not displayed