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 13298C004D4 for ; Wed, 24 Aug 2022 19:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240042AbiHXTw6 (ORCPT ); Wed, 24 Aug 2022 15:52:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240023AbiHXTwx (ORCPT ); Wed, 24 Aug 2022 15:52:53 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 205F37C1ED for ; Wed, 24 Aug 2022 12:52:52 -0700 (PDT) Received: from zn.tnic (p200300ea971b9859329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:971b:9859:329c:23ff:fea6:a903]) (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 B07E71EC0589; Wed, 24 Aug 2022 21:52:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1661370766; 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=BtEcTTWjMFEaUqD228VC0UPcOadpBLGiKkdNaczS59k=; b=oVoGpaAAioid6YbmUXFy9PXW64G8haJN5bdizKUltPO8qJ+Px14QwwJsfjE6fc9ttncOer efzc8E0FaHiF1NjkhGd8LSq0d5QiUGTph/RpT+1dYKfWlyCiwbWTecYDLjowtCWgAoxWcP wm1faKB39FcJ8wdGh5UWT9/TBCjfT4I= Date: Wed, 24 Aug 2022 21:52:42 +0200 From: Borislav Petkov To: Ashok Raj Cc: Thomas Gleixner , Tony Luck , Dave Hansen , LKML Mailing List , X86-kernel , Andy Lutomirski , Tom Lendacky , Jacon Jun Pan Subject: Re: [PATCH v3 2/5] x86/microcode/intel: Allow a late-load only if a min rev is specified Message-ID: References: <20220817051127.3323755-1-ashok.raj@intel.com> <20220817051127.3323755-3-ashok.raj@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 23, 2022 at 12:08:27AM +0000, Ashok Raj wrote: > Correct, but print_err parameter is 0 when called from scan_microcode() and 1 > when called from generic_load_microcode(). Well, scan_microcode() gets called from save_microcode_in_initrd() which is fs_initcall and if we had to be really precise, print_err being 0 there is wrong. Because at fs_initcall time we can very well print error messages. But that print_err thing is an old relic so will have to get fixed some other day. > We do min_rev enforcement only when print_err is set. That's wrong - you need to do min_rev enforcement only when you're loading microcode late. I.e., to paste from my previous mail: "So you'd have to pass down the fact that you're doing late loading from request_microcode_fw(). Now, I'm staring at that ugly refresh_fw bool arg in that function and I *think* I did it 10 years ago because it shouldn't try to load from the fs when it is resuming because there might not be a fs yet... or something to that effect. tglx might have a better idea how to check we're in the ->starting notifier..." IOW, we're going to have to do something like ->request_microcode_fw(, ... late_loading=true) and I wanted to reuse that refresh_fw arg instead of adding another one... HTH. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette