From: Breno Leitao <leitao@debian.org>
To: mingo@kernel.org
Cc: jpoimboe@kernel.org, tglx@linutronix.de, bp@alien8.de,
x86@kernel.org, linux-kernel@vger.kernel.org,
pawan.kumar.gupta@linux.intel.com
Subject: [PATCH 0/3] x86/bugs: Separate config for mitigations (part 2)
Date: Thu, 18 Jan 2024 09:32:10 -0800 [thread overview]
Message-ID: <20240118173213.2008115-1-leitao@debian.org> (raw)
The current CONFIG_SPECULATION_MITIGATIONS namespace is only
halfway populated, where some mitigations have entries in Kconfig, and
they could be modified, while others mitigations do not have Kconfig entries,
and can not be controlled at build time.
Fine-grained control over these Kconfig entries can help in a number of ways:
1) Users can choose and pick only mitigations that are important for
their workloads.
2) Users and developers can choose to disable mitigations that mangle
the assembly code generation, making it hard to read.
3) Separate Kconfigs for just source code readability,
so that we see *which* butt-ugly piece of crap code is for what
reason...
In most cases, if a mitigation is disabled at compilation time, it
can still be enabled at runtime using kernel command line arguments.
This is the second part of the initial patchset[1] that got half landed.
The first patch did some code re-organization. This second part
contains the exact missing patches from the initial patchset, and
basically adds build-time configuration for the other mitigations that
are currently only disabled at boot time.
Here is a detailed view of each patch:
Patch 1: Create a Kconfig to disable GDS mitigation.
Patch 2: Add a Kconfig entry for each mitigation that doesn't have such
Patch 3: Make spectre v2 userspace mitigation dependent on kernel
mitigations.
With this patch applied, setting CONFIG_SPECULATION_MITIGATIONS=n, a
simple script[2] shows that all the mitigations are disabled:
spectre_v2_user_stibp SPECTRE_V2_USER_NONE
spectre_v2_user_ibpb SPECTRE_V2_USER_NONE
spectre_v2_cmd SPECTRE_V2_CMD_NONE
ssb_mode SPEC_STORE_BYPASS_NONE
l1tf_mitigation L1TF_MITIGATION_OFF
srso_mitigation SRSO_MITIGATION_NONE
srso_cmd SRSO_CMD_SAFE_RET
mds_mitigation MDS_MITIGATION_OFF
taa_mitigation TAA_MITIGATION_OFF
mmio_mitigation MMIO_MITIGATION_OFF
srbds_mitigation SRBDS_MITIGATION_OFF
gds_mitigation GDS_MITIGATION_OFF
spectre_v1_mitigation SPECTRE_V1_MITIGATION_NONE
spectre_v2_enabled SPECTRE_V2_NONE
retbleed_mitigation RETBLEED_MITIGATION_NONE
[1] https://lore.kernel.org/all/ZZ7c9EbJ71zU5TOF@gmail.com/#t
[2] https://github.com/leitao/debug/blob/main/spec/dump_speculation.py
Breno Leitao (3):
x86/bugs: Create a way to disable GDS mitigation
x86/bugs: Add a separate config for missing mitigation
x86/bugs: spectre_v2_user default mode depends on main default
arch/x86/Kconfig | 117 +++++++++++++++++++++++++++++++++++--
arch/x86/kernel/cpu/bugs.c | 57 +++++++++++-------
2 files changed, 147 insertions(+), 27 deletions(-)
--
2.34.1
next reply other threads:[~2024-01-18 17:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-18 17:32 Breno Leitao [this message]
2024-01-18 17:32 ` [PATCH 1/3] x86/bugs: Create a way to disable GDS mitigation Breno Leitao
2024-01-18 17:32 ` [PATCH 2/3] x86/bugs: Add a separate config for missing mitigation Breno Leitao
2024-01-22 20:58 ` Pawan Gupta
2024-01-23 15:05 ` Breno Leitao
2024-01-24 0:06 ` Pawan Gupta
2024-01-18 17:32 ` [PATCH 3/3] x86/bugs: spectre_v2_user default mode depends on main default Breno Leitao
2024-01-23 0:04 ` Pawan Gupta
2024-01-23 15:02 ` Breno Leitao
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=20240118173213.2008115-1-leitao@debian.org \
--to=leitao@debian.org \
--cc=bp@alien8.de \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=tglx@linutronix.de \
--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
all inboxes | Powered by JetHome®