From patchwork Thu May 4 19:02:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 90219 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp532375rwl; Thu, 4 May 2023 12:43:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ731ls21ZsnpS5MHDA9DSouai6JesNWX6tc0COpQmzDoGCRFQmaAp0loC+Dn+rOjBkBLT0k X-Received: by 2002:a17:90b:3592:b0:247:35c7:bd67 with SMTP id mm18-20020a17090b359200b0024735c7bd67mr3109330pjb.46.1683229381338; Thu, 04 May 2023 12:43:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683229381; cv=none; d=google.com; s=arc-20160816; b=T/nIPOsT8uK1rYxVRH1AC5X2bTC6ACzZIhZ2heo6MHinGouBEEiA7TsG9EC+tQJPI7 RnXM+oWOXPBN/2uvybMhrNBJyYM6QfNaEuT0m/oHphOTlZop64jBpi1WlWHAUwuKztn7 PBcVY0y51M8pNO+hXRgZCdByFz03kGCJI3p9E4h1rAqzEsFNPV5f+Zdj6ELLSdRUx00V VINJAL7bD+5YLCwPcxKO8xFnAIU8t6LPPFpOwmmQPHUpOp0hOYiZ/OMqh/YggbwOpFgM 8WbhuQtfR/X/zKY5BRRydRblrb/hbOhyHTu768iZUoMcAqWCr+xWYxgDTbSHtvtG9lg1 s3zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=Mxn87t9DPEW945il616r0H0SsMXLyUAeJz1AKeylD8A=; b=g0sISOUc9idXSHs25sEhbDHVOGKUOZDykIDpiKXHE2TATqDd00aBzPplBKYF9fkHgj Aah/kgYDcj3o9dPfYXi0B3H5H2y8hawRTCzyb34JnoGalLkQiPt8uKWovJQdPsK2w7XL nKFBurS0INhXYfAfRodzBeort+IUr19KevRpBWzK+dLZvyngWauSCnOAdEeoFecr+Ni2 zjVJoi3H+laktbTUc5nm82yKs44Mefu9e8A50R4qNtByAJPeyPEbJoQZJDs9UjfJPjvc zjPtj/MsYXBDQysMS3ejtDR7rcVneHmGfsfTsgBH6rtXI5ODvFdJAnV/9HsV4gDK9hyZ 9OGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gN6osUOU; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=11ibvq89; 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 u13-20020a17090ae00d00b0024ddf090102si14042196pjy.56.2023.05.04.12.42.26; Thu, 04 May 2023 12:43:01 -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=gN6osUOU; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=11ibvq89; 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 S229881AbjEDTCE (ORCPT + 99 others); Thu, 4 May 2023 15:02:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229719AbjEDTCD (ORCPT ); Thu, 4 May 2023 15:02:03 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 389765247; Thu, 4 May 2023 12:02:02 -0700 (PDT) Message-ID: <20230504185936.367031787@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683226920; 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: references:references; bh=Mxn87t9DPEW945il616r0H0SsMXLyUAeJz1AKeylD8A=; b=gN6osUOUj5A4g4ikKpXMxZ7xRrn0bkpwHrNdWYplv0k7rI8gYfItE27E6osNTA/nV1mrk6 WWlzivAwHb3vuxBg3D/Ns21CditKMkPPd9EuijqE+Nl5O62KUwKu3kPrFtGxrKeH/ZJJrC NGZ2k4dOGaPPd/q3/QBB7j+SwZjA+XWe0JSQ1Pjv2a+MTO268fjYE3GMmFpYdhCRR1vFB4 W35O70R3dhw4wdItVUsrhBSyeS38/14353iSux461nIW3VIT8Vl8zXmiSxiD/GMMsuMkzg wRMAaeVRVTGibV6maAbKj32s9VnEdmCl40bZStr+bAA0dwvsHXYOC5oLT4h4Jw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683226920; 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: references:references; bh=Mxn87t9DPEW945il616r0H0SsMXLyUAeJz1AKeylD8A=; b=11ibvq89apUCBbI307f/UhkVNeawUcpQ0C+FqbsH6snqLrHmocC2FzctyE3MrTYESrxN+r cfzlPdKVby530BCw== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, David Woodhouse , Andrew Cooper , Brian Gerst , Arjan van de Veen , Paolo Bonzini , Paul McKenney , Tom Lendacky , Sean Christopherson , Oleksandr Natalenko , Paul Menzel , "Guilherme G. Piccoli" , Piotr Gorski , Usama Arif , Juergen Gross , Boris Ostrovsky , xen-devel@lists.xenproject.org, Russell King , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Guo Ren , linux-csky@vger.kernel.org, Thomas Bogendoerfer , linux-mips@vger.kernel.org, "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Mark Rutland , Sabin Rapan , "Michael Kelley (LINUX)" Subject: [patch V2 01/38] x86/smpboot: Cleanup topology_phys_to_logical_pkg()/die() References: <20230504185733.126511787@linutronix.de> MIME-Version: 1.0 Date: Thu, 4 May 2023 21:02:00 +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,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?1764993931807272926?= X-GMAIL-MSGID: =?utf-8?q?1764993931807272926?= From: Thomas Gleixner 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 --- arch/x86/include/asm/topology.h | 3 --- arch/x86/kernel/smpboot.c | 10 ++++++---- 2 files changed, 6 insertions(+), 7 deletions(-) --- --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -139,7 +139,6 @@ static inline int topology_max_smt_threa 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 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; } --- 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(unsigne 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(unsigne } return -1; } -EXPORT_SYMBOL(topology_phys_to_logical_die); /** * topology_update_package_map - Update the physical to logical package map