Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2707548rdh; Wed, 27 Sep 2023 10:11:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGresA8BZ+/BgZ0NwXZn9bRisFyiA259FkYYuw7HRl6MPtwR6hyJCMTDsfDPllJAKMzho83 X-Received: by 2002:a05:6a20:8428:b0:15d:c1a8:c329 with SMTP id c40-20020a056a20842800b0015dc1a8c329mr3591655pzd.48.1695834692754; Wed, 27 Sep 2023 10:11:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695834692; cv=none; d=google.com; s=arc-20160816; b=nsMsj4WTlYWzgx9SFWT15fyi+AnjLLtzpKAteWw4VFsTTJfRzZJfFpLyHQcD5OiffG tYYDtY1DCZG+u6KbXQ+j1ZUM1wdTBUtgUJaJnW+LCHYUGv0Lf22iKclr6GnMS8dMeyg5 qs2FVl1rPLQJgrdKFQ64pffx0zxjmVr0W5Sd0p9Fr1Om0BIz/orAWwOc/dqWP/SruhPw 1yKYsLUqjNRg1ePfBlITZ2BKbQOGBq1hQVLfu5WJc0c+7N+xzQQ3O6NvfSQQDKY6rmU1 lYRknenWQwHZUE0gvPGWHEmtBwVjLJ27SjNMm82m02fb66SCA0yCUCZB1TQTGzgfKqbn Gwvg== 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=waqKRIaBA2IqOwcXyBMuzMAn22MXqhmh7ug3E5Ctzaw=; fh=GAw9pbIAZIwCH32PQjszcv6fk+98j3/7OwMbKqyoAZI=; b=fmX9a3sN/yFQIlCmRMS/mVLrlVbBulrft8/D7Xs85ijL6HKgbZH0EG4aQlFG/Bgcvt pjoBkU+3NDmV9KKoBX+QlW9Jee5KaenVyqOvDfOyiNkVNNVNhay0MHeZitL2XD7DVFts BicYqedPOayhNE0Mn7rZO9gPEplhbVIMFu4egpCYb/sDrSGFtWHc6h+STVrrBf08EVeo U7UuCq/FOWUPZIGNkw0Yjy3jQUhWLa5eXLJacd3RvZQMNHDDL1uFU/NGgA20QeqcAvjS 5HRRNLhew6+OtVRdeHFF2Dytpz9HjMu+7OTm46ptBjxyy9S+O2Mm5qhWHM0WFsHJCrnM Rt9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=Cled2b+O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id x24-20020a056a000bd800b00690d42e3347si14627661pfu.157.2023.09.27.10.11.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 10:11:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=Cled2b+O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id C1CB3834AF6F; Wed, 27 Sep 2023 04:28:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231515AbjI0L2d (ORCPT + 99 others); Wed, 27 Sep 2023 07:28:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231552AbjI0L2J (ORCPT ); Wed, 27 Sep 2023 07:28:09 -0400 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0F981B3 for ; Wed, 27 Sep 2023 04:28:07 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 4926540E014B; Wed, 27 Sep 2023 11:28: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 LyA6T7BOW5AX; Wed, 27 Sep 2023 11:28:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1695814083; bh=waqKRIaBA2IqOwcXyBMuzMAn22MXqhmh7ug3E5Ctzaw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Cled2b+OOqq3GTxypoZkDAw4aFQ2ghE11Db278QNa9O6EU3tz0z/+uAeD/83if8Kq 0J0jbQbetKyGo7hbzXV8PH1ZTaoUlbPFmdUMU5+yyJl9m8BhU6fGtpjJ01+ysN04zb kTeytL8TKgHk4vdK8W8izx5erFmmrvNuOlqgD+Hk0UCf+JTRnN1STg9HKIAYJW38u6 oSB6qgVQ0FkcoKUSiFtXcxaQzkF/mMoSvCLj51Ru51XmVvaFabLEhE669nPCKplTdK 8SR0JdFirxS5Shb+yM28gP1kqYc9HGtUauJ4PThruYQ5i+DzGPr53hVZMhlDVNdE/Z vTH2Z3SI6iR2Bih4YOog+MJr3IX8qH648HY2+dp6dFY/AmJPw2vjxvckElE3wNosCb a99G/nHQicyr6LFLBHCcVz/YQvCzmaGqYj02MnXdng4ibKc9dMfyG2pI+CPyIs5lyO cDPEJFKgEZXqnwgyEb8hyranniDuk96IFVcZPr9r8OYcmmO/mycg5uN6M2F0vpF+12 E+p75KP8rroKEfbwqlEI0a+T6unl++E8A54BLg5SEFOAp+pTP8zRNaf1DQtQPPBnlg KEN53XiVw1ypHEp0s5Z9HiwfxGYVDEVHffqvVpQFbcIqX/zht/4CDDn+Cehkzndl2P cfsrf0cYU/ThFaZ3ic363z2I= Received: from nazgul.tnic (unknown [2.247.249.105]) (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 1CCBA40E0198; Wed, 27 Sep 2023 11:27:57 +0000 (UTC) Date: Wed, 27 Sep 2023 13:28:00 +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 21/30] x86/microcode: Add per CPU result state Message-ID: <20230927112800.GBZRQRwFUWs0bKTP7Q@fat_crate.local> References: <20230912065249.695681286@linutronix.de> <20230912065502.082789879@linutronix.de> <20230924062934.GLZQ/XThoM7jsrjmrt@fat_crate.local> <87sf71fgia.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87sf71fgia.ffs@tglx> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 27 Sep 2023 04:28:39 -0700 (PDT) On Tue, Sep 26, 2023 at 11:09:01AM +0200, Thomas Gleixner wrote: > That starts to get silly. The struct is used only in the microcode realm > and nothing which is globally visible. ucode is a pretty obvious and > established shortcut. But so what.... Ok, which prefix do you propose? "microcode_", "ucode_"? And I chose "microcode_" a while back and planned on converting stuff gradually when touching the code and not do solely a renaming patch. All I'm saying is, we should be consistent. > > You could do > > > > static DEFINE_PER_CPU(struct microcode_ctrl, ucode_ctrl); > > > > so that the naming is different too. > > And that solves what? I find it somewhat confusing when the variable name is called the same name as the struct and I try to have the struct names be more expressive than the variables of the same type. But not a big deal. > > No need for "ucode_" prefixes to static functions. > > What's the problem with that prefix? The function name clearly says what > this is doing. Giving proper prefixes only to the externally visible functions is, I think, a nice way of showing what is what. The static, internally used symbols, OTOH, don't need a prefix and when you look at the name, you know immediately whether it is a static symbol or an externally visible and potentially used by other things. We do that already for other code, like global variables, for example. > Nope, because stop_machine_cpuslocked() does not usefully accumulate > results from all involved CPUs. But it can return errors related to the > invocation itself, which is a completely different story. Ah, I see what you mean: " * RETURNS: * -ENOENT if @fn(@arg) was not executed at all because all cpus in * @cpumask were offline; otherwise, 0 if all executions of @fn * returned 0, any non zero return value if any returned non zero." So we have to return 0 here. Oh well. > That's why ucode_ctrl.result is per CPU and has to be evaluated > separately. Right. > >> + /* Analyze the results */ > >> + for_each_cpu_and(cpu, cpu_present_mask, &cpus_booted_once_mask) { > >> + switch (per_cpu(ucode_ctrl.result, cpu)) { > >> + case UCODE_UPDATED: updated++; break; > >> + case UCODE_TIMEOUT: timedout++; break; > >> + case UCODE_OK: siblings++; break; > >> + default: failed++; break; > >> + } > > > > Align vertically. > > Align what? switch (per_cpu(ucode_ctrl.result, cpu)) { case UCODE_UPDATED: updated++; break; case UCODE_TIMEOUT: timedout++; break; case UCODE_OK: siblings++; break; default: failed++; break; But meh, it's ok either way. > and setup_cpus() then tells what? See above. I think there's a merit in distinguishing the symbol scope based on the naming only but I'm sure you have an opinion... :-) -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette