Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp980680rwr; Thu, 4 May 2023 12:16:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6pGe65gcbzlSb3F9OR5vd9p/sH8fIYFObOhWPR3y92VTWhhRiKv0BSN84BAm8WHjKe9Y13 X-Received: by 2002:a05:6a20:394b:b0:f0:50c4:4c43 with SMTP id r11-20020a056a20394b00b000f050c44c43mr3458072pzg.5.1683227777660; Thu, 04 May 2023 12:16:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683227777; cv=none; d=google.com; s=arc-20160816; b=TPuZ9m/G55AjjRxdv1HVBnMK4z0nfarZqgxgTnEmcr6rpewgQZcnCPZDG0CeTex3Ms l4u0iEP80NY+FQfBR4N3U/BzZEhNb8GS32XKEhSSCRf+kgNPiWVBWCcIdmpZpD3HbLeb 2xs/8MNQwhzoZYssqs4ZHiI56+PM2wpcp/QJW5a+X94z2R4NmrpycnPAP6y/WlM2c+qK Hbypi1xnvkJle+WYdji1ZjZ7xY+60BO8MQg9kJD1Hem03zhXJyiuWZPm9XnoTmuvMLsW J0AmKZJ5+pBsQ5dQzxj2Atyr/B6rHpguFO5mFGVM4ZEidiQMkkcedBuJm1ylpSEaSiRQ fa2g== 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=7w0pkJKfi5BfzTn7YraeCXszLQVgaQibx9fCVrsyYLw=; b=s/CuAQQagkS5dq67Cr7e7h5peZCxM30StMwckx/37LRlvFSYaz8tqXNm3yXP2C9GPP 28xBLUIJHvSg8GdgAowsZWAC168rQFa+gTGgfyWzAnXZo3O/hOu6jIxxrDxNfiTySxME GzNx3Jf7UmLbafHoU6ezXYcmgxzLoxh83LdmozBTe0QnioTdV93gwj3Ou7rrwaaTfdqH Qad8waMBnMIjgNYpxcVN5wEmSGiF+fUkQ1EPNkKfq06lcnYhaqao/eb+YiixXryJ6j40 m9McPg9ZDphta5TJuKKCRXdS8pz/M1qbCzNy3vPl/HAb6V3u9P1YJX1eLAfleWKvcj76 SD3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=KF4OYjBu; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h28-20020a63385c000000b0052167705593si119529pgn.355.2023.05.04.12.16.03; Thu, 04 May 2023 12:16:17 -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=KF4OYjBu; 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 S229757AbjEDTDE (ORCPT + 99 others); Thu, 4 May 2023 15:03:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbjEDTCr (ORCPT ); Thu, 4 May 2023 15:02:47 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 465FE83F1; Thu, 4 May 2023 12:02:18 -0700 (PDT) Message-ID: <20230504185936.917560748@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683226936; 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=7w0pkJKfi5BfzTn7YraeCXszLQVgaQibx9fCVrsyYLw=; b=KF4OYjBu/WAVy3JeYBlPGuO/psPpP6BNMkGwUP4hVxM+/D+l51OxcfTtr1678q7sAM86+l pkSbimwtfW+4xdLulA4/Enq9nqbfEKxZaT/IcZ6t/X1KbwGa9K46/CqLa2h1H1kz8voODT y4AmfcuAbs0leulnqDLnh1gIEYzNbs3Hpt0le/7AsOwR44b/CdgLPyNGYtpoteTh4TSBz6 xBxTc2mzXrBGxYo6rlw1ZlvxoGPyU9ZhtpO28GI1g1d9zu8k+2yJftFOirkgMuWcP7q1P8 AsSeoEHmtH0f/Ry8sbvPf/V1KSj5/DXRuhM2P4J01rZzTyifP9FYxFi1Q1uu8g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683226936; 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=7w0pkJKfi5BfzTn7YraeCXszLQVgaQibx9fCVrsyYLw=; b=AOLL7N8FlgTgX4Vpe4Ih6WqHRrBw5YfnEZjwda6Z8s/doyNG0e8UyHLJJ/7vaMaivGQ2TR 0D5J6mUQhC4iKrBA== 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 11/38] x86/smpboot: Move synchronization masks to SMP boot code References: <20230504185733.126511787@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Thu, 4 May 2023 21:02:16 +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 From: Thomas Gleixner The usage is in smpboot.c and not in the CPU initialization code. The XEN_PV usage of cpu_callout_mask is obsolete as cpu_init() not longer waits and cacheinfo has its own CPU mask now, so cpu_callout_mask can be made static too. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/cpumask.h | 5 ----- arch/x86/kernel/cpu/common.c | 17 ----------------- arch/x86/kernel/smpboot.c | 16 ++++++++++++++++ arch/x86/xen/smp_pv.c | 3 --- 4 files changed, 16 insertions(+), 25 deletions(-) --- --- a/arch/x86/include/asm/cpumask.h +++ b/arch/x86/include/asm/cpumask.h @@ -4,11 +4,6 @@ #ifndef __ASSEMBLY__ #include -extern cpumask_var_t cpu_callin_mask; -extern cpumask_var_t cpu_callout_mask; -extern cpumask_var_t cpu_initialized_mask; -extern cpumask_var_t cpu_sibling_setup_mask; - extern void setup_cpu_local_masks(void); /* --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -67,14 +67,6 @@ u32 elf_hwcap2 __read_mostly; -/* all of these masks are initialized in setup_cpu_local_masks() */ -cpumask_var_t cpu_initialized_mask; -cpumask_var_t cpu_callout_mask; -cpumask_var_t cpu_callin_mask; - -/* representing cpus for which sibling maps can be computed */ -cpumask_var_t cpu_sibling_setup_mask; - /* Number of siblings per CPU package */ int smp_num_siblings = 1; EXPORT_SYMBOL(smp_num_siblings); @@ -169,15 +161,6 @@ static void ppin_init(struct cpuinfo_x86 clear_cpu_cap(c, info->feature); } -/* correctly size the local cpu masks */ -void __init setup_cpu_local_masks(void) -{ - alloc_bootmem_cpumask_var(&cpu_initialized_mask); - alloc_bootmem_cpumask_var(&cpu_callin_mask); - alloc_bootmem_cpumask_var(&cpu_callout_mask); - alloc_bootmem_cpumask_var(&cpu_sibling_setup_mask); -} - static void default_init(struct cpuinfo_x86 *c) { #ifdef CONFIG_X86_64 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -101,6 +101,13 @@ EXPORT_PER_CPU_SYMBOL(cpu_die_map); DEFINE_PER_CPU_READ_MOSTLY(struct cpuinfo_x86, cpu_info); EXPORT_PER_CPU_SYMBOL(cpu_info); +/* All of these masks are initialized in setup_cpu_local_masks() */ +static cpumask_var_t cpu_initialized_mask; +static cpumask_var_t cpu_callout_mask; +static cpumask_var_t cpu_callin_mask; +/* Representing CPUs for which sibling maps can be computed */ +static cpumask_var_t cpu_sibling_setup_mask; + /* Logical package management. We might want to allocate that dynamically */ unsigned int __max_logical_packages __read_mostly; EXPORT_SYMBOL(__max_logical_packages); @@ -1548,6 +1555,15 @@ early_param("possible_cpus", _setup_poss set_cpu_possible(i, true); } +/* correctly size the local cpu masks */ +void __init setup_cpu_local_masks(void) +{ + alloc_bootmem_cpumask_var(&cpu_initialized_mask); + alloc_bootmem_cpumask_var(&cpu_callin_mask); + alloc_bootmem_cpumask_var(&cpu_callout_mask); + alloc_bootmem_cpumask_var(&cpu_sibling_setup_mask); +} + #ifdef CONFIG_HOTPLUG_CPU /* Recompute SMT state for all CPUs on offline */ --- a/arch/x86/xen/smp_pv.c +++ b/arch/x86/xen/smp_pv.c @@ -254,15 +254,12 @@ cpu_initialize_context(unsigned int cpu, struct desc_struct *gdt; unsigned long gdt_mfn; - /* used to tell cpu_init() that it can proceed with initialization */ - cpumask_set_cpu(cpu, cpu_callout_mask); if (cpumask_test_and_set_cpu(cpu, xen_cpu_initialized_map)) return 0; ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); if (ctxt == NULL) { cpumask_clear_cpu(cpu, xen_cpu_initialized_map); - cpumask_clear_cpu(cpu, cpu_callout_mask); return -ENOMEM; }