From: Jithu Joseph <jithu.joseph@intel.com>
To: hdegoede@redhat.com, markgross@kernel.org
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
rostedt@goodmis.org, jithu.joseph@intel.com, ashok.raj@intel.com,
tony.luck@intel.com, linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org, patches@lists.linux.dev,
ravi.v.shankar@intel.com, pengfei.xu@intel.com,
ilpo.jarvinen@linux.intel.com
Subject: [PATCH v3 2/9] platform/x86/intel/ifs: Refactor image loading code
Date: Fri, 29 Sep 2023 13:24:29 -0700 [thread overview]
Message-ID: <20230929202436.2850388-3-jithu.joseph@intel.com> (raw)
In-Reply-To: <20230929202436.2850388-1-jithu.joseph@intel.com>
IFS image loading flow is slightly different for newer IFS generations.
In preparation for adding support for newer IFS generations, refactor
portions of existing image loading code for reuse.
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tested-by: Pengfei Xu <pengfei.xu@intel.com>
---
drivers/platform/x86/intel/ifs/load.c | 31 ++++++++++++++++-----------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c
index cefd0d886cfd..851c97cc6a6b 100644
--- a/drivers/platform/x86/intel/ifs/load.c
+++ b/drivers/platform/x86/intel/ifs/load.c
@@ -80,6 +80,23 @@ static struct metadata_header *find_meta_data(void *ucode, unsigned int meta_typ
return NULL;
}
+static void hashcopy_err_message(struct device *dev, u32 err_code)
+{
+ if (err_code >= ARRAY_SIZE(scan_hash_status))
+ dev_err(dev, "invalid error code 0x%x for hash copy\n", err_code);
+ else
+ dev_err(dev, "Hash copy error : %s\n", scan_hash_status[err_code]);
+}
+
+static void auth_err_message(struct device *dev, u32 err_code)
+{
+ if (err_code >= ARRAY_SIZE(scan_authentication_status))
+ dev_err(dev, "invalid error code 0x%x for authentication\n", err_code);
+ else
+ dev_err(dev, "Chunk authentication error : %s\n",
+ scan_authentication_status[err_code]);
+}
+
/*
* To copy scan hashes and authenticate test chunks, the initiating cpu must point
* to the EDX:EAX to the test image in linear address.
@@ -109,11 +126,7 @@ static void copy_hashes_authenticate_chunks(struct work_struct *work)
if (!hashes_status.valid) {
ifsd->loading_error = true;
- if (err_code >= ARRAY_SIZE(scan_hash_status)) {
- dev_err(dev, "invalid error code 0x%x for hash copy\n", err_code);
- goto done;
- }
- dev_err(dev, "Hash copy error : %s", scan_hash_status[err_code]);
+ hashcopy_err_message(dev, err_code);
goto done;
}
@@ -133,13 +146,7 @@ static void copy_hashes_authenticate_chunks(struct work_struct *work)
if (err_code) {
ifsd->loading_error = true;
- if (err_code >= ARRAY_SIZE(scan_authentication_status)) {
- dev_err(dev,
- "invalid error code 0x%x for authentication\n", err_code);
- goto done;
- }
- dev_err(dev, "Chunk authentication error %s\n",
- scan_authentication_status[err_code]);
+ auth_err_message(dev, err_code);
goto done;
}
}
--
2.25.1
next prev parent reply other threads:[~2023-09-29 20:45 UTC|newest]
Thread overview: 93+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-13 18:33 [PATCH 00/10] IFS support for GNR and SRF Jithu Joseph
2023-09-13 18:33 ` [PATCH 01/10] platform/x86/intel/ifs: Store IFS generation number Jithu Joseph
2023-09-15 16:22 ` Ilpo Järvinen
2023-09-15 17:12 ` Joseph, Jithu
2023-09-13 18:33 ` [PATCH 02/10] platform/x86/intel/ifs: Refactor image loading code Jithu Joseph
2023-09-13 18:33 ` [PATCH 03/10] platform/x86/intel/ifs: Image loading for new generations Jithu Joseph
2023-09-15 16:46 ` Ilpo Järvinen
2023-09-15 17:20 ` Joseph, Jithu
2023-09-18 8:49 ` Ilpo Järvinen
2023-09-18 15:25 ` Luck, Tony
2023-09-18 15:46 ` Ilpo Järvinen
2023-09-18 16:09 ` Luck, Tony
2023-09-18 16:29 ` Ilpo Järvinen
2023-09-18 16:51 ` Joseph, Jithu
2023-09-18 16:58 ` Dave Hansen
2023-09-18 17:45 ` Joseph, Jithu
2023-09-13 18:33 ` [PATCH 04/10] platform/x86/intel/ifs: Scan test " Jithu Joseph
2023-09-15 16:51 ` Ilpo Järvinen
2023-09-15 20:10 ` Joseph, Jithu
2023-09-19 7:44 ` Ilpo Järvinen
2023-09-19 16:22 ` Joseph, Jithu
2023-09-13 18:33 ` [PATCH 05/10] trace: platform/x86/intel/ifs: Modify scan trace Jithu Joseph
2023-09-13 18:33 ` [PATCH 06/10] platform/x86/intel/ifs: Validate image size Jithu Joseph
2023-09-15 16:57 ` Ilpo Järvinen
2023-09-15 18:06 ` Joseph, Jithu
2023-09-13 18:33 ` [PATCH 07/10] platform/x86/intel/ifs: Metadata validation for start_chunk Jithu Joseph
2023-09-15 16:59 ` Ilpo Järvinen
2023-09-15 18:07 ` Joseph, Jithu
2023-09-13 18:33 ` [PATCH 08/10] platform/x86/intel/ifs: Add new CPU support Jithu Joseph
2023-09-13 18:33 ` [PATCH 09/10] platform/x86/intel/ifs: Add new error code Jithu Joseph
2023-09-13 18:33 ` [PATCH 10/10] platform/x86/intel/ifs: ARRAY BIST for Sierra Forest Jithu Joseph
2023-09-15 17:04 ` Ilpo Järvinen
2023-09-15 20:13 ` Joseph, Jithu
2023-09-18 12:32 ` [PATCH 00/10] IFS support for GNR and SRF Hans de Goede
2023-09-18 16:53 ` Joseph, Jithu
2023-09-22 23:25 ` [PATCH v2 0/9] " Jithu Joseph
2023-09-22 23:25 ` [PATCH v2 1/9] platform/x86/intel/ifs: Store IFS generation number Jithu Joseph
2023-09-25 15:08 ` Ilpo Järvinen
2023-09-22 23:25 ` [PATCH v2 2/9] platform/x86/intel/ifs: Refactor image loading code Jithu Joseph
2023-09-25 15:20 ` Ilpo Järvinen
2023-09-22 23:26 ` [PATCH v2 3/9] platform/x86/intel/ifs: Gen2 scan image loading Jithu Joseph
2023-09-25 15:23 ` Ilpo Järvinen
2023-09-22 23:26 ` [PATCH v2 4/9] platform/x86/intel/ifs: Gen2 Scan test support Jithu Joseph
2023-09-25 15:39 ` Ilpo Järvinen
2023-09-25 16:08 ` Joseph, Jithu
2023-09-26 10:20 ` Ilpo Järvinen
2023-09-26 23:26 ` Joseph, Jithu
2023-09-22 23:26 ` [PATCH v2 5/9] platform/x86/intel/ifs: Validate image size Jithu Joseph
2023-09-25 15:43 ` Ilpo Järvinen
2023-09-25 18:24 ` Joseph, Jithu
2023-09-22 23:26 ` [PATCH v2 6/9] platform/x86/intel/ifs: Metadata validation for start_chunk Jithu Joseph
2023-09-25 15:45 ` Ilpo Järvinen
2023-09-25 18:25 ` Joseph, Jithu
2023-09-22 23:26 ` [PATCH v2 7/9] platform/x86/intel/ifs: Add new CPU support Jithu Joseph
2023-09-25 15:51 ` Ilpo Järvinen
2023-09-22 23:26 ` [PATCH v2 8/9] platform/x86/intel/ifs: Add new error code Jithu Joseph
2023-09-25 15:51 ` Ilpo Järvinen
2023-09-22 23:26 ` [PATCH v2 9/9] platform/x86/intel/ifs: ARRAY BIST for Sierra Forest Jithu Joseph
2023-09-29 20:24 ` [PATCH v3 0/9] IFS support for GNR and SRF Jithu Joseph
2023-09-29 20:24 ` [PATCH v3 1/9] platform/x86/intel/ifs: Store IFS generation number Jithu Joseph
2023-09-29 20:24 ` Jithu Joseph [this message]
2023-09-29 20:24 ` [PATCH v3 3/9] platform/x86/intel/ifs: Gen2 scan image loading Jithu Joseph
2023-09-29 20:24 ` [PATCH v3 4/9] platform/x86/intel/ifs: Gen2 Scan test support Jithu Joseph
2023-10-02 11:45 ` Ilpo Järvinen
2023-09-29 20:24 ` [PATCH v3 5/9] platform/x86/intel/ifs: Validate image size Jithu Joseph
2023-10-02 11:45 ` Ilpo Järvinen
2023-10-02 11:50 ` Ilpo Järvinen
2023-10-02 22:56 ` Joseph, Jithu
2023-10-04 18:56 ` Jithu Joseph
2023-09-29 20:24 ` [PATCH v3 6/9] platform/x86/intel/ifs: Metadata validation for start_chunk Jithu Joseph
2023-10-02 11:47 ` Ilpo Järvinen
2023-10-02 22:58 ` Joseph, Jithu
2023-10-04 19:00 ` Jithu Joseph
2023-09-29 20:24 ` [PATCH v3 7/9] platform/x86/intel/ifs: Add new CPU support Jithu Joseph
2023-09-29 20:24 ` [PATCH v3 8/9] platform/x86/intel/ifs: Add new error code Jithu Joseph
2023-09-29 20:24 ` [PATCH v3 9/9] platform/x86/intel/ifs: ARRAY BIST for Sierra Forest Jithu Joseph
2023-10-02 11:59 ` Ilpo Järvinen
2023-10-02 23:01 ` Joseph, Jithu
2023-10-04 19:04 ` Jithu Joseph
2023-10-04 18:57 ` [PATCH v3 0/9] IFS support for GNR and SRF Joseph, Jithu
2023-10-05 10:51 ` Ilpo Järvinen
2023-10-05 19:57 ` Joseph, Jithu
2023-10-05 19:51 ` [PATCH v4 " Jithu Joseph
2023-10-05 19:51 ` [PATCH v4 1/9] platform/x86/intel/ifs: Store IFS generation number Jithu Joseph
2023-10-05 19:51 ` [PATCH v4 2/9] platform/x86/intel/ifs: Refactor image loading code Jithu Joseph
2023-10-05 19:51 ` [PATCH v4 3/9] platform/x86/intel/ifs: Gen2 scan image loading Jithu Joseph
2023-10-05 19:51 ` [PATCH v4 4/9] platform/x86/intel/ifs: Gen2 Scan test support Jithu Joseph
2023-10-05 19:51 ` [PATCH v4 5/9] platform/x86/intel/ifs: Validate image size Jithu Joseph
2023-10-05 19:51 ` [PATCH v4 6/9] platform/x86/intel/ifs: Metadata validation for start_chunk Jithu Joseph
2023-10-05 19:51 ` [PATCH v4 7/9] platform/x86/intel/ifs: Add new CPU support Jithu Joseph
2023-10-05 19:51 ` [PATCH v4 8/9] platform/x86/intel/ifs: Add new error code Jithu Joseph
2023-10-05 19:51 ` [PATCH v4 9/9] platform/x86/intel/ifs: ARRAY BIST for Sierra Forest Jithu Joseph
2023-10-06 10:30 ` Ilpo Järvinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230929202436.2850388-3-jithu.joseph@intel.com \
--to=jithu.joseph@intel.com \
--cc=ashok.raj@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=hpa@zytor.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=mingo@redhat.com \
--cc=patches@lists.linux.dev \
--cc=pengfei.xu@intel.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=ravi.v.shankar@intel.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).