From patchwork Sun May 28 07:53:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 99886 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp824942vqr; Sun, 28 May 2023 01:40:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ550sGJ2UOKzzgHGfqBjHr4ineYokGgs6M46x/FIVCyzSwd9v/Ve7DsPryGmD6VAtK3BNga X-Received: by 2002:a05:6a00:2d19:b0:63f:2f00:c6d with SMTP id fa25-20020a056a002d1900b0063f2f000c6dmr9920289pfb.2.1685263221713; Sun, 28 May 2023 01:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685263221; cv=none; d=google.com; s=arc-20160816; b=t1DkqEWZ+AoiDLT6r3NAlPBU+vW6cdxfYEx6UGfpFWmxyXAYX/HRmxAJRMqplud+v7 9GcMSU0claY3HbfJ4X03qoU1RzlZI/BCKVQAG4QoP522L9Dx+NjgJ10rYJM234ele5NK GBvoMJIfFwHxlAEwsCuPpeqXKNAs9lH902NSxLHt8VGJTAoMhoNVQJnTXO8pXyY2goKU FC6nMAZe6W7jcRljMRAOjzI1mBkMr15AC9u4yv4pR5tP6AgRzHv7fMiEOs4Vmqp26C7K aea1bkmBSG4ET1MVlhxz1Jff8hkXrGmOErfVnzcIqTpFM0oipw+HKJJRA8ML0y2GqBNz KnAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:content-transfer-encoding :message-id:references:subject:cc:to:dkim-signature:dkim-signature :from; bh=0CiayCmuynXWyLDPAGrYgKcXEb7S6XZxZQEc7fj0LTk=; b=y8v69HXpB6d4GP205bd656GTEmqay9jSCGmxHgmRTCHCcUbXfS0QfjT7pdLvnqYw8T buuIcwgr1/cuo3Ci9W+e9Zk9vIEcyo6/++xkWCbSs44SI2aNcGatRoPVSv0XDJ4+Kq/F oW+lW4CJ50YOnetVl57SBh2wrBDymLaxcbReG0JBzRO+/KEEJDMT9QSGv1DThITN0EtO +iVB50YiWE5mrCfeId5KVaxMNQuAx5gup7eFO0qbTDH2izb0dPq/gyru3QlZiXDRgCT7 a+XXFwPB2jviEWVO5V59Usrla8/TcZmHY1+M2B+/YqdhCROkgFcKjPhPRCR2KT0o5HaL r8Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=EqZHdEGK; dkim=neutral (no key) header.i=@linutronix.de header.b=QbtPYb4u; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j197-20020a636ece000000b0053b9ebed2adsi6602526pgc.190.2023.05.28.01.40.09; Sun, 28 May 2023 01:40:21 -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=@linutronix.de header.s=2020 header.b=EqZHdEGK; dkim=neutral (no key) header.i=@linutronix.de header.b=QbtPYb4u; 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 S229586AbjE1HxO (ORCPT + 99 others); Sun, 28 May 2023 03:53:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjE1HxF (ORCPT ); Sun, 28 May 2023 03:53:05 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F9D4D8 for ; Sun, 28 May 2023 00:53:04 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685260383; 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: references:references; bh=0CiayCmuynXWyLDPAGrYgKcXEb7S6XZxZQEc7fj0LTk=; b=EqZHdEGKKe6vzfzDVdTndGRcMdPrvBz2D6ZYFjHEvCKsOYfvLYiBffHixCIZJ13LPXXJM2 zdLDkueuoZzE3VaAa325bKG63ZPgxYJBtylQiCphP3aqFg/HiciQI1SYTxtZT9r9KrP7W2 fStrwlw1EaDELdA6u84F9sBxAG68azKbF5m9n8K93UWPH5iZL3Jqdd1cCcOLVM3o0iVSGa 6e5ew3g82HtWIavzo4wo4426IgpSIer0GYMd7Nyq9xeW3NfCnsYkjb3oVkGOwq7sPZBQPW BzfF6F5YtIPgoIMDKHSoV+IILHWxE2lpaGuIzZ2XE/3wNFgpXY6mZgWHbczyfA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685260383; 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: references:references; bh=0CiayCmuynXWyLDPAGrYgKcXEb7S6XZxZQEc7fj0LTk=; b=QbtPYb4ueYuVWsBo2lmr+PVRHaSA5we1SIWwL7JawuvYMi4/pgVRWvXtMA9Q6rmm/Rg9eh NMId5Os97rfNMNDw== To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] x86/urgent for 6.4-rc4 References: <168526035526.3457722.14103350194452732675.tglx@xen13> Message-ID: <168526036137.3457722.17274974250309862601.tglx@xen13> MIME-Version: 1.0 Date: Sun, 28 May 2023 09:53:02 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767126567563729822?= X-GMAIL-MSGID: =?utf-8?q?1767126567563729822?= Linus, please pull the latest x86/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-2023-05-28 up to: edc0a2b59576: x86/topology: Fix erroneous smp_num_siblings on Intel Hybrid platforms A single fix for x86: - Prevent a bogus setting for the number of HT siblings, which is caused by the CPUID evaluation trainwreck of X86. That recomputes the value for each CPU, so the last CPU "wins". That can cause completely bogus sibling values. Thanks, tglx ------------------> Zhang Rui (1): x86/topology: Fix erroneous smp_num_siblings on Intel Hybrid platforms arch/x86/kernel/cpu/topology.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c index 5e868b62a7c4..0270925fe013 100644 --- a/arch/x86/kernel/cpu/topology.c +++ b/arch/x86/kernel/cpu/topology.c @@ -79,7 +79,7 @@ int detect_extended_topology_early(struct cpuinfo_x86 *c) * initial apic id, which also represents 32-bit extended x2apic id. */ c->initial_apicid = edx; - smp_num_siblings = LEVEL_MAX_SIBLINGS(ebx); + smp_num_siblings = max_t(int, smp_num_siblings, LEVEL_MAX_SIBLINGS(ebx)); #endif return 0; } @@ -109,7 +109,8 @@ int detect_extended_topology(struct cpuinfo_x86 *c) */ cpuid_count(leaf, SMT_LEVEL, &eax, &ebx, &ecx, &edx); c->initial_apicid = edx; - core_level_siblings = smp_num_siblings = LEVEL_MAX_SIBLINGS(ebx); + core_level_siblings = LEVEL_MAX_SIBLINGS(ebx); + smp_num_siblings = max_t(int, smp_num_siblings, LEVEL_MAX_SIBLINGS(ebx)); core_plus_mask_width = ht_mask_width = BITS_SHIFT_NEXT_LEVEL(eax); die_level_siblings = LEVEL_MAX_SIBLINGS(ebx); pkg_mask_width = die_plus_mask_width = BITS_SHIFT_NEXT_LEVEL(eax);