Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3813843ioa; Tue, 26 Apr 2022 10:15:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtExGJci22zx7WYzswQ2cH4EsZmPAjUb1cRQSdUTlVs2aXe4Pmfm+PjA4i/8qjz+m0+bHr X-Received: by 2002:a17:90b:1b4f:b0:1d2:9e7b:9161 with SMTP id nv15-20020a17090b1b4f00b001d29e7b9161mr38644238pjb.87.1650993342600; Tue, 26 Apr 2022 10:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650993342; cv=none; d=google.com; s=arc-20160816; b=v6AMFWoky9YDoC0Y4/3zgzWl5Y9y+xD45gkwhg38nye9+v0nfuHhRVW9Q6mSQRINht vKzAqmLQwJ2jwaWR2ai8Uq3E1V5g+AiH2iCCKnoNLnqXqlfaIadGg6iwGo9fqQm5qOsT xAbGfYEgA4CSRjwgzdB8uVtuZZX0T6DmwaYNHKOe4NidrFEAf8Yw+taWXU4ZoU3UY/La ZkhcKRiNj9uzXSv2CFPqL64zAftfhffqY0tFfCL+lJ5YQXcw1PrdsW+K0AOmyE6xPNtp /7BozVgRdU+AH2/mMnLLf2FkTVhSYvqZ+QywtOx4TMNdqp2PhF3Ydv6NxrOfn47RHHio p2ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2ie4L5dGGWiSHsGw0o2h47x43U0Nqtz8xO9/nab5sGY=; b=PInJjMYqti8CKy2hNaDuUyJTES9yFZL8G7w3mZdb/ETzrA5srOmZv8k57fECnI//VG yQowx6HaSQ2ZH2A5RMsy2RWYWT8RovdP/NU6iV8SfgX2E6namzM+CZUC/py+XozTj2VI ZBTZfImsyWkDTA3497gvM69DOf/J46uD07dHvdhfHfvDv2IyntqrXl2/pLVkS9vy4NfU sP2YJDvAt1ocqYmJ0FMQ6kuI8ijKVuRPWEOdpv4CGnLOMfki5npprmKKEoUZkD7FX7aw q/4g0juSk2TqaTFmC9+WiN9ghuqIdOoMMF9907VaHuxNoDvolEAScz+DyGUiBi7ZUWq0 U6yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Id742V0x; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020a170902f54f00b00158aac8cd3asi12120594plf.351.2022.04.26.10.15.21; Tue, 26 Apr 2022 10:15:42 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=Id742V0x; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349468AbiDZKu0 (ORCPT + 99 others); Tue, 26 Apr 2022 06:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349200AbiDZKtc (ORCPT ); Tue, 26 Apr 2022 06:49:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA0F21147; Tue, 26 Apr 2022 03:45:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 403F86173A; Tue, 26 Apr 2022 10:45:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2258C385A0; Tue, 26 Apr 2022 10:45:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650969943; bh=6gWdf0sx4XE9f8S+pDU7h2Xqd2fTzJnBt5BeFM/9wH4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Id742V0xJ5l8zl5zUJpQ8HtxX0VBqF1DX1/YfNeEYETApb64r5/RilRtxqLgpNUyU oMHglFdtTjG6oJO35TMkCUAeWKv6rYkUMuqG/eF6/WRbn0vE4VPfn8STq5FPuaOiYK ezuml9uttCHTwOml/BHl8+e9pVYnTfQNf2FkxtAY= Date: Tue, 26 Apr 2022 12:45:40 +0200 From: Greg KH To: Tony Luck Cc: hdegoede@redhat.com, markgross@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, corbet@lwn.net, andriy.shevchenko@linux.intel.com, jithu.joseph@intel.com, ashok.raj@intel.com, rostedt@goodmis.org, dan.j.williams@intel.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com Subject: Re: [PATCH v4 04/10] platform/x86/intel/ifs: Read IFS firmware image Message-ID: References: <20220419163859.2228874-1-tony.luck@intel.com> <20220422200219.2843823-1-tony.luck@intel.com> <20220422200219.2843823-5-tony.luck@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220422200219.2843823-5-tony.luck@intel.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Fri, Apr 22, 2022 at 01:02:13PM -0700, Tony Luck wrote: > From: Jithu Joseph > > Driver probe routine allocates structure to communicate status > and parameters between functions in the driver. Also call > load_ifs_binary() to load the scan image file. > > There is a separate scan image file for each processor family, > model, stepping combination. This is read from the static path: > > /lib/firmware/intel/ifs/{ff-mm-ss}.scan > > Step 1 in loading is to generate the correct path and use > request_firmware_direct() to load into memory. > > Subsequent patches will use the IFS MSR interfaces to copy > the image to BIOS reserved memory and validate the SHA256 > checksums. > > Signed-off-by: Jithu Joseph > Co-developed-by: Tony Luck > Signed-off-by: Tony Luck > --- > drivers/platform/x86/intel/ifs/Makefile | 2 +- > drivers/platform/x86/intel/ifs/core.c | 36 ++++++++++++++++++++++++- > drivers/platform/x86/intel/ifs/ifs.h | 25 +++++++++++++++++ > drivers/platform/x86/intel/ifs/load.c | 28 +++++++++++++++++++ > 4 files changed, 89 insertions(+), 2 deletions(-) > create mode 100644 drivers/platform/x86/intel/ifs/ifs.h > create mode 100644 drivers/platform/x86/intel/ifs/load.c > > diff --git a/drivers/platform/x86/intel/ifs/Makefile b/drivers/platform/x86/intel/ifs/Makefile > index af904880e959..98b6fde15689 100644 > --- a/drivers/platform/x86/intel/ifs/Makefile > +++ b/drivers/platform/x86/intel/ifs/Makefile > @@ -1,3 +1,3 @@ > obj-$(CONFIG_INTEL_IFS) += intel_ifs.o > > -intel_ifs-objs := core.o > +intel_ifs-objs := core.o load.o > diff --git a/drivers/platform/x86/intel/ifs/core.c b/drivers/platform/x86/intel/ifs/core.c > index 5713e6ee90f0..ed4ded6755b2 100644 > --- a/drivers/platform/x86/intel/ifs/core.c > +++ b/drivers/platform/x86/intel/ifs/core.c > @@ -6,6 +6,8 @@ > > #include > > +#include "ifs.h" > + > enum test_types { > IFS_SAF, > }; > @@ -20,10 +22,27 @@ static const struct x86_cpu_id ifs_cpu_ids[] __initconst = { > }; > MODULE_DEVICE_TABLE(x86cpu, ifs_cpu_ids); > > +static struct ifs_device ifs_devices[] = { > + [IFS_SAF] = { > + .data = { > + .integrity_cap_bit = MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT, > + }, > + .misc = { > + .name = "intel_ifs_0", > + .nodename = "intel_ifs/0", > + .minor = MISC_DYNAMIC_MINOR, > + }, > + }, > +}; > + > +#define IFS_NUMTESTS ARRAY_SIZE(ifs_devices) Cute way to do this, but I don't see you ever have any more devices added to this list in this series. Did I miss them? If not, why all the overhead and complexity involved here for just a single misc device? thanks, greg k-h