Re: [PATCH v4 16/36] x86/bugs: Restructure srso mitigation

From: Josh Poimboeuf
Date: Thu Apr 10 2025 - 13:41:24 EST


On Mon, Mar 10, 2025 at 11:40:03AM -0500, David Kaplan wrote:
> @@ -229,6 +226,8 @@ void __init cpu_select_mitigations(void)
> taa_update_mitigation();
> mmio_update_mitigation();
> rfds_update_mitigation();
> + /* srso_update_mitigation() relies on retbleed_mitigation. */
> + srso_update_mitigation();

"relies on" -> "depends on" for consistency with the other comments.
Also it's "retbleed_update_mitigation". Also needs parentheses:

/* srso_update_mitigation() depends on retbleed_update_mitigation() */

> + switch (srso_mitigation) {
> + case SRSO_MITIGATION_SAFE_RET:
> + if (!IS_ENABLED(CONFIG_MITIGATION_SRSO))
> pr_err("WARNING: kernel not compiled with MITIGATION_SRSO.\n");

srso_mitigation should be reset to NONE here?

> - } else {
> - pr_err("WARNING: kernel not compiled with MITIGATION_IBPB_ENTRY.\n");

Same here.

--
Josh