From patchwork Tue May 16 09:10:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 94580 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp287941vqo; Tue, 16 May 2023 02:21:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Pjbrp1NTUZl2a4XrW9zfJM28hQhlNyCI+c7w9SXb0XkSkHBPI9lh5fh+X1marQxfFQW9k X-Received: by 2002:a05:6a00:4c18:b0:649:76a8:df27 with SMTP id ea24-20020a056a004c1800b0064976a8df27mr20766954pfb.14.1684228867319; Tue, 16 May 2023 02:21:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684228867; cv=none; d=google.com; s=arc-20160816; b=VTQ1w5qKDHfC7/ONqIZrePt2Tp+By1yB5wvzrRjsvSh7OLFvQtD7U0bMKUtJhY8w6N p+T5ySWx33+52cFGfuSgETXr8GEQaW03Teuf+u/ICAi2xnMv+UkgUrRg0XZOJI2bi2lu rqd6O7+I5mxXsfYWJdxWvnfGZ/h/7ahp7CEmmjwucBMsaZmi874L+fHw1nqqq5Yti0qs be1ea4ESvU3v508UuHrbR+rWGHOkbUb/cMV8AvSgqqiem1oVZju7D9OCVclg8idy/ccD bvNipcMMFkLBhK6A1sDeHW3EFRt7kzlJjtEnP/Ws+vwKfQO03AWHI35RPPySrtQtkk7Y eacA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=x9sWVRJedFibc6rSu8z+Ut4qppQZb1WpLCQ9D5Xg158=; b=oOJcWhhkBSbaW/5p0lNOHCLc1BNjnMqKr6XxGFJWxLMxQj3xnsLFnp8tbZPZxZVOcY Vnq1M1ZMSjOsttW91FP5baYJ5TuPdFd5SRhyJv6MwfYc/WcB79W4elCXLtYLJXvhre/e 9QJ7ov6w4gfL+O1uiin/kzp7DY3+wz10F7ZWqZnwYHdvdLNgTDPdbke2nPw3pEhKF8Vb KzA4o9K6N6rQBOn4dRy3oPdIKrkYhx2dXieUahYtRlVLHRkr4KsVaZ5UCA5NUfV8jLfF kYQ0sJVGyCURj2wE0dle94aVCsc131pSOjvlEYDgJuDV8KR9mdg3sUYW/Xg3P9G1s5Ue vSkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=j+HyFhSE; dkim=neutral (no key) header.i=@linutronix.de; 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 t2-20020a63a602000000b0052feffab90esi7895227pge.93.2023.05.16.02.20.54; Tue, 16 May 2023 02:21:07 -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=j+HyFhSE; dkim=neutral (no key) header.i=@linutronix.de; 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 S232043AbjEPJMg (ORCPT + 99 others); Tue, 16 May 2023 05:12:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjEPJKQ (ORCPT ); Tue, 16 May 2023 05:10:16 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EE654EE8; Tue, 16 May 2023 02:10:08 -0700 (PDT) Date: Tue, 16 May 2023 09:10:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684228204; h=from:from:sender:sender:reply-to: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=x9sWVRJedFibc6rSu8z+Ut4qppQZb1WpLCQ9D5Xg158=; b=j+HyFhSEYF0uLyU2IrmCPxewDSkNY5yWuYh3AOr0/E13Tuwr5lbaFqN0pPQDTYEl+c/Xvc k5xutZW7tQDmcSoYMgda8k9fPlMBEGrl5OlA1PiZn/r09XRHPXUGBHu73nuxAVP0BmP7DS OdOVyvdKFfEPxGCbf84NIVGHYqaGWTpi/n/ZQqQplOGLkrYLiAhZcY6pwv+vQRhQI2xB36 dKv2FY3vFfzBLmoa0TZ2fuHTeDfhvcTRmkZe2KxuZaYZ2KQ1XuVVSJ4RDC4DK3rCyN3v+o zGBLfa+cxveLkz/gCpCxEcz0GmkPMAsGo1CnU/cCbsuW+PpFAzpdFjv5Ps3gLA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684228204; h=from:from:sender:sender:reply-to: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=x9sWVRJedFibc6rSu8z+Ut4qppQZb1WpLCQ9D5Xg158=; b=bBVbPZPv3lS7gmGx4k7sBHPJs9FmQQZh2PAVpSgfDm8acoWA6VFP54n1iqh6VEh5ghAe3+ YKowcwepVqZhroDQ== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] x86/smpboot: Cleanup topology_phys_to_logical_pkg()/die() Cc: Thomas Gleixner , "Peter Zijlstra (Intel)" , Michael Kelley , Oleksandr Natalenko , Helge Deller , "Guilherme G. Piccoli" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230512205255.493750666@linutronix.de> References: <20230512205255.493750666@linutronix.de> MIME-Version: 1.0 Message-ID: <168422820378.404.3480586870507701580.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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,URIBL_BLOCKED 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?1765725160966230644?= X-GMAIL-MSGID: =?utf-8?q?1766041968811848196?= The following commit has been merged into the smp/core branch of tip: Commit-ID: 5107e3ebb868d99872e1b64b054ccfcdad79d5d7 Gitweb: https://git.kernel.org/tip/5107e3ebb868d99872e1b64b054ccfcdad79d5d7 Author: Thomas Gleixner AuthorDate: Fri, 12 May 2023 23:06:58 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 15 May 2023 13:44:47 +02:00 x86/smpboot: Cleanup topology_phys_to_logical_pkg()/die() Make topology_phys_to_logical_pkg_die() static as it's only used in smpboot.c and fixup the kernel-doc warnings for both functions. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205255.493750666@linutronix.de --- arch/x86/include/asm/topology.h | 3 --- arch/x86/kernel/smpboot.c | 10 ++++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 458c891..2ba5758 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -139,7 +139,6 @@ static inline int topology_max_smt_threads(void) int topology_update_package_map(unsigned int apicid, unsigned int cpu); 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 @@ -149,8 +148,6 @@ topology_update_package_map(unsigned int apicid, unsigned int cpu) { return 0; } static inline int topology_update_die_map(unsigned int dieid, unsigned int cpu) { return 0; } static inline int topology_phys_to_logical_pkg(unsigned int pkg) { return 0; } -static inline int topology_phys_to_logical_die(unsigned int die, - unsigned int cpu) { return 0; } 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; } diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 352f0ce..bca9692 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -288,6 +288,7 @@ bool topology_smt_supported(void) /** * topology_phys_to_logical_pkg - Map a physical package id to a logical + * @phys_pkg: The physical package id to map * * Returns logical package id or -1 if not found */ @@ -304,15 +305,17 @@ int topology_phys_to_logical_pkg(unsigned int phys_pkg) return -1; } EXPORT_SYMBOL(topology_phys_to_logical_pkg); + /** * topology_phys_to_logical_die - Map a physical die id to logical + * @die_id: The physical die id to map + * @cur_cpu: The CPU for which the mapping is done * * Returns logical die id or -1 if not found */ -int topology_phys_to_logical_die(unsigned int die_id, unsigned int cur_cpu) +static int topology_phys_to_logical_die(unsigned int die_id, unsigned int cur_cpu) { - int cpu; - int proc_id = cpu_data(cur_cpu).phys_proc_id; + int cpu, proc_id = cpu_data(cur_cpu).phys_proc_id; for_each_possible_cpu(cpu) { struct cpuinfo_x86 *c = &cpu_data(cpu); @@ -323,7 +326,6 @@ int topology_phys_to_logical_die(unsigned int die_id, unsigned int cur_cpu) } return -1; } -EXPORT_SYMBOL(topology_phys_to_logical_die); /** * topology_update_package_map - Update the physical to logical package map