Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8517389ybl; Thu, 16 Jan 2020 18:36:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzWvuHolp9VlkD+PgIPRhtQR6hrUxFoQNIISIrBCr5hEcEeQXbSarYhOvCYUAWoEqad8ReI X-Received: by 2002:aca:1c0d:: with SMTP id c13mr1773242oic.44.1579228564531; Thu, 16 Jan 2020 18:36:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579228564; cv=none; d=google.com; s=arc-20160816; b=MOnYOOueRTZHNYwlwJEkZQVnmRkSVyLN8cNGODoPa8RMzyWup34jGcSuhxlULWHhyD GNb5jvtis0BW5D498RmFbbw3B/L3FhMG//SDbKoHviv7yA0f3g71hpybTa1fEV8DNbF4 5zGkL5lwLw7XPDBdPY1o9FeABRqKKAiMq/s3xx+o9fPFcnUyWd1uKeWqdR8UcGJv1z9G OuS+0wZw0Xsf89OlxuZjbqsTIxRGx/S3kCz29j9IW49H3BavL4PudbOzS4e8UVSs1GGm vzRUQgv+EYUmxlY2LiHeieif8hsopaRCzsG/FNNb3Xy9vy3AQn36iwx0/pHXqr/qGBJp 9mkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=b4c6uisgsNPNOsrk/5uIsxPU90rOzGbfuy7AcbsQAyI=; b=v6HretzAquyjkxnb0FYxFUPSRZhP9j1t+0BjD68GdqA6qSZkh2GqqX6GNk+CAedDww ToBETXgCTRK1tBX0hdGYTYWijecV8XzvkxMHl4+BSaztw+Z2RxPrMbAN6o+xChzmgxnN uEeDZlvCVKj67lRhMceXPjmRuVGHla6h9iKhYY3OSFZQqA/9Hv1Dkf008pS4qwMpxyh4 7yWmSqzkyyMgqkg+fQPeKJD4USBmjoQjSb7XBP91fdByJaGdbasCO7gacApaH2bjW/yj FM2mdsbTzGGDnVFoXbHPuI7ArIksznwUlltK/csMn1MXNE1V9HzALwZsAmn7Iy43g1xd iilQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4si12810007oiy.97.2020.01.16.18.35.49; Thu, 16 Jan 2020 18:36:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388469AbgAPVIH (ORCPT + 99 others); Thu, 16 Jan 2020 16:08:07 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:53423 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729509AbgAPVIG (ORCPT ); Thu, 16 Jan 2020 16:08:06 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1isCMp-0001BF-Vb; Thu, 16 Jan 2020 22:07:52 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 0F3B5101226; Thu, 16 Jan 2020 22:07:51 +0100 (CET) From: Thomas Gleixner To: Andy Lutomirski Cc: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , nathanl@linux.ibm.com, Arnd Bergmann , Vincenzo Frascino , Andrew Lutomirski , LKML , linuxppc-dev , linux-arm-kernel , "open list\:MIPS" , X86 ML Subject: Re: [RFC PATCH v4 08/11] lib: vdso: allow fixed clock mode In-Reply-To: References: <1b278bc1f6859d4df734fb2cde61cf298e6e07fd.1579196675.git.christophe.leroy@c-s.fr> <874kwvf9by.fsf@nanos.tec.linutronix.de> Date: Thu, 16 Jan 2020 22:07:51 +0100 Message-ID: <871rrzf6u0.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Lutomirski writes: > On Thu, Jan 16, 2020 at 12:14 PM Thomas Gleixner wrote: >> Some architectures have a fixed clocksource which is known at compile >> time and cannot be replaced or disabled at runtime, e.g. timebase on >> PowerPC. For such cases the clock mode check in the VDSO code is >> pointless. >> > I wonder if we should use this on x86 bare-metal if we have > sufficiently invariant TSC. (Via static_cpu_has(), not compiled in.) > > Maybe there is no such x86 machine. There might be some, but every time I started to trust the TSC a bit more someone reported the next variant of brokenness. Admittedly it has become better at least up to two sockets. For a start we could do that when the TSC is considered reliable, which is the case when: - The TSC is the only available clocksource - tsc=reliable is on the kernel command line > I really really want Intel or AMD to introduce machines where the TSC > pinky-swears to count in actual nanoseconds. and is guaranteed to be synchronized across any number of sockets/cpus and has an enforcable protection against BIOS writers. Ideally it'd have a writeable MSR attached which allows us to tweak the frequency in the PPM range via NTP/PTP. Guess how long quite some people including Linus and myself are asking for this? I know that Linus started bitching about the TSC before me, but it's already a bit over 20 years on my side when I first talked to Intel and AMD about the requirements for a reliable clocksource. Just to set the time lines straight. Constant frequency TSC surfaced on Intel in 2006 with the Core brand and on AMD in 2007 with Barcelona (Fam 10h). In 2008 the first TSC surfaced which was not affected by C-States and 5 years later in 2013 some Atoms came out where TSC even worked accross S3. The > 2 socket issue is still not resolved AFAICT, but we got at least the TSC ADJUST MSR around 2012 which allowed us for the first time to reliably detect and mitigate BIOS wreckage. All the years I was envy on architectures which had simple designed and just reliably working timers forever. So now you can extrapolate how long it will take until you get your pinky-swearing pony :) Thanks, tglx