From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64214C433EF for ; Tue, 1 Feb 2022 10:56:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237040AbiBAK4Y (ORCPT ); Tue, 1 Feb 2022 05:56:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237019AbiBAK4R (ORCPT ); Tue, 1 Feb 2022 05:56:17 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0AEDC061714; Tue, 1 Feb 2022 02:56:17 -0800 (PST) Received: from zn.tnic (dslb-088-067-221-104.088.067.pools.vodafone-ip.de [88.67.221.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id EB4FE1EC04AD; Tue, 1 Feb 2022 11:56:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1643712972; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=46aTMocMoAPOjkzOyW549Rg/pu0OxKnDcuckgk6b6E0=; b=KX/7ShJt2YcMVtPaBZxAu52wRHUwNWk17MoeOKO7euO4o8CkggePNJzOO556ySLF708u6Q ek2Kk9Kla3IO2X/9qJMSEn8YNcOw9E3qBggMCKUULGsqesAxEslwNFmLExPajRAnYksDsr wW31SFVfgnyYqCxCpopoHnWWK+gaHfU= Date: Tue, 1 Feb 2022 11:56:08 +0100 From: Borislav Petkov To: David Woodhouse Cc: Tom Lendacky , Thomas Gleixner , Sean Christopherson , Ingo Molnar , Dave Hansen , "x86@kernel.org" , "H . Peter Anvin" , Paolo Bonzini , "Paul E . McKenney" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "rcu@vger.kernel.org" , "mimoja@mimoja.de" , "hewenliang4@huawei.com" , "hushiyuan@huawei.com" , "luolongjun@huawei.com" , "hejingxian@huawei.com" , Joerg Roedel , Andrew Cooper Subject: Re: [PATCH v3 6/9] x86/smpboot: Support parallel startup of secondary CPUs Message-ID: References: <20211215145633.5238-1-dwmw2@infradead.org> <20211215145633.5238-7-dwmw2@infradead.org> <3d8e2d0d-1830-48fb-bc2d-995099f39ef0@amd.com> <330bedfee12022c1180d8752fb4abe908dac08d1.camel@infradead.org> <3bc401a9f110a24a429316371c767507b493025a.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3bc401a9f110a24a429316371c767507b493025a.camel@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 01, 2022 at 10:25:01AM +0000, David Woodhouse wrote: > Thanks. It looks like that is only invoked after boot, with a write to > /sys/devices/system/cpu/microcode/reload. > > My series is only parallelising the initial bringup at boot time, so it > shouldn't make any difference. No, I don't mean __reload_late() - I pointed you at that function to show the dance we must do when updating microcode late. The load_ucode_{ap,bsp}() routines are what is called when loading ucode early. So the question is, does the parallelizing change the order in which APs are brought up and can it happen that a SMT sibling of a two-SMT core executes *something* while the other SMT sibling is updating microcode. If so, that would be bad. > However... it does look like there's nothing preventing a sibling being > brought online *while* the dance you mention above is occurring. Bottom line is: of the two SMT siblings, one needs to be updating microcode while the other is idle. I.e., what __reload_late() does. > Shouldn't __reload_late() take the device_hotplug_lock to prevent that? See reload_store(). -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette