Files
Centos-kernel-stream-10/drivers/firmware
CKI KWF Bot 783a1cd993 Merge: Backport upstream solution to isolate EFI Runtime Services to a CPU [RHEL-10.x]
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/2581

JIRA: https://redhat.atlassian.net/browse/RHEL-175660

Most EFI Runtime Services will require the execution of hardware-specific,
highly privileged code without interference from the Operating System. That is
usually achieved on X86_64 via SMI/SMM and on ARM64 via SMC/EL3. Obviously the
implementations of the base idea vary widely and are heavily dependent on the
underlying hardware, firmware and BIOS.

The patches from Sebastian Andrzej Siewior[1], backported here, make it
possible to set the CPUMASK for the workqueue that wraps the access to the efI
callbacks. In order to set a CPU or group of CPUs to serve the EFI Runtime
requests, one simply writes the desired CPUMASK to

        /sys/devices/virtual/workqueue/efi_runtime/cpumask

The effect of this MR is different for x86_64 and ARM64:

- ARM64: an EFI Runtime Service request will generate a SMC (Secure Monitor
  Call) that will trap into EL3 (Exception Level 3) where the specific request
  will be handled. On ARM64 the SMC calls are usually isolated to the CPU serving
  the request, making it possible to use ideas such as Sebastian Siewior's
  proposal[1] to select a CPU or set of CPUs to serve EFI Runtime requests,
  making it possible to keep the remaining CPUs free from that noise.

- X86_64: EFI Runtime Service requests will trigger SMI (System Management Interrupt)
  that will force the CPU to switch into SMM (System Management Mode) to execute the
  specific request. The effect of a SMI in the system is heavily dependent on the
  actual Hardware, firmware and BIOS implementations. Modern systems provide BIOS
  presets (with names such as "Telco" or "Low Latency") that along with other
  settings, isolate SMI effects to a single CPU or to a socket. In our earlier
  experiences, some of these extra settings unfortunately may induce other sources
  of latency, so caution and experimentation is advised. In any case, for most
  systems the effects of an SMI (which may come from EFI Runtime Services execution)
  are system wide, causing latency spikes on all CPUs. That said, the gains from
  Sebastian's proposal[1] for X86_64 may vary.

[1] https://lore.kernel.org/linux-rt-devel/20260227170103.4042157-1-bigeasy@linutronix.de/

Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>

Approved-by: Mark Langsdorf <mlangsdo@redhat.com>
Approved-by: Crystal Wood <crwood@redhat.com>
Approved-by: Phil Auld <pauld@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>

Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2026-07-25 01:07:18 +00:00
..