From: Jithu Joseph <jithu.joseph@intel.com>
To: ilpo.jarvinen@linux.intel.com, hdegoede@redhat.com, markgross@kernel.org
Cc: linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org, jithu.joseph@intel.com,
ashok.raj@intel.com, tony.luck@intel.com, rostedt@goodmis.org,
sathyanarayanan.kuppuswamy@intel.com, ravi.v.shankar@intel.com,
patches@lists.linux.dev
Subject: [PATCH 3/3] platform/x86/intel/ifs: Disable irq during one load stage
Date: Fri, 12 Apr 2024 10:23:49 -0700 [thread overview]
Message-ID: <20240412172349.544064-4-jithu.joseph@intel.com> (raw)
In-Reply-To: <20240412172349.544064-1-jithu.joseph@intel.com>
One of the stages in IFS image loading process involves loading individual
chunks (test patterns) from test image file to secure memory.
Driver issues a WRMSR(MSR_AUTHENTICATE_AND_COPY_CHUNK) operation to do
this. This operation can take up to 5 msec, and if an interrupt occurs
in between, the AUTH_AND_COPY_CHUNK u-code implementation aborts the
operation.
Interrupt sources such as NMI or SMI are handled by retrying. Regular
interrupts may occur frequently enough to prevent this operation from ever
completing. Disable irq on local cpu around the aforementioned WRMSR to
allow the operation to complete.
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Ashok Raj <ashok.raj@intel.com>
---
drivers/platform/x86/intel/ifs/load.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c
index 584c44387e10..39f19cb51749 100644
--- a/drivers/platform/x86/intel/ifs/load.c
+++ b/drivers/platform/x86/intel/ifs/load.c
@@ -233,7 +233,9 @@ static int copy_hashes_authenticate_chunks_gen2(struct device *dev)
chunk_table[0] = starting_chunk_nr + i;
chunk_table[1] = linear_addr;
do {
+ local_irq_disable();
wrmsrl(MSR_AUTHENTICATE_AND_COPY_CHUNK, (u64)chunk_table);
+ local_irq_enable();
rdmsrl(MSR_CHUNKS_AUTHENTICATION_STATUS, chunk_status.data);
err_code = chunk_status.error_code;
} while (err_code == AUTH_INTERRUPTED_ERROR && --retry_count);
--
2.25.1
next prev parent reply other threads:[~2024-04-12 17:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 17:23 [PATCH 0/3] Miscelleanous In Field Scan changes Jithu Joseph
2024-04-12 17:23 ` [PATCH 1/3] platform/x86/intel/ifs: Classify error scenarios correctly Jithu Joseph
2024-04-12 18:32 ` Kuppuswamy Sathyanarayanan
2024-04-12 19:31 ` Joseph, Jithu
2024-04-12 20:46 ` Kuppuswamy Sathyanarayanan
2024-04-15 15:10 ` Hans de Goede
2024-04-12 17:23 ` [PATCH 2/3] platform/x86/intel/ifs: trace: display batch num in hex Jithu Joseph
2024-04-12 18:45 ` Kuppuswamy, Sathyanarayanan
2024-04-12 17:23 ` Jithu Joseph [this message]
2024-04-12 19:13 ` [PATCH 3/3] platform/x86/intel/ifs: Disable irq during one load stage Kuppuswamy Sathyanarayanan
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=20240412172349.544064-4-jithu.joseph@intel.com \
--to=jithu.joseph@intel.com \
--cc=ashok.raj@intel.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=patches@lists.linux.dev \
--cc=platform-driver-x86@vger.kernel.org \
--cc=ravi.v.shankar@intel.com \
--cc=rostedt@goodmis.org \
--cc=sathyanarayanan.kuppuswamy@intel.com \
--cc=tony.luck@intel.com \
/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