Skip to content

Commit

Permalink
UPSTREAM: x86,bugs: Unconditionally allow spectre_v2=retpoline,amd
Browse files Browse the repository at this point in the history
commit f8a66d6 upstream.

Currently Linux prevents usage of retpoline,amd on !AMD hardware, this
is unfriendly and gets in the way of testing. Remove this restriction.

Bug: 215557547
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/r/20211026120310.487348118@infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9f683ceb14f75bb1c5ede1b75ea7a446e2bcd5f6
  • Loading branch information
Peter Zijlstra authored and gregkh committed Mar 14, 2022
1 parent f27f62f commit 414a607
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions arch/x86/kernel/cpu/bugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,13 +845,6 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
return SPECTRE_V2_CMD_AUTO;
}

if (cmd == SPECTRE_V2_CMD_RETPOLINE_AMD &&
boot_cpu_data.x86_vendor != X86_VENDOR_HYGON &&
boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
pr_err("retpoline,amd selected but CPU is not AMD. Switching to AUTO select\n");
return SPECTRE_V2_CMD_AUTO;
}

spec_v2_print_cond(mitigation_options[i].option,
mitigation_options[i].secure);
return cmd;
Expand Down

0 comments on commit 414a607

Please sign in to comment.