Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp572495yba; Thu, 18 Apr 2019 06:13:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwB8jztfcqW+sQczEV8ENRgELb4Xd7ndxnd4VSP/gzLLBpD1G8vSr13fkrKtym/w6kDK45x X-Received: by 2002:a63:6941:: with SMTP id e62mr84515257pgc.99.1555593206261; Thu, 18 Apr 2019 06:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555593206; cv=none; d=google.com; s=arc-20160816; b=VzW1PXa5JlS3prF8Aj6QYLvOmsR29hHeuQlVWE9gFSYj5529wpJUJfUihWE8oiiypX sLgaVy1QxdgYs1c+iJJbFK96S41PVFOTxAAb5UoWVlJlSh72vh2ViIXKZPHFmXxGqcaX cB0CuE3Y9FpvucsY2uu9m2xAqKs3rWKAVMakmaLbuQO0f2QKLaHnBPfAFYm+vJEhnxHK yb1BNcsF2t6CrCY9mjQq1fce09XjbiNEVH32RX/5Ce8TYKWB7slPMsQ96Eg717EyjfUr eF7h/Z4LtE3JU9fLn7+YDSNEl8Yj3KZbGpDKV8qmxhot3lekI6E+TsCY5ZarY1dVGVxf BjtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=zfPmWpYxDJdNxqv8U1I85ybtYQ7qrVdq3lGviKziosE=; b=PuFo+/OG8J9yLua3J2k9+BiDPd70qJDzcbhJnrZbsdrV+AQepsvi4LLq8dRsbsy5um KWaPXE73UUZphKcEV3Z+QyxUgU4AyEA9zFQwsZrg548yzV/VV9TUXO3Uqq26g6/Fey2m fNrEQuM55DFhYHPdbTRtEpCDHSbjzDbB91geO7uyxH+CEZc7Yf3IrZQAiO8PMvPkBwe/ EgpvAvKTiiDYBEbS5P/gpqBMVWkUgCAapS9ULiCORODC4eoe2AJK1GrHT+OfsNe+cLfD byLxT1nkBm8XnqTpFC/rYeR74DDDUKeScUE0XEueUJTZps+/3b7D+4CVf+SOnZAdSH15 qfVQ== 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 z127si2453868pfb.254.2019.04.18.06.13.10; Thu, 18 Apr 2019 06:13:26 -0700 (PDT) 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 S2388996AbfDRNMQ (ORCPT + 99 others); Thu, 18 Apr 2019 09:12:16 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:36130 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733205AbfDRNMQ (ORCPT ); Thu, 18 Apr 2019 09:12:16 -0400 Received: from pd9ef12d2.dip0.t-ipconnect.de ([217.239.18.210] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hH6pp-0007z0-AW; Thu, 18 Apr 2019 15:12:13 +0200 Date: Thu, 18 Apr 2019 15:12:12 +0200 (CEST) From: Thomas Gleixner To: Daniel Drake cc: lenb@kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux@endlessm.com, rjw@rjwysocki.net Subject: Re: Detecting x86 LAPIC timer frequency from CPUID data In-Reply-To: <20190417052810.3052-1-drake@endlessm.com> Message-ID: References: <20190417052810.3052-1-drake@endlessm.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 On Wed, 17 Apr 2019, Daniel Drake wrote: > The CPUID.0x16 leaf provides "Bus (Reference) Frequency (in MHz)". > > In the thread "No 8254 PIT & no HPET on new Intel N3350 platforms > causes kernel panic during early boot" we are exploring ways to have > the kernel avoid using the PIT/HPET IRQ0 timer in more cases, and > Thomas Gleixner suggested that we could use this CPUID data to set > lapic_timer_frequency, avoiding the need for calibrate_APIC_clock() > to measure the APIC clock against the IRQ0 timer. > > I'm thinking of the the following code change, however I get > unexpected results on Intel i7-8565U (Whiskey Lake). When > booting without this change, and with apic=notscdeadline (so that > APIC clock gets calibrated and used), the bus speed is detected as > 23MHz: > > ... lapic delta = 149994 > ... PM-Timer delta = 357939 > ... PM-Timer result ok > ..... delta 149994 > ..... mult: 6442193 > ..... calibration result: 23999 > ..... CPU clock speed is 1991.0916 MHz. > ..... host bus clock speed is 23.0999 MHz. > > However the CPUID.0x16 ECX reports a 100MHz bus speed on this device, > so this code change would produce a significantly different calibration. > > Am I doing anything obviously wrong? It's probably just my fault sending you down the wrong path. What's the content of CPUUD.0x15 on that box? Thanks, tglx