From: kernel test robot <lkp@intel.com>
To: Kim Phillips <kim.phillips@amd.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
linux-coco@lists.linux.dev, x86@kernel.org
Cc: oe-kbuild-all@lists.linux.dev,
Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
K Prateek Nayak <kprateek.nayak@amd.com>,
Nikunj A Dadhania <nikunj@amd.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
Michael Roth <michael.roth@amd.com>,
Borislav Petkov <borislav.petkov@amd.com>,
Naveen Rao <naveen.rao@amd.com>,
David Kaplan <david.kaplan@amd.com>,
Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
Kim Phillips <kim.phillips@amd.com>,
stable@kernel.org
Subject: Re: [PATCH v2 1/3] cpu/bugs: Allow forcing Automatic IBRS with SNP enabled using spectre_v2=eibrs
Date: Thu, 12 Mar 2026 11:41:27 +0800 [thread overview]
Message-ID: <202603121136.bc8zNsHS-lkp@intel.com> (raw)
In-Reply-To: <20260311130611.2201214-2-kim.phillips@amd.com>
Hi Kim,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 7726ce2287804e70b2bf2fc00f104530b603d3f3]
url: https://github.com/intel-lab-lkp/linux/commits/Kim-Phillips/cpu-bugs-Allow-forcing-Automatic-IBRS-with-SNP-enabled-using-spectre_v2-eibrs/20260311-211730
base: 7726ce2287804e70b2bf2fc00f104530b603d3f3
patch link: https://lore.kernel.org/r/20260311130611.2201214-2-kim.phillips%40amd.com
patch subject: [PATCH v2 1/3] cpu/bugs: Allow forcing Automatic IBRS with SNP enabled using spectre_v2=eibrs
config: x86_64-randconfig-101-20260312 (https://download.01.org/0day-ci/archive/20260312/202603121136.bc8zNsHS-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603121136.bc8zNsHS-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> arch/x86/kernel/cpu/bugs.c:2190:42-44: WARNING !A || A && B is equivalent to !A || B
vim +2190 arch/x86/kernel/cpu/bugs.c
2122
2123 static void __init spectre_v2_select_mitigation(void)
2124 {
2125 if ((spectre_v2_cmd == SPECTRE_V2_CMD_RETPOLINE ||
2126 spectre_v2_cmd == SPECTRE_V2_CMD_RETPOLINE_LFENCE ||
2127 spectre_v2_cmd == SPECTRE_V2_CMD_RETPOLINE_GENERIC ||
2128 spectre_v2_cmd == SPECTRE_V2_CMD_EIBRS_LFENCE ||
2129 spectre_v2_cmd == SPECTRE_V2_CMD_EIBRS_RETPOLINE) &&
2130 !IS_ENABLED(CONFIG_MITIGATION_RETPOLINE)) {
2131 pr_err("RETPOLINE selected but not compiled in. Switching to AUTO select\n");
2132 spectre_v2_cmd = SPECTRE_V2_CMD_AUTO;
2133 }
2134
2135 if ((spectre_v2_cmd == SPECTRE_V2_CMD_EIBRS ||
2136 spectre_v2_cmd == SPECTRE_V2_CMD_EIBRS_LFENCE ||
2137 spectre_v2_cmd == SPECTRE_V2_CMD_EIBRS_RETPOLINE) &&
2138 !boot_cpu_has(X86_FEATURE_IBRS_ENHANCED)) {
2139 pr_err("EIBRS selected but CPU doesn't have Enhanced or Automatic IBRS. Switching to AUTO select\n");
2140 spectre_v2_cmd = SPECTRE_V2_CMD_AUTO;
2141 }
2142
2143 if ((spectre_v2_cmd == SPECTRE_V2_CMD_RETPOLINE_LFENCE ||
2144 spectre_v2_cmd == SPECTRE_V2_CMD_EIBRS_LFENCE) &&
2145 !boot_cpu_has(X86_FEATURE_LFENCE_RDTSC)) {
2146 pr_err("LFENCE selected, but CPU doesn't have a serializing LFENCE. Switching to AUTO select\n");
2147 spectre_v2_cmd = SPECTRE_V2_CMD_AUTO;
2148 }
2149
2150 if (spectre_v2_cmd == SPECTRE_V2_CMD_IBRS && !IS_ENABLED(CONFIG_MITIGATION_IBRS_ENTRY)) {
2151 pr_err("IBRS selected but not compiled in. Switching to AUTO select\n");
2152 spectre_v2_cmd = SPECTRE_V2_CMD_AUTO;
2153 }
2154
2155 if (spectre_v2_cmd == SPECTRE_V2_CMD_IBRS && boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) {
2156 pr_err("IBRS selected but not Intel CPU. Switching to AUTO select\n");
2157 spectre_v2_cmd = SPECTRE_V2_CMD_AUTO;
2158 }
2159
2160 if (spectre_v2_cmd == SPECTRE_V2_CMD_IBRS && !boot_cpu_has(X86_FEATURE_IBRS)) {
2161 pr_err("IBRS selected but CPU doesn't have IBRS. Switching to AUTO select\n");
2162 spectre_v2_cmd = SPECTRE_V2_CMD_AUTO;
2163 }
2164
2165 if (spectre_v2_cmd == SPECTRE_V2_CMD_IBRS && cpu_feature_enabled(X86_FEATURE_XENPV)) {
2166 pr_err("IBRS selected but running as XenPV guest. Switching to AUTO select\n");
2167 spectre_v2_cmd = SPECTRE_V2_CMD_AUTO;
2168 }
2169
2170 if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V2)) {
2171 spectre_v2_cmd = SPECTRE_V2_CMD_NONE;
2172 return;
2173 }
2174
2175 switch (spectre_v2_cmd) {
2176 case SPECTRE_V2_CMD_NONE:
2177 return;
2178
2179 case SPECTRE_V2_CMD_AUTO:
2180 if (!should_mitigate_vuln(X86_BUG_SPECTRE_V2))
2181 break;
2182 fallthrough;
2183 case SPECTRE_V2_CMD_FORCE:
2184 /*
2185 * Unless forced, don't use AutoIBRS when SNP is enabled
2186 * because it degrades host userspace indirect branch performance.
2187 */
2188 if (boot_cpu_has(X86_FEATURE_IBRS_ENHANCED) &&
2189 (!boot_cpu_has(X86_FEATURE_SEV_SNP) ||
> 2190 (boot_cpu_has(X86_FEATURE_SEV_SNP) &&
2191 spectre_v2_cmd == SPECTRE_V2_CMD_FORCE))) {
2192 spectre_v2_enabled = SPECTRE_V2_EIBRS;
2193 break;
2194 }
2195
2196 spectre_v2_enabled = spectre_v2_select_retpoline();
2197 break;
2198
2199 case SPECTRE_V2_CMD_RETPOLINE_LFENCE:
2200 pr_err(SPECTRE_V2_LFENCE_MSG);
2201 spectre_v2_enabled = SPECTRE_V2_LFENCE;
2202 break;
2203
2204 case SPECTRE_V2_CMD_RETPOLINE_GENERIC:
2205 spectre_v2_enabled = SPECTRE_V2_RETPOLINE;
2206 break;
2207
2208 case SPECTRE_V2_CMD_RETPOLINE:
2209 spectre_v2_enabled = spectre_v2_select_retpoline();
2210 break;
2211
2212 case SPECTRE_V2_CMD_IBRS:
2213 spectre_v2_enabled = SPECTRE_V2_IBRS;
2214 break;
2215
2216 case SPECTRE_V2_CMD_EIBRS:
2217 spectre_v2_enabled = SPECTRE_V2_EIBRS;
2218 break;
2219
2220 case SPECTRE_V2_CMD_EIBRS_LFENCE:
2221 spectre_v2_enabled = SPECTRE_V2_EIBRS_LFENCE;
2222 break;
2223
2224 case SPECTRE_V2_CMD_EIBRS_RETPOLINE:
2225 spectre_v2_enabled = SPECTRE_V2_EIBRS_RETPOLINE;
2226 break;
2227 }
2228 }
2229
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2026-03-12 3:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 13:06 [PATCH v2 0/3] KVM: SEV: Add support for BTB Isolation Kim Phillips
2026-03-11 13:06 ` [PATCH v2 1/3] cpu/bugs: Allow forcing Automatic IBRS with SNP enabled using spectre_v2=eibrs Kim Phillips
2026-03-12 3:41 ` kernel test robot [this message]
2026-03-13 20:04 ` Pawan Gupta
2026-03-11 13:06 ` [PATCH v2 2/3] cpu/bugs: Allow spectre_v2=ibrs on x86 vendors other than Intel Kim Phillips
2026-03-11 13:06 ` [PATCH v2 3/3] KVM: SEV: Add support for SNP BTB Isolation Kim Phillips
2026-03-11 14:15 ` Sean Christopherson
2026-03-13 16:50 ` Tom Lendacky
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=202603121136.bc8zNsHS-lkp@intel.com \
--to=lkp@intel.com \
--cc=borislav.petkov@amd.com \
--cc=david.kaplan@amd.com \
--cc=kim.phillips@amd.com \
--cc=kprateek.nayak@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=naveen.rao@amd.com \
--cc=nikunj@amd.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=stable@kernel.org \
--cc=thomas.lendacky@amd.com \
--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 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.