From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2537135DA44 for ; Wed, 4 Mar 2026 16:34:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772642045; cv=none; b=ErwLlFxNes/+JAldg7m4CD+vW4fQ+xKGO9lrQY2fZR7XMXClSxjb9iOEXJw3IM1PBskHWLvAYgL882MXGLyxpgO31Quf075D8HVUNAMPLX4FAKdR6SG8IbmSWcUTD6m2EqA5JqXZmiDiAN1Pk+vwm9BBzwZpSRygZX4pNgwOtHA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772642045; c=relaxed/simple; bh=b6+1peiRHC3vDnpik5fBJ3DxEkBMBZvAFTyVU7yXfi4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aJHJGevMxyXAxjmL3UDhRVqPpsZwhoQy1mwKB43sRk55g3fPAt9mKuhDcHSawzF9UqdA6hMCJBo8eZu+Z81vOTNHcGPYXfKI6tzwgKYUIMNjMGAr6xgOXRnqcitTz4MzN3W7CuoEBdvLsYDp6t7UR50zfUgu8U93CQjsMm5rZGc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=HOqTWAxS; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="HOqTWAxS" Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id D129440E0198; Wed, 4 Mar 2026 16:33:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id d1VlbSUplkqO; Wed, 4 Mar 2026 16:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1772642030; bh=NFs/9JUpMDDdTv+kovpwx9z/o6qU6eBzJc32VTfjL6A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HOqTWAxSkneg+d65git62Tvt9EPy1zw7C3aD2oIRJrG/KUYo/XPWsZUMv+jAoSYNb YpIk0eA2BE/fg8pwgG0RRmHafufgnsRdhnZa9R0LdJtbw3m/wAFevA1JdYF56dgh1u +Ur9ex5zwBFYOtDB77H1bccQY3ADGGJOZliFg+11u96At96swR+ifiYQ2//zx6iQBX A4AIQAMNkcMy9s3pS/jPQHXERyFJWAArU8D0hJvcMjpDg+rr5WocFnQa3tdB8PoBtZ P5sIPe2r2pzH/FO9lEjCEd2WJfwRxLwCcusVNwO5Z54ZhmgzP8qLOub/hWivmJkh2S 0yV64KF7pI/fBOr13yRxt1QKo8ifrHjqreJMMjrNmuTFYLsC7vNJB8UPruuxTPA35o zGwhyVN076WHNsWLXv2m58vfTxmqfYcMevxTJaibRX8K9IC41zRX79XBc/YpA7888i prllGVS4M7MuZkeQsyH0B8Knbt2Z/5hqUIfdZsZbhCr2G2GV9FP4vW1uXTDUJIoGLA sWRwUma6MlXbpZM4gILMeow/MsKqCg9Q0E9kGwsc1VU2taaVUcFKTAXT8vm8YQudtE mZGlHHWPpQAH1GicIQUsjv3djKJFkj3s2rFtMtFhuIww0qqVNqhS+ZdeyJ8i5psptM 989kyiWOV2vWmVdGUkKTvx2Q= Received: from zn.tnic (pd9530d5e.dip0.t-ipconnect.de [217.83.13.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with UTF8SMTPSA id BD0D240E016B; Wed, 4 Mar 2026 16:33:42 +0000 (UTC) Date: Wed, 4 Mar 2026 17:33:35 +0100 From: Borislav Petkov To: "Chang S. Bae" Cc: "Kaplan, David" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "dave.hansen@linux.intel.com" , "peterz@infradead.org" Subject: Re: [PATCH 1/7] stop_machine: Introduce stop_machine_nmi() Message-ID: <20260304163335.GDaahe3wdnqxSC2yfw@fat_crate.local> References: <20260125014224.249901-1-chang.seok.bae@intel.com> <20260125014224.249901-2-chang.seok.bae@intel.com> <20260127154948.GLaXjenHeJ7Ay6OFJ5@fat_crate.local> <20260127204957.GMaXkk9WRLzn89WP-n@fat_crate.local> <20260128163556.GOaXo67MJ43kCRs68m@fat_crate.local> <20260129121729.GRaXtP2aeWkQKegxC2@fat_crate.local> <20260202105411.GVaYCCUygtEUNrMUtG@fat_crate.local> <80c16fe8-471a-4e31-987c-15d377f8f165@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <80c16fe8-471a-4e31-987c-15d377f8f165@intel.com> On Thu, Feb 05, 2026 at 06:14:39PM -0800, Chang S. Bae wrote: > On 2/2/2026 2:54 AM, Borislav Petkov wrote: > ... > > @@ -174,8 +174,26 @@ struct multi_stop_data { > > enum multi_stop_state state; > > atomic_t thread_ack; > > + > > + bool use_nmi; > > + > > + /* > > + * cpumasks of CPUs on which to raise an NMI; used in the NMI > > + * stomp_machine variant. nmi_cpus_done is used for tracking > > + * when the NMI handler has executed successfully. > > + */ > > + struct cpumask nmi_cpus; > > + struct cpumask nmi_cpus_done; > > + > > +}; > > Looks like every stop_machine variant then will spend stack for these masks. > It seems they could be cpumask_var_t. I guess... > Alternatively, to make it simple further, a per-CPU variable could achieve > this if I understand correctly: > > struct stop_machine_nmi_ctrl { > ... > bool done; > } The first mask - nmi_cpus guards from the NMI handler running again. The second one checks whether all CPUs ran the NMI handler. I guess simply checking whether the nmi_cpus mask is *not* empty, would tell us that too so we probably are fine with a single mask only. > I don't know whether that was an intentional design choice or not. But, at > least the NMI variant might have a slight different semantic in this regard. This current behavior doesn't make a whole lot of sense to me - at least from what I'm reading. I think it is clearly better if the caller gets told when some NMI handler failed instead of overwriting an error val. But maybe we'll fix that while we're at it. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette