Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1167595rwl; Fri, 24 Mar 2023 07:09:15 -0700 (PDT) X-Google-Smtp-Source: AKy350YPf/ig4P5wRnV/icc0TNfAeyR/nReI2e0O3P6wU638iBHgBMqsJL0A8l+qbES06c67kB+y X-Received: by 2002:aa7:df84:0:b0:501:d532:d84e with SMTP id b4-20020aa7df84000000b00501d532d84emr2558587edy.39.1679666955033; Fri, 24 Mar 2023 07:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679666955; cv=none; d=google.com; s=arc-20160816; b=YcihjGbf+U5qTNDOg0CF+9DcPWArah6Fyes8Yf70vaM3y4+G4tvmqUvdiHaqpRfHWU IrSKxAqNOJBWY96ujCrGkNwBuQ4676KogYLnjM0mT7emLjzhbuFnW6vIA74v6tUP/ugA ocQqlS4StaxXxe0rdUV3haPWVc84hOmADcaIICdnysP1fRzk6xa4w20LWSdAr+fxPnEX 2xydxMWxoaYHAjSopHPG4lP3AP55BaLrWa+Og56N5zAJHuRpWpFzF+V5/4+wrtumtgIA OvbsgaZEr5NXGHS9Wb6MxzrxqNnyeMGVxNv4mxf+1HNjyV8/JbDSWfJzQAOqP4QnCBa4 uKVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=trN8ws+yoWkPCst62r6wYhEGrbcVOPdAkjJjmaanEKw=; b=C7Jnp6hpIvTKxGzBvrXWi9WxFRA1uD+SsjuWilNzWbwjGX4hkHENBtRb82eIFEnSxl alcdIGZuiyYd9jEF7hQXC6/0NbtJW7tCPn2lHHm6QfmdL3DGCCVhMiFHw4+3cFRSTwNf yeGbG4wLP3gswJrQfnUuHu+suQigkeAxiqZUujfB9WaxJlXs4VE2eUHUEyWUe09D4GQw R8O83Pm8Yl5I8l3MOfEQ8pkMEpzSIdkW3Pd9jBQj+YTiqa7TnFqyoBrVwJEF7wcBvcRf LvKKzyS1QvkLSyAeunkDO8VfsgFijxPQK0ufz2e+lGxp0IQkhc5sO1Tb6Wo7D7a5QYOf c3oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZLXH65Z7; 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 a20-20020aa7cf14000000b00501db3adafasi10965448edy.510.2023.03.24.07.08.46; Fri, 24 Mar 2023 07:09:15 -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=ZLXH65Z7; 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 S231346AbjCXOHz (ORCPT + 99 others); Fri, 24 Mar 2023 10:07:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231895AbjCXOHt (ORCPT ); Fri, 24 Mar 2023 10:07:49 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DAF61B578; Fri, 24 Mar 2023 07:07:44 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1679666863; 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: in-reply-to:in-reply-to:references:references; bh=trN8ws+yoWkPCst62r6wYhEGrbcVOPdAkjJjmaanEKw=; b=ZLXH65Z7U58be+jPXNuYmmP0lbqCTLdvjOlJzYyQ9fzn7gzL9FSRWkPAyiPK6gaP+hGRp2 7eiBo1x8a0geJpJeVuZ/c1ELrPQR7C+WVSdgEhoa+L5Z18rP9UHszgqMJE+QZJPVfUPekb 6f0izA4k/hh1e/9dI41TTb953EM1qvX+VsawxmkZmPpFK9Ny77uL6KsckJb4EwYlW1rX1A EGOQOZu4PgqpmWyrPzDtOlYxHPuPIeUk5/Tcff54QKz3iuhOyFo9s29TJ6OKnzYcQaDIGV VIJiMTFucn7JVrHY6AcSp9JLmcEkc/Ub1+xDJ8TP57Kd0N8dKyU3J5UVl2GS7w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1679666863; 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: in-reply-to:in-reply-to:references:references; bh=trN8ws+yoWkPCst62r6wYhEGrbcVOPdAkjJjmaanEKw=; b=1YvIv0U8tNVjazSbCdzpIVSj62NO8eICVmhI8XpO/rp2QXFrZb4lW0h8AQVp0e0IPlu22B WbSNr7y+8rrgPeAA== To: David Woodhouse , Usama Arif , kim.phillips@amd.com, brgerst@gmail.com Cc: piotrgorski@cachyos.org, oleksandr@natalenko.name, arjan@linux.intel.com, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, x86@kernel.org, pbonzini@redhat.com, paulmck@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, rcu@vger.kernel.org, mimoja@mimoja.de, hewenliang4@huawei.com, thomas.lendacky@amd.com, seanjc@google.com, pmenzel@molgen.mpg.de, fam.zheng@bytedance.com, punit.agrawal@bytedance.com, simon.evans@bytedance.com, liangma@liangbit.com, gpiccoli@igalia.com Subject: Re: [PATCH v16 3/8] cpu/hotplug: Add dynamic parallel bringup states before CPUHP_BRINGUP_CPU In-Reply-To: <115b39e0226915b8f69ea0cce2487588f6010995.camel@infradead.org> References: <20230321194008.785922-1-usama.arif@bytedance.com> <20230321194008.785922-4-usama.arif@bytedance.com> <874jqb8588.ffs@tglx> <871qlf83wj.ffs@tglx> <8dff6ae5ffaebfbcc55a01c04420fd478070b830.camel@infradead.org> <87v8ir6j96.ffs@tglx> <115b39e0226915b8f69ea0cce2487588f6010995.camel@infradead.org> Date: Fri, 24 Mar 2023 15:07:42 +0100 Message-ID: <87lejm6y4x.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On Fri, Mar 24 2023 at 09:31, David Woodhouse wrote: > On Fri, 2023-03-24 at 02:16 +0100, Thomas Gleixner wrote: >> But that's non-trivial because if you look at bringup_cpu() then you'll >> notice that this state has an implicit protection against interrupt >> allocation/free and quite some architectures rely on this for their >> early bringup code and possibly their STARTING state callbacks. > > I literally pointed that out in 2021 (in one of the messages I > reference below). > > For x86 I don't believe that's going to be an issue yet, if at all. I > think it matters for the lapic_online() call which happens near the end > of start_secondary(); it's almost the last thing it does before going > into the generic AP startup thread. It's *also* preceded by a comment > that at least *suggests* it ought to be fine anyway, although we should > never entirely trust such comments. > > /* > * Lock vector_lock, set CPU online and bring the vector > * allocator online. Online must be set with vector_lock held > * to prevent a concurrent irq setup/teardown from seeing a > * half valid vector space. That setup/teardown wording is misleading as that's already covered by sparse_irq_lock. This is purely x86 specific. Setting the CPU online and onlining the CPU in the matrix allocator has to be atomic vs. concurrent allocations from the matrix allocator, which can happen via request/free_irq() and affinity changes independent of interrupt setup/teardown (e.g. MSI enable). Thanks, tglx