Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp335953rwi; Fri, 14 Oct 2022 02:45:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM523xqx8MX3oiwAdMfVRg8evqKNMVmdQ4VIciinAkMRHWcmAR9WRv6zImQaGwCc1koHjqTg X-Received: by 2002:a17:907:3f26:b0:78d:9c30:4529 with SMTP id hq38-20020a1709073f2600b0078d9c304529mr2867617ejc.195.1665740709997; Fri, 14 Oct 2022 02:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665740709; cv=none; d=google.com; s=arc-20160816; b=UQqjjNCj56FIvl4X/3l7yz76VP0R9WKJLKl8V5rlXgC0zd7b6tLjPs6WjZQoXnjf02 3SEJDNQGIqZGgYUbcMyllfU8WJuA0ULW5ACmqhrhPGVfx5fNwzkX0Rurf/tiM6yOl/ZK iNsZ9CItPYtGEmlC6/tOI4WyL75M4Dco54gZx50MOuDuH1wHxJG3Al0e84rXV3RVLrRJ CaAXAK/TbQ7OAKfY6bhhK8debRlokgFHqk+8ffNe2Mo3bCU2PzDmazNbh+w50BdR1uXE xWk1qIGFNQsDLq6EeN2jpivUZWOxhvCNjUVUey989uim9qIuLDTKtglQVRMFpgofXqck zLdg== 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:subject:cc:to:from:dkim-signature; bh=l71Vn2fzlhiK2TyuuWGdK5pw7Q1vwG2XPJsC+gMPyjo=; b=PQtgyDCQvIwB9+B6IN9aQjG1OpCokJedVxTs0NmApyhyBbliEbD9p7i3L7EX9Du7Nt Z+ntGfZpLkwATdHLlFLRzWj2pSt3/UmwwVnoN/vLZClxZpzjrU4czXL4LiMFlMv01+XI cACGt/AM0pbls6cH/5MHZPA34EuY4fsbsSEVpfYIPZpIzLyXsN3pRaZBudbOJ7u5IHRB J/u7xitj9D1h3puFQUawPWjyX2Wpw+MgjUGQ7dd8+AzCSa7+qQ8rrqv56eOYidqrkANx CBh5K76pZpZuJ4MjGlhW/0moDG7nWdH8GTL3xu+6mPegfh92XgVYVmsumme0V9KYEh3f 17iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=byluB3+R; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id by28-20020a0564021b1c00b00454424b5c2csi1643984edb.314.2022.10.14.02.44.43; Fri, 14 Oct 2022 02:45:09 -0700 (PDT) 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=@intel.com header.s=Intel header.b=byluB3+R; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230030AbiJNI7M (ORCPT + 99 others); Fri, 14 Oct 2022 04:59:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbiJNI7L (ORCPT ); Fri, 14 Oct 2022 04:59:11 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64C6C15626F; Fri, 14 Oct 2022 01:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665737949; x=1697273949; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xPNLdY9aqxLBPfxMLeiFDhGq4Ci6uGyirD+WbIXdUpE=; b=byluB3+Rezwe9cl+6bgMFKn6nkrEHhs8naUL2nHMAg9dy/WBrD/KWm9G 6EFZJncXOUH0+apQIKrbBwEI03iPMgYq9H0aDBl1ZHXwFyNKfwR6mzQLd JbWMt7083iwv765KA1P4dtSUtH7N1WhfrBbNHbfaC6PNNipklzgev1bA3 r3intpfaAGwOeE3kx/Wv+J4s96H4NpZzUyjznK4oZD9dWeFSWsGqhicb+ RqBgZyMNA5wtQY3/mOvjX+yHERZ26Xq/N0g2p3G4DYy3RLSTypgpksFVL ukITce+ihHEgQ8O3b4JDHCWTq5afEmA1FLDnIsrGRiwVhy9YII25guNSY A==; X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="391635344" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="391635344" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2022 01:59:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="696234480" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="696234480" Received: from power-sh.sh.intel.com ([10.239.183.122]) by fmsmga004.fm.intel.com with ESMTP; 14 Oct 2022 01:59:05 -0700 From: Zhang Rui To: linux-kernel@vger.kernel.org, x86@kernel.org, linux-hwmon@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, peterz@infradead.org, jdelvare@suse.com, linux@roeck-us.net, len.brown@intel.com, rui.zhang@intel.com Subject: [PATCH V4 0/4] x86/topology: Fix CPUID.1F handling Date: Fri, 14 Oct 2022 17:01:43 +0800 Message-Id: <20221014090147.1836-1-rui.zhang@intel.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 Handling for CPUID.1F is introduced by commit 7745f03eb395 ("x86/topology: Add CPUID.1F multi-die/package support"). And only SMT/Core/Die level types are supported at that time. On Intel AlderLake-N platforms where there are Ecores only, the Ecore Module topology is enumerated via CPUID.1F Module level. This exposes two bugs in the CPUID.1F handling code, 1. Linux interprets the Module ID bits as package ID and erroneously reports a multi module system as a multi-package system. 2. Linux excludes the unknown Module ID bits from the core ID, and results in duplicate core ID’s shown in a package after the first issue solved. Patch 3/4 and 4/4 fixes these two problems in CPUID.1F handling code, and patch 1/4 and 2/4 are needed to avoid potential regressions. thanks, -rui --- Changes in V4: - Drop a fix for a potential issue, as well as document cleanups/updates. So this patch series only contains bug fixes (stable candidates). - Integrate the patch subject/changelog improvements from Dave. - Add Fixes tags. Changes in V3: - changelog improvements based on Peter' feedback - Remove combined tags Changes in V2: - fix/improve changelog/comment wording issues - reorder the patches to eliminate bisection breakage window - add a new patch for coretemp driver variable renaming - update coretemp driver patch to fix a case of ida_free(&ida, -2)