Commit 05bd639
committed
KVM: VMX: Disable L1TF L1 data cache flush if CONFIG_CPU_MITIGATIONS=n
Disable support for flushing the L1 data cache to mitigate L1TF if CPU
mitigations are disabled for the entire kernel. KVM's mitigation of L1TF
is in no way special enough to justify ignoring CONFIG_CPU_MITIGATIONS=n.
Deliberately use CPU_MITIGATIONS instead of the more precise
MITIGATION_L1TF, as MITIGATION_L1TF only controls the default behavior,
i.e. CONFIG_MITIGATION_L1TF=n doesn't completely disable L1TF mitigations
in the kernel.
Keep the vmentry_l1d_flush module param to avoid breaking existing setups,
and leverage the .set path to alert the user to the fact that
vmentry_l1d_flush will be ignored. Don't bother validating the incoming
value; if an admin misconfigures vmentry_l1d_flush, the fact that the bad
configuration won't be detected when running with CONFIG_CPU_MITIGATIONS=n
is likely the least of their worries.
Reviewed-by: Brendan Jackman <jackmanb@google.com>
Link: https://patch.msgid.link/20251113233746.1703361-9-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent 0abd961 commit 05bd639
2 files changed
+46
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
| |||
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
228 | | - | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
302 | 303 | | |
303 | 304 | | |
304 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
305 | 316 | | |
306 | 317 | | |
307 | 318 | | |
| |||
349 | 360 | | |
350 | 361 | | |
351 | 362 | | |
352 | | - | |
| 363 | + | |
353 | 364 | | |
354 | 365 | | |
355 | 366 | | |
| |||
376 | 387 | | |
377 | 388 | | |
378 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
379 | 393 | | |
380 | 394 | | |
381 | 395 | | |
| |||
433 | 447 | | |
434 | 448 | | |
435 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
436 | 475 | | |
437 | 476 | | |
438 | 477 | | |
| |||
7323 | 7362 | | |
7324 | 7363 | | |
7325 | 7364 | | |
7326 | | - | |
7327 | | - | |
| 7365 | + | |
7328 | 7366 | | |
7329 | 7367 | | |
7330 | 7368 | | |
| |||
8696 | 8734 | | |
8697 | 8735 | | |
8698 | 8736 | | |
8699 | | - | |
8700 | | - | |
8701 | | - | |
8702 | | - | |
8703 | | - | |
8704 | | - | |
8705 | | - | |
8706 | | - | |
| 8737 | + | |
| 8738 | + | |
8707 | 8739 | | |
8708 | 8740 | | |
8709 | 8741 | | |
| |||
0 commit comments