From patchwork Sun Jul 10 18:25:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luck, Tony" X-Patchwork-Id: 12912620 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 5E676CCA481 for ; Sun, 10 Jul 2022 18:25:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbiGJSZ3 (ORCPT ); Sun, 10 Jul 2022 14:25:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbiGJSZ2 (ORCPT ); Sun, 10 Jul 2022 14:25:28 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0B0713D1C; Sun, 10 Jul 2022 11:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657477527; x=1689013527; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2ag19OIdVMzRzdhqat/O5TJVp4xTWh8Hj62iiQEx2/c=; b=cbQwHZ8si09JjTfPBhF4Slfgx7b28ygGKx9WlhvcamgaG51Td5o0E/Gh I6c+OjyFpBOL55hbeXtledBzQrjAqAGao9t+qmDGKjYs+G2XE2uxB4OcL aLJNPWsEAIRLARZ54CrBi2GgpAzbYJugWKRcDpOJlHkgSdLXOvk+d95em tSvd6E2ANTblHEgZmEt5OPKtWZ3gx5B5TeVHc41Mk9wWd8ixliP5UZVOe hC4tMFLne1agDhXFa4slx+Sg50vQwIM+thBM89s/lh2EqdC5Kt8Al9kQ4 Fwd6D3AN3ZKJE6KXHvb3uYyNjWCK/jtblFBJ2O8EfqlnN74YKX1pcdW+4 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10404"; a="282081437" X-IronPort-AV: E=Sophos;i="5.92,261,1650956400"; d="scan'208";a="282081437" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2022 11:25:26 -0700 X-IronPort-AV: E=Sophos;i="5.92,261,1650956400"; d="scan'208";a="736864829" Received: from agluck-desk3.sc.intel.com ([172.25.222.78]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2022 11:25:26 -0700 From: Tony Luck To: Hans de Goede Cc: Greg KH , "Joseph, Jithu" , markgross@kernel.org, ashok.raj@intel.com, ravi.v.shankar@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH 1/2] Documentation: Correct IFS reload documentation Date: Sun, 10 Jul 2022 11:25:20 -0700 Message-Id: <20220710182521.60642-2-tony.luck@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220710182521.60642-1-tony.luck@intel.com> References: <20220710182521.60642-1-tony.luck@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org From: Jithu Joseph The location where the scan image is stored is incorrect in the current documentation. Fix this. Fixes: 34604d289167("Documentation: In-Field Scan") Signed-off-by: Jithu Joseph Signed-off-by: Tony Luck --- drivers/platform/x86/intel/ifs/ifs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index 73c8e91cf144..622a246b62cb 100644 --- a/drivers/platform/x86/intel/ifs/ifs.h +++ b/drivers/platform/x86/intel/ifs/ifs.h @@ -39,7 +39,7 @@ * # echo 1 > /sys/devices/virtual/misc/intel_ifs_0/reload * * Similar to microcode, the current version of the scan tests is stored - * in a fixed location: /lib/firmware/intel/ifs.0/family-model-stepping.scan + * in a fixed location: /lib/firmware/intel/ifs/family-model-stepping.scan * * Running tests * ------------- From patchwork Sun Jul 10 18:25:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luck, Tony" X-Patchwork-Id: 12912619 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 1BE64C43334 for ; Sun, 10 Jul 2022 18:25:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229567AbiGJSZ2 (ORCPT ); Sun, 10 Jul 2022 14:25:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbiGJSZ1 (ORCPT ); Sun, 10 Jul 2022 14:25:27 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25C5E13D23; Sun, 10 Jul 2022 11:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657477527; x=1689013527; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5y4vwrb2+7xCrIUmxJiHnlCdSDFJBBSO+45IgJpkgxw=; b=SnCcaYNosi8C9jmW+x3AgC6Z7bkeBtHscb504TDuBN518qPkDTMgq3MT UIM6p6wdeihWc/3JNllZJRE2RiIteKsHe1NEa3QmiI/vbt1hUqRlhG6a8 Dt5DY/KCNaj5tTT55w3xyW0a2iKUnUEFV428TsbFe/cQMOwd41HOF+Ebh d8R8af7QbxVJ5K01NDG/54+0yvJyFukhce8NZkjm0kg/ju+N4GclYQX49 roNL3sKSMgzMscp/TtWAiKmK0BBifeGVIKhVApAXVDMMBQ/vP82NCXFQU G6e4wNV2wMROPTGHiWEF+6dzxR3lglx0l/GqWDsCRzkEHappv5/eUNSQv g==; X-IronPort-AV: E=McAfee;i="6400,9594,10404"; a="282081438" X-IronPort-AV: E=Sophos;i="5.92,261,1650956400"; d="scan'208";a="282081438" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2022 11:25:26 -0700 X-IronPort-AV: E=Sophos;i="5.92,261,1650956400"; d="scan'208";a="736864833" Received: from agluck-desk3.sc.intel.com ([172.25.222.78]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2022 11:25:26 -0700 From: Tony Luck To: Hans de Goede Cc: Greg KH , "Joseph, Jithu" , markgross@kernel.org, ashok.raj@intel.com, ravi.v.shankar@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH 2/2] platform/x86/intel/ifs: return error on load failure Date: Sun, 10 Jul 2022 11:25:21 -0700 Message-Id: <20220710182521.60642-3-tony.luck@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220710182521.60642-1-tony.luck@intel.com> References: <20220710182521.60642-1-tony.luck@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org From: Jithu Joseph A bug in ifs_load_firmware() error path will make it return SUCCESS in the event of failure. If ifs_image_sanity_check() fails, then "ret" is still zero (from the earlier successful call to request_firmware_direct(). Reinitialize the return variable with appropriate error code. Fixes: 684ec215706d4 ("platform/x86/intel/ifs: Authenticate and copy to secured memory") Signed-off-by: Jithu Joseph Signed-off-by: Tony Luck --- drivers/platform/x86/intel/ifs/load.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c index d056617ddc85..3edcc570f1fe 100644 --- a/drivers/platform/x86/intel/ifs/load.c +++ b/drivers/platform/x86/intel/ifs/load.c @@ -252,6 +252,7 @@ void ifs_load_firmware(struct device *dev) if (!ifs_image_sanity_check(dev, (struct microcode_header_intel *)fw->data)) { dev_err(dev, "ifs header sanity check failed\n"); + ret = -EINVAL; goto release; }