Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5092425rwb; Tue, 17 Jan 2023 09:05:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXvvlAd2d/pSGhxrCyuKc3S5juRXgJh1G0btPXDmNKXlOxGOOdD33JI54vn0jTeE7/DEXHuL X-Received: by 2002:a17:906:3cf:b0:78d:f455:3118 with SMTP id c15-20020a17090603cf00b0078df4553118mr3517557eja.64.1673975149813; Tue, 17 Jan 2023 09:05:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673975149; cv=none; d=google.com; s=arc-20160816; b=A8pYBIsfOLp4v8KndtRF/wtG/C5vTi+xzGjkv3HcL9cd77aI4LnIa4OU7XLaEq5t/g PrT8YcC1nA311Go8HkP4b4JkLMBHnsRjl9GntRTdXMBq4GTiH0UC7EtuTmzha01M9wSd IKHz0Jy854DZ3miPVxkNp3mOhY0aER5ArdrUnNTgjxTEyvk9hvsOYyXpP0jxTYUgHYWB mc0Lz/RNdMDRKEErhcsSwNCxZ9zAERwwerP/zAuiSk1n0n6X5U6qwrgSykbcAyfiTT9a oApmxT8AqBfIfFdpRkzExHQZ0ux2CzxslI+9snjxFiUcFz4uZZ6JbqNNvKQ987ycPubH xVCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=moaQevFhl1AWVQQkWWVch5fhSTMrOjpdYS/1sHWc34o=; b=avwnI/9T5slGiIurgHw4PH6cebJdcRESmKzmYWh2biNDtD608CEw+KOue7gJtijHg6 x2ap+gnmUQAHMenQ3plezOUZsxmPvdw3PQNvPXJpFfJccZrM/hw+vCu+N/uFeya3nUA3 76o7v3gstt3HwsAQrxz5h94YbCiO9vuq4cnw41RnXEVTZs2rfpGyXrrgg5lGDgpgkOCQ fKv+5DytT6+FGsZvh4kwhzn5Mc7Upc9Air7ZEjVwzg2/y/ExVpnWxj56WJL0IhVZ7zBW dIxgkCUn5XRjYrZOpBIC5zCNGupqWpPpBbUf9taBpBsWY638Iqhhu+hEwgXyBmyzdY7Q xzHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="A/8x6Y1S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a05640227c700b00488852e1250si15974484ede.254.2023.01.17.09.05.38; Tue, 17 Jan 2023 09:05:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="A/8x6Y1S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbjAQQ3Z (ORCPT + 48 others); Tue, 17 Jan 2023 11:29:25 -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 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 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.