* [PATCH] docs: Add desc for best effort mode of mmio_stale_data
@ 2023-08-30 14:44 Takahiro Itazuri
2023-08-30 14:50 ` Jonathan Corbet
0 siblings, 1 reply; 3+ messages in thread
From: Takahiro Itazuri @ 2023-08-30 14:44 UTC (permalink / raw)
To: linux-doc, linux-kernel
Cc: Jonathan Corbet, Pawan Gupta, Josh Poimboeuf, Peter Zijlstra,
Borislav Petkov, Thomas Gleixner, Takahiro Itazuri,
Takahiro Itazuri
Similar to the sysfs files for mds and tsx_async_abort, that for
mmio_stale_data also provides the best effort mitigation mode which
invokes the mitigation instructions without a guarantee they clear the
CPU buffers to address virtualized scenarios. Adds description for the
mode in the mmio_stale_data's page to make it self-contained.
Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
---
.../hw-vuln/processor_mmio_stale_data.rst | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst b/Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst
index c98fd1190..c1c96eeb8 100644
--- a/Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst
+++ b/Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst
@@ -226,7 +226,7 @@ The possible values in this file are:
- The processor is vulnerable, but no mitigation enabled
* - 'Vulnerable: Clear CPU buffers attempted, no microcode'
- The processor is vulnerable, but microcode is not updated. The
- mitigation is enabled on a best effort basis.
+ mitigation is enabled on a best effort basis. See :ref:`best_effort`.
* - 'Mitigation: Clear CPU buffers'
- The processor is vulnerable and the CPU buffer clearing mitigation is
enabled.
@@ -254,6 +254,23 @@ the above information:
'SMT Host state unknown' Kernel runs in a VM, Host SMT state unknown
======================== ===========================================
+.. _best_effort:
+
+Best effort mitigation mode
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If the processor is vulnerable, but the availability of the microcode-based
+mitigation mechanism is not advertised via CPUID the kernel selects a best
+effort mitigation mode. This mode invokes the mitigation instructions
+without a guarantee that they clear the CPU buffers.
+
+This is done to address virtualization scenarios where the host has the
+microcode update applied, but the hypervisor is not yet updated to expose the
+CPUID to the guest. If the host has updated microcode the protection takes
+effect; otherwise a few CPU cycles are wasted pointlessly.
+
+The state in the mmio_stale_data sysfs file reflects this situation accordingly.
+
References
----------
.. [#f1] Affected Processors
--
2.40.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] docs: Add desc for best effort mode of mmio_stale_data
2023-08-30 14:44 [PATCH] docs: Add desc for best effort mode of mmio_stale_data Takahiro Itazuri
@ 2023-08-30 14:50 ` Jonathan Corbet
2023-08-30 15:11 ` Takahiro Itazuri
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Corbet @ 2023-08-30 14:50 UTC (permalink / raw)
To: Takahiro Itazuri, linux-doc, linux-kernel
Cc: Pawan Gupta, Josh Poimboeuf, Peter Zijlstra, Borislav Petkov,
Thomas Gleixner, Takahiro Itazuri, Takahiro Itazuri
Takahiro Itazuri <itazur@amazon.com> writes:
> Similar to the sysfs files for mds and tsx_async_abort, that for
> mmio_stale_data also provides the best effort mitigation mode which
> invokes the mitigation instructions without a guarantee they clear the
> CPU buffers to address virtualized scenarios. Adds description for the
> mode in the mmio_stale_data's page to make it self-contained.
>
> Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
> ---
> .../hw-vuln/processor_mmio_stale_data.rst | 19 ++++++++++++++++++-
> 1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst b/Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst
> index c98fd1190..c1c96eeb8 100644
> --- a/Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst
> +++ b/Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst
> @@ -226,7 +226,7 @@ The possible values in this file are:
> - The processor is vulnerable, but no mitigation enabled
> * - 'Vulnerable: Clear CPU buffers attempted, no microcode'
> - The processor is vulnerable, but microcode is not updated. The
> - mitigation is enabled on a best effort basis.
> + mitigation is enabled on a best effort basis. See :ref:`best_effort`.
> * - 'Mitigation: Clear CPU buffers'
> - The processor is vulnerable and the CPU buffer clearing mitigation is
> enabled.
> @@ -254,6 +254,23 @@ the above information:
> 'SMT Host state unknown' Kernel runs in a VM, Host SMT state unknown
> ======================== ===========================================
>
> +.. _best_effort:
> +
> +Best effort mitigation mode
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +If the processor is vulnerable, but the availability of the microcode-based
> +mitigation mechanism is not advertised via CPUID the kernel selects a best
> +effort mitigation mode. This mode invokes the mitigation instructions
> +without a guarantee that they clear the CPU buffers.
> +
> +This is done to address virtualization scenarios where the host has the
> +microcode update applied, but the hypervisor is not yet updated to expose the
> +CPUID to the guest. If the host has updated microcode the protection takes
> +effect; otherwise a few CPU cycles are wasted pointlessly.
> +
> +The state in the mmio_stale_data sysfs file reflects this situation accordingly.
> +
So the change seems OK, but why not just describe the "best effort" mode
in the place where you refer to it, rather than creating a forward
reference?
Thanks,
jon
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] docs: Add desc for best effort mode of mmio_stale_data
2023-08-30 14:50 ` Jonathan Corbet
@ 2023-08-30 15:11 ` Takahiro Itazuri
0 siblings, 0 replies; 3+ messages in thread
From: Takahiro Itazuri @ 2023-08-30 15:11 UTC (permalink / raw)
To: linux-doc, linux-kernel, Jonathan Corbet
Cc: Pawan Gupta, Josh Poimboeuf, Peter Zijlstra, Borislav Petkov,
Thomas Gleixner, Takahiro Itazuri, Takahiro Itazuri
Jonathan Corbet <corbet@lwn.net> wrote:
> So the change seems OK, but why not just describe the "best effort" mode
> in the place where you refer to it, rather than creating a forward
> reference?
tbh, I just followed the docs for mds and tsx_async_abort. Of course, I
can do it! Would it better to do the same thing for mds and
tsx_async_abort docs as well?
Best regards,
Takahiro Itazuri
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-30 19:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-30 14:44 [PATCH] docs: Add desc for best effort mode of mmio_stale_data Takahiro Itazuri
2023-08-30 14:50 ` Jonathan Corbet
2023-08-30 15:11 ` Takahiro Itazuri
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.