From patchwork Fri May 12 21:06:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 93410 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5399394vqo; Fri, 12 May 2023 14:25:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zgqtCeOz8GIXyfLHNuTWfPe2nOVaJo+4yBOKb5FA26dnvEVpmB1o8Hll98Vx+mr9GKMEt X-Received: by 2002:a05:6a20:7485:b0:103:a24e:9a48 with SMTP id p5-20020a056a20748500b00103a24e9a48mr10932006pzd.17.1683926735611; Fri, 12 May 2023 14:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683926735; cv=none; d=google.com; s=arc-20160816; b=umcIn9aIRAVi8CqGNNKt5ARO6TM2CAmVyGFDQXn00nC8zrukaBmovHCM8KTDqu4xvJ rb8yjk2fi9ttGD4HB/EqoEVKr5WmqrSiso/NQ1QzpaXWGSAtfLh3Rh0cX7kIBptsVRnw FWDTH8ROpJvv57F53Yhz3cMFgmhSi/FlMsdT6TJGN1tq33MazqAD4F7qhIuyLRjwbiHV KKU/USK5KEz6z+b0zeL1RJwKBSiCh747xaNUX2yCcq14utUr1GfwhiCTn6Va11CtPOHy 052v8HN9LyEwKcTq6+LGAIxo9hb02FcZmfcgexakNP8z1cWzLeI9J1ulS0NtxxOAl10r mtIg== 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=s6VYVqWXqkUTfsBItuhC7K5jhMRHOO4jS7pH6HBneyQ=; b=MJzofTOnAMHt5b+VtWkc2nm+njMXU+PNHV59CEai85i4kopbanGIZ6xDUMxkO4uuB3 1pmL6ZWMz4iX2AtKtXLqwUipNJF/Oa9oPkDk33kL/dY5vQOVMb8RhKUBTvoB/he3rJr8 x67Nl6jCyjdpNtyx/ihyHRFY/HG0Ik3KJAWsrH1O0SwU9pcXUJRsiOoVqbFmlaXri9As +A91fAJRrCh8fUpuNnju9fWL5ovHebUmmCvIhXMoy9Ilt9s8OSPacrIalIjdh6OHHJyh 6ON+S2umqiZRrkqe5jQ6aaB80t6oLyh5lTHDitUIZNz8Y7KMOoPfHJLcJgij96rzLvF3 rhbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=D8Bi7VzT; 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 h191-20020a6383c8000000b0052c4331ea8dsi9069858pge.27.2023.05.12.14.25.22; Fri, 12 May 2023 14:25:35 -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=D8Bi7VzT; 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 S239412AbjELVHG (ORCPT + 99 others); Fri, 12 May 2023 17:07:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238763AbjELVHC (ORCPT ); Fri, 12 May 2023 17:07:02 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 862EB49DB; Fri, 12 May 2023 14:07:01 -0700 (PDT) Message-ID: <20230512205255.493750666@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683925619; 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=s6VYVqWXqkUTfsBItuhC7K5jhMRHOO4jS7pH6HBneyQ=; b=D8Bi7VzTkuViWKmMifMnim1UAY/BXTvSuSeXwEuTUeLAvarTwWc9SV8KqlElC0pgUFTjWP 2jbw6QOOcurfoCC/WTzJxcK+XMQbkO3EARTs1kYAYqGIivOYxqP7phYyepd0BKzmfTwpU6 Fw27scx120Ouaogv6XXjSnLZ9E+e/mhGz0dBUDIWJbMwJM56liQqcXjp2J4SP+zDoj4UTD RkPo9Y/fmZ/WujXo2Jf2gMUDGJZzU645UEoHLJ97eXWUzvUjxZ2adQMv8d0FDDOk5xDpxw JWIBF5jgEjyZJRTxuuMA3y82/EpNmPxEMuOLMXTOL5dXeVw9uM4RVrDqbMI2mw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683925619; 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=s6VYVqWXqkUTfsBItuhC7K5jhMRHOO4jS7pH6HBneyQ=; b=LJpoYetOuh1jVxtlimZvIQSZscCqqjHl4hpuECjN5kaXN60+ti3C/hqHH5CB8z82fLbd2o Blu2a904F8bPRxDw== 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)" , Ross Philipson Subject: [patch V4 01/37] x86/smpboot: Cleanup topology_phys_to_logical_pkg()/die() References: <20230512203426.452963764@linutronix.de> MIME-Version: 1.0 Date: Fri, 12 May 2023 23:06:58 +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?1765725160966230644?= X-GMAIL-MSGID: =?utf-8?q?1765725160966230644?= 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 Tested-by: Michael Kelley --- 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