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 34A23C46467 for ; Thu, 19 Jan 2023 22:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229635AbjASWM1 (ORCPT ); Thu, 19 Jan 2023 17:12:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230076AbjASWLO (ORCPT ); Thu, 19 Jan 2023 17:11:14 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B93CA57AC for ; Thu, 19 Jan 2023 13:48:32 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1674164910; 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=VsSF7KWIbHynqYrF26mD07CtF4vjiv4FfxR14nRaxz4=; b=zFG177w86kGq1oQNDqcU1jN1HxoC3tlcpBxcpDiKQJcx4LLrnBcjXqSCfS09S9oC9K8qYl hQIhvv9hxH6ZyyST6OKceUgeffGQmeYyc5bqBgEPzdooUNSvSxj5j7XXo66IKNUNPPZ3RR haWtyfyffSO6mvkzinmtrV60YdUOY/5Fxkoi4aGjxSxiFTXgAzB+fkBmkzO4ABkNkA3EfP yEPWGcmIVyQJGsETuthNC1ffHDTCXic+/IsBFu50X6PMyRPz31YuBpl9b8km/6QQNv3TBZ 3dVc/K6vSKaqC5cnjjlMVBKiqna5aGEO+lfbz/DEaeJ+HysMWFo4ZAoSk8VFMw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1674164910; 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=VsSF7KWIbHynqYrF26mD07CtF4vjiv4FfxR14nRaxz4=; b=v96ZlMumHcq9QNUOU38faR0IqywOVckBTw4bXRH6nT2Gz+/A4gZcn6wlhfmimBddsI7y+I tYZVW3+1zatVKtDQ== To: Ashok Raj , Borislav Petkov Cc: Ashok Raj , Tony Luck , LKML , x86 , Ingo Molnar , Dave Hansen , Alison Schofield , Reinette Chatre , Tom Lendacky , Stefan Talpalaru , David Woodhouse , Benjamin Herrenschmidt , Jonathan Corbet , "Rafael J . Wysocki" , Peter Zilstra , Andy Lutomirski , Andrew Cooper Subject: Re: [PATCH v1 Part2 1/5] x86/microcode: Move late load warning to the same function that taints kernel In-Reply-To: <20230113172920.113612-2-ashok.raj@intel.com> References: <20230113172920.113612-1-ashok.raj@intel.com> <20230113172920.113612-2-ashok.raj@intel.com> Date: Thu, 19 Jan 2023 22:48:30 +0100 Message-ID: <875yd2i4b5.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 13 2023 at 09:29, Ashok Raj wrote: > Currently the warning about late loading and tainting are issued from two > different functions. > > Later patches will re-enable microcode late-loading. > > Having both messages in the same function helps issuing warnings only > when required. > > Move the warning from microcode_reload_late() -> reload_store() where the > kernel tainting also happens. > > No functional change. I had to read this more than once to make sense of it. Let me try a translation: Late microcode loading issues a warning and taints the kernel. Tainting the kernel and emitting the warning happens in two different functions. The upcoming support for safe late loading under certain conditions needs to prevent both the warning and the tainting when the safe conditions are met. That would require to hand the result of the safe condition check into the function which emits the warning. To avoid this awkward construct, move the warning into reload_store() next to the taint() invocation as that is also the function which will later contain the safe condition check. No functional change. Did my decoder get that right? Thanks, tglx