Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2749813rdh; Wed, 27 Sep 2023 11:27:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0Ep8XJwHX4tdb3ce2qtgwYZhZwzqHpApg9T+PvFrs3bE6aL+6UYzsmp3J2KnE+v3ZecYv X-Received: by 2002:a17:90b:194f:b0:26b:2538:d717 with SMTP id nk15-20020a17090b194f00b0026b2538d717mr2385519pjb.25.1695839254915; Wed, 27 Sep 2023 11:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695839254; cv=none; d=google.com; s=arc-20160816; b=LshzsuASOKqB6TBhvq+8raRjwIefGTOVwgVrhw5RseJvJdtsqHIVd9UV7HEAYoRQgp fKizK6SPjzowJxo8qYgRTPmn1Y8H3jwEtYE01KSoVH5dm+D+z/EP5KOMNDfPdq3YtoqW AtsbWtqPUxGc5vFGUmTCY7hyqXDFNHkEsHViRmE7Z644T1V08e/cBk5zatBGK/ERTTFi +k/1OLmG/UNre/S1xIM3+cf2Bh5+sQ4STAQHfitj9kbbqOiYPlN+h2/6MNM/78Ohm9Fd HdaINVywnVCNTk0DBuRsdHXtwuKYIlHAe1MSH2K1k6RjitbsZYPWgVlNrqijhZQ07DI2 RICQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Azh0xabHz3PHnv8BJfnWJoxdcZ5ZZG053LrhvG+FvWA=; fh=GAw9pbIAZIwCH32PQjszcv6fk+98j3/7OwMbKqyoAZI=; b=CiQdi2AjEjd84x9CGzbKbqAsl52/gk4xMlLGfZCNCCWS13GoHks3PAy944Dq19trZB C5BjfDmED6QgGr7oGU/I6GEiuT+NTZZb+SfI9LGDBR8nmPBr6nUkaT60DOFP77LmTsjz DQNqHge/Oi9IEManLb/Xwg1IEkVQIZVPYvuhwjYk2VbUhKzC6mLeRpbjrkdbwfbCb+j7 RNmdk6Cu2KEZyVu24vgnOChr/KYLHeoNM57RuxYFQQlGnnW7KVpU28+KPSVElfqCYghS 3tUS/xy4b/3sWaA6Ro/TusgUJ3+0BIXYv4ro/GRgV/qZN4kYwlxW2ettTmORTdOavxE3 0AYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=bAhHTuaV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id w10-20020a17090aea0a00b00278f81e54cdsi3049576pjy.19.2023.09.27.11.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 11:27:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=bAhHTuaV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6104480569AF; Wed, 27 Sep 2023 10:17:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229582AbjI0RRK (ORCPT + 99 others); Wed, 27 Sep 2023 13:17:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbjI0RRI (ORCPT ); Wed, 27 Sep 2023 13:17:08 -0400 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20745F3 for ; Wed, 27 Sep 2023 10:17:07 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 5EFBF40E01A4; Wed, 27 Sep 2023 17:17:05 +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 AnU-c8OR83pl; Wed, 27 Sep 2023 17:17:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1695835020; bh=Azh0xabHz3PHnv8BJfnWJoxdcZ5ZZG053LrhvG+FvWA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bAhHTuaVaC0Y0FmGHboKjv4bRIOsThkPcv7kRDWAjL7napD5NysEsjE6065LHLhXV pcvuhkie9UaX2+IzE+SVcGv/e/V+DngaR+VTOBDHBGHIYTAF9BmoMlh/WwziZ6QUgX PKEw+FitlD7W7SW9oWgCsbDiHsHoUj3KkIH0ZpebpJOT48d65U/HJ4Z530oe7FYOkf hE744oFqdIMp8xN5p0tJ8wYUWfELnzL3SXGgtmLff9EevpClkIucW1NYIcQfr6RBch zNZcG91LoE6Lrses2vhED62Jx9qv2NpHokmluWZYtWWZ0Ca7dyQJAe/e5jo4AM0+Xx 4ltoFPa5FLZx1O2TKPB3NQKmAZ/BO+/qhROaiuKgy71O0O8/0L1ZqAm0KMknLG1qdl SUwMoj9ZChqcWjnGyNo0JF3MzzR6KMd51fbdwafV4TkYa0EQFy4IvfqHc35VGYjUj6 zrq3IBp/a7aGak7WFMTRRwaj8ZBwBtTMQWOEHJI573mtBwmIJeFR1YG4VDR0QEpc5O QZdDp0a44monxJZWW0I8f8uRU3wyQ0Mg0DgmZ8A9SZVOtfleK1jcAUSGTMhxqmCb1C VPfLu3WFj/oKSD78gbpEQfmdnpE/Z6xGyMMZXc0h1cz+AlNv18c+P9ChlUZGy+wWHV 88tnUzcKjLJKKGPMRnk1mZKQ= Received: from nazgul.tnic (cust-west-par-46-193-35-178.cust.wifirst.net [46.193.35.178]) (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 ESMTPSA id 7F79640E00B3; Wed, 27 Sep 2023 17:16:54 +0000 (UTC) Date: Wed, 27 Sep 2023 19:17:13 +0200 From: Borislav Petkov To: Thomas Gleixner Cc: LKML , x86@kernel.org, "Chang S. Bae" , Arjan van de Ven , Nikolay Borisov Subject: Re: [patch V3 25/30] x86/microcode: Rendezvous and load in NMI Message-ID: <20230927171713.GBZRRjmUDQrV9HVxv-@fat_crate.local> References: <20230912065249.695681286@linutronix.de> <20230912065502.327149876@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230912065502.327149876@linutronix.de> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 27 Sep 2023 10:17:18 -0700 (PDT) On Tue, Sep 12, 2023 at 09:58:23AM +0200, Thomas Gleixner wrote: > From: Thomas Gleixner > > stop_machine() does not prevent the spin-waiting sibling from handling an > NMI, which is obviously violating the whole concept of rendezvous. > > Implement a static branch right in the beginning of the NMI handler which > is NOOPed except when enabled by the late loading mechanism. > > The later loader enables the static branch before stop_machine() is s/later/late/ > invoked. Each CPU has an nmi_enable in its control structure which > indicates whether the CPU should go into the update routine. > > This is required to bridge the gap between enabling the branch and actually > being at the point where it makes sense. Huh? "where it makes sense"? > -static int ucode_load_cpus_stopped(void *unused) > +static bool microcode_update_handler(void) > { > unsigned int cpu = smp_processor_id(); > > @@ -430,7 +436,29 @@ static int ucode_load_cpus_stopped(void > else > ucode_load_secondary(cpu); > > - /* No point to wait here. The CPUs will all wait in stop_machine(). */ > + touch_nmi_watchdog(); AFAICT, you're touching the NMI watchdog even in the !use_nmi case. > + return true; > +} -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette