Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6164861rwb; Mon, 14 Nov 2022 15:34:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf7sxpqNdpjowS+wCqjlx/XRJx+16/fh/wz7xqN4bM5ji3/EGLoBb3BZuLb4vb7LyLoi3/16 X-Received: by 2002:a17:906:36c9:b0:79e:1059:6d65 with SMTP id b9-20020a17090636c900b0079e10596d65mr11082677ejc.695.1668468892853; Mon, 14 Nov 2022 15:34:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668468892; cv=none; d=google.com; s=arc-20160816; b=xfPYG0kSyCsW9bmS/d4/0pG0+pbwfHRoq5Ii8kFZaCgRQytTAFcamIyOqr6ldAGgxI CqDAGpCHZPErjchUbQC+bdtPqQ6k8csQQmLOerMu0NcI9lZzvrtQEO4041w1JN4g2yhy 6BHYEplyCL0dZgieHYe8bmO87pDf3hIyOeOrP/+k7k73STAcUgseoHOjDJi/fj3QcORH jXDxaZDbIHyCwQii29X5GraPNptaFJlEalwGNe9Aa6b3IA/pybopNeHF/tJhUKoZiQ4L 5Ja6vdBueP6sxqDOiA0VWVhoXQYGEqWeYDFhtklFZ4YcTu6lH7FNuqn6g/HoDyOU8kQf G5Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=bTCG1rDtKqy4ty/EtEDL8A4i7E+B7a65O4CepWGQnbs=; b=hhPRbZwFtP66mWUiCS6x52r1zrL/KybPs0tvk5frakQFD6E5l9bPqKPkzukYgFacfj W9BA4BQZVJrGowvrgvNBobV6L6ISwfpW1KVdU3XPugVUEx/Z3gODah7BYXJBc27R3u4W zef9ETkXF4tK5IXlvdel7ZAWjFOBQU0bUVRr1ECxjjoZzxbggh4lPnQ3O42Zt6Ue0i2y h4sc3vpwgcmjAopOVIbXt3op6cSaYr5DnzjhvnayX95EyAWDcizqD06wEzPynS/KhW7V 2Jq8QGe0TwmvRHVloKIyjmCe+AvEsYE3esQAZf//gadrvaG0LgMnsRUsmnZzAcTj8z/2 fFEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=v53eJxqN; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l8-20020a056402124800b004573107a5basi9421120edw.352.2022.11.14.15.34.31; Mon, 14 Nov 2022 15:34:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=v53eJxqN; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237159AbiKNW7A (ORCPT + 89 others); Mon, 14 Nov 2022 17:59:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231355AbiKNW67 (ORCPT ); Mon, 14 Nov 2022 17:58:59 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 847BBC6D for ; Mon, 14 Nov 2022 14:58:57 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668466735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bTCG1rDtKqy4ty/EtEDL8A4i7E+B7a65O4CepWGQnbs=; b=v53eJxqNiXGqKvpzUOoBVsteVAkiuvKAmVazj92d5eC7XojYHobOgg4xmhxQLRDhgkpXOf p/sYt/XI9PQGPjR/TqMSIyztyM52NTEpK4gq86qlh8b2e38IvjNY5i1ffkc//oSXR0pF1g MStioU6epUv/jXsgiY5mSxj6XQ7F1KE/GDYwCL/N3qHHE5Cjm53nhJNDt0X18iCJpIcN0r fa6GfzPUuxRQahvy2FfbDkopFv6+6LLpnwLDU4afeEerY9eHEoT7cELT3E55WA7AKHYGZJ bGGu98oq/W3QlfkgNIqhW0UM7FSXhii20SSeIeC9iq7EmLUrGQIZLDPdj+kgbg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668466735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bTCG1rDtKqy4ty/EtEDL8A4i7E+B7a65O4CepWGQnbs=; b=CvfiFiDmAK8NM7gnvQaNAymBR049omgLnwF+E1xLcu/fQllDBFuRS0WWbP1Nh/J4E4LlVn Zqcm4q007w9gHrAA== To: Dave Hansen , Peter Zijlstra , Rishabh Agrawal Cc: LKML , len.brown@intel.com, drake@endlessm.com, rafael.j.wysocki@intel.com, mingo@redhat.com, vaibhav.shankar@intel.com, biernacki@google.com, zwisler@google.com, mattedavis@google.com, Borislav Petkov , Dave Hansen , Feng Tang , Greg Kroah-Hartman , "H. Peter Anvin" , x86@kernel.org Subject: Re: [PATCH v2] Add hardcoded crystal clock for KabyLake In-Reply-To: <3d65c4cc-c002-9e6a-c6ea-fd776968a178@intel.com> References: <20221018190124.v2.1.I918ccc908c5c836c1e21e01d2cf6f59b0157bcc3@changeid> <3d65c4cc-c002-9e6a-c6ea-fd776968a178@intel.com> Date: Mon, 14 Nov 2022 23:58:54 +0100 Message-ID: <87y1sdqh1t.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 20 2022 at 10:18, Dave Hansen wrote: > On 10/20/22 10:13, Peter Zijlstra wrote: >> And why, pray *WHY* can't Intel simply write the correct information in >> CPUID leaf 15h. I mean, they defined the leaf, might as well use it, no? > > Is the data that's in the leaf just wrong? Doesn't that mean that the > CPUID leaf on these models is violating the architecture contract? That > sounds like something that deserves an erratum. > > Is there a documented erratum? I don't know. The code has this comment: /* * Some Intel SoCs like Skylake and Kabylake don't report the crystal * clock, but we can easily calculate it to a high degree of accuracy * by considering the crystal ratio and the CPU speed. */ so those SoCs fail to expose clock in leaf 15h and then the information in leaf 16h is so inaccurate that the calculation is off. Sigh. It's 2022 and we are still relying on crystalball mechanisms to figure out the damned crystal frequency. The specification of leaf 15h is: 15H Time Stamp Counter and Nominal Core Crystal Clock Information Leaf NOTES: If EBX[31:0] is 0, the TSC/=E2=80=9Dcore crystal clock=E2=80=9D rat= io is not enumerated. If ECX is 0, the nominal core crystal clock frequency is not enumer= ated. IOW, this CPUID leaf is defined to be useless and leaves it up to the SoC integration to provide this information or not. It needs even two fields to chose from to make it useless... I'm sure this took 10+ draft versions and consumed a non-quantifiable amount of work hours to come up with this joke. Thanks, tglx