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 C2476C6379F for ; Tue, 17 Jan 2023 16:29:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229765AbjAQQ30 (ORCPT ); Tue, 17 Jan 2023 11:29:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230064AbjAQQ3W (ORCPT ); Tue, 17 Jan 2023 11:29:22 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42C6218173 for ; Tue, 17 Jan 2023 08:29:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673972962; x=1705508962; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=J25ZO4Fo+CyEJQWifu6vL4gf36afFOMMlBdBWdwNLd4=; b=A/8x6Y1STH0WOkopHf/w7L6me7GnGgcmz2FI4DHp9KCAfHMasuYLnoLB mjNpQW+pxtbv6OxR/eXW4MPeeIPZuP+yTKWx0nmW2MN8EwOEwKMWQgCkx kucv1AI33xmjZVPks4gfSwRNxp30S2DKOem6O4vFWJX5yFQ3Y0J1u1/4X kq+qPFHTx7CyOzXQ3BrfPZeD8QEAI2qJVcIYca3k+nBzNGvFaZ4+rDk27 +9+dbIHUHZoG3/ud04iH0AeltH1EyWSC9Geni4cJcAHxksjlQy1V4gKL9 nICGQEgHYaaQsdINS6apoPWuLB512Sm78B487jkIqGqldnlUKCU7qbKKz w==; X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="410978100" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="410978100" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 08:29:21 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="833230990" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="833230990" Received: from youli-mobl1.amr.corp.intel.com (HELO [10.255.228.205]) ([10.255.228.205]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 08:29:21 -0800 Message-ID: Date: Tue, 17 Jan 2023 08:29:28 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v4 6/6] x86/microcode/intel: Print when early microcode loading fails Content-Language: en-US To: Ashok Raj , Borislav Petkov Cc: Thomas Gleixner , X86-kernel , LKML Mailing List , Tony Luck , Ingo Molnar , alison.schofield@intel.com, reinette.chatre@intel.com, Tom Lendacky References: <20230109153555.4986-1-ashok.raj@intel.com> <20230109153555.4986-7-ashok.raj@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/17/23 08:12, Ashok Raj wrote: > On Sun, Jan 15, 2023 at 08:05:14PM +0100, Borislav Petkov wrote: >> On Mon, Jan 09, 2023 at 07:35:55AM -0800, Ashok Raj wrote: >>> Currently when early microcode loading fails there is no way for the >>> user to know that the update failed. >> Of course there is - there's no early update message in dmesg. > Sorry Boris, didn't comprehend. > > Without user making some additional steps to check the revision in the > default location and the current rev reported to find the update failed. > > Maybe that's what you meant. I think a better changelog might help here. The original was a bit too absolute. There is, as Boris pointed out, a way to tell if a failure occurred. But, that method is a bit unfriendly to our users. -- When early microcode loading succeeds, the kernel prints a message via print_ucode_info() that starts with 'early update:'. If loading fails, apply_microcode_early() returns before that message is printed. This means that users must know to go looking for that message. They can infer a early microcode loading failure if they do not see the message. That's not great for users. Instead of expecting them to infer this, be more explicit about it. Instead of bailing out and returning from apply_microcode_early(), stash the error code off and plumb it down to print_ucode_info(). This ensures that a message of some kind is printed on all early loads: successes *and* failures. This should make it easier for our hapless users to figure out when a failure occurred.