Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1312681rwd; Thu, 15 Jun 2023 08:56:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6UswrT75tJ8Vi8erUEZ9Lmc7J1dQZPF5c86l6DtEMf0eXsXjcrlFDkhPfmCL7OxtGIZV87 X-Received: by 2002:a05:6a20:258f:b0:10f:8b61:195f with SMTP id k15-20020a056a20258f00b0010f8b61195fmr6056826pzd.46.1686844604151; Thu, 15 Jun 2023 08:56:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686844604; cv=none; d=google.com; s=arc-20160816; b=Xaj7rdE8q4ci+mY7Brga5SyoTWvWAep2/8PWPokZDBP1yDbdaaH/wCwsPiEY9awVL4 FjsZ7amxSbyBOzBTqaMjA3NcZoC91EseZuI3gY3bf1VNhwOxrGC2kIY+n7GjBTFystt5 y6D9jqqO30eyy8LM27vyxEC8mhf1tUE4TBuoWA7Nhkegrpxm57cEgOv/IikXnH1vohu3 kadQmpMSqpxy3Vq1iI2ZrdlJHc8KzTp8TEPNk/OHQKiYal8YdTQ3pUcFM1ISnx5ffY0o PI0Mgu3+qFqfL5IJlzBYeSJnpRuYuRa5KA94iBXpszQlCxC21J+oi4fVAwCnLuXgIIEI GNlQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tBJniILrv67rMmqL7C9oGbfvlECwbA5Rr3vj+TgxJL4=; b=MG1i585DGEO9K7EtHDBrKyHtXC4Dt17NXft9eKLRzsE+xqCZhLGCMXVzqqtGGzyzzS bck5odWMirWL4vcKZRltyu2nxPtOiN0dgbEZ9x/YzurziCuyNqPJwkBh7i0sEusbM2+5 h3W0KFWw5IIQyzcnVrbP2Ixw45r2c/+IKbUWFgOzOI54cqDNuLL8y9f6IOIe08MkPQxI 0IEwZj4CczKuNCVgF1QiZO6Wcv2r+PnQ2j+qKGHYsNEMsQ7uuOhMP1gTEdPg4+R4JPW4 gOes43Xo8eBge+1n5KgohHv+U9IjHfa+iUUpwUqKqQUL0bmo9SRYelgHZy+Efpkm/AVi 8DGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=iAh0xDHH; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b67-20020a633446000000b0054fdcafcc67si2967304pga.604.2023.06.15.08.56.27; Thu, 15 Jun 2023 08:56:44 -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=@ibm.com header.s=pp1 header.b=iAh0xDHH; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344785AbjFOPuU (ORCPT + 99 others); Thu, 15 Jun 2023 11:50:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344642AbjFOPtw (ORCPT ); Thu, 15 Jun 2023 11:49:52 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A06C62971; Thu, 15 Jun 2023 08:49:41 -0700 (PDT) Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35FFHN2Z017883; Thu, 15 Jun 2023 15:49:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=tBJniILrv67rMmqL7C9oGbfvlECwbA5Rr3vj+TgxJL4=; b=iAh0xDHHDCjd9G9w3UrVkw+LeD1ew46806dpaOuSBJcsdv7EuQCBqa8H04NAfNfhUivT G2VXiXOnLfWjPa4JcVQyhB8sqXDDHJNPLShNT/Qt7EMSjW+pklJzf8VRdhhh8HYezSnd AXURMnkJt9VQnlYBKRqHSUlIpLiTn8enlmjB64pJqblh+KYJ9Ax1LW60iU2xgpzhJ1Wr agkk6Y44n0I9pzR/riWdyd0W6xdcF3E+voLR+YJoJDIGVKcosmAE9hyj+Q4pHH29gRRh XOyTv7g1i6INFQWf1rr4m/Zf0rp52cRAZxYk0WSIKVwMVJSvzScmui83oPVLApd2lTn7 Vg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3r855fh8h7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Jun 2023 15:49:25 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35FFfrpK004375; Thu, 15 Jun 2023 15:47:35 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3r855fh3xx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Jun 2023 15:47:35 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35F1GVsD031360; Thu, 15 Jun 2023 15:46:41 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3r4gee3pnt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Jun 2023 15:46:41 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35FFkdgZ23003802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Jun 2023 15:46:39 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E319E20040; Thu, 15 Jun 2023 15:46:38 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6C3722004B; Thu, 15 Jun 2023 15:46:38 +0000 (GMT) Received: from localhost.localdomain (unknown [9.144.159.119]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 15 Jun 2023 15:46:38 +0000 (GMT) From: Laurent Dufour To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, tglx@linutronix.de, dave.hansen@linux.intel.com, mingo@redhat.com, bp@alien8.de Subject: [PATCH 04/10] cpu/SMT: Remove topology_smt_supported() Date: Thu, 15 Jun 2023 17:46:29 +0200 Message-ID: <20230615154635.13660-5-ldufour@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230615154635.13660-1-ldufour@linux.ibm.com> References: <20230615154635.13660-1-ldufour@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: nAXNflDBTl8BxlXVtE0QF1g39VbH1Tbr X-Proofpoint-ORIG-GUID: W6NF13yLcqiOUoBvpxffToQBMXNpg7qW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-15_12,2023-06-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 spamscore=0 malwarescore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306150136 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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 Since the maximum number of threads is now passed to cpu_smt_set_num_threads(), checking that value is enough to know if SMT is supported. Cc: Michael Ellerman Suggested-by: Thomas Gleixner Signed-off-by: Laurent Dufour --- arch/x86/include/asm/topology.h | 2 -- arch/x86/kernel/smpboot.c | 8 -------- kernel/cpu.c | 2 +- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 66927a59e822..87358a8fe843 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -143,7 +143,6 @@ int topology_update_die_map(unsigned int dieid, unsigned int cpu); int topology_phys_to_logical_pkg(unsigned int pkg); int topology_phys_to_logical_die(unsigned int die, unsigned int cpu); bool topology_is_primary_thread(unsigned int cpu); -bool topology_smt_supported(void); #else #define topology_max_packages() (1) static inline int @@ -156,7 +155,6 @@ static inline int topology_phys_to_logical_die(unsigned int die, static inline int topology_max_die_per_package(void) { return 1; } static inline int topology_max_smt_threads(void) { return 1; } static inline bool topology_is_primary_thread(unsigned int cpu) { return true; } -static inline bool topology_smt_supported(void) { return false; } #endif static inline void arch_fix_phys_package_id(int num, u32 slot) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 352f0ce1ece4..3052c171668d 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -278,14 +278,6 @@ bool topology_is_primary_thread(unsigned int cpu) return apic_id_is_primary_thread(per_cpu(x86_cpu_to_apicid, cpu)); } -/** - * topology_smt_supported - Check whether SMT is supported by the CPUs - */ -bool topology_smt_supported(void) -{ - return smp_num_siblings > 1; -} - /** * topology_phys_to_logical_pkg - Map a physical package id to a logical * diff --git a/kernel/cpu.c b/kernel/cpu.c index edca8b7bd400..e354af92b2b8 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -442,7 +442,7 @@ void __init cpu_smt_set_num_threads(unsigned int num_threads, { WARN_ON(!num_threads || (num_threads > max_threads)); - if (!topology_smt_supported()) + if (max_threads == 1) cpu_smt_control = CPU_SMT_NOT_SUPPORTED; cpu_smt_max_threads = max_threads; -- 2.41.0