Warn before it is attempted and taint the kernel. Late loading microcode can lead to malfunction of the kernel when the microcode update changes behaviour. There is no way for the kernel to determine whether its safe or not.
Unified · Split
| @@ -493,6 +493,9 @@ static int microcode_reload_late(void) · 492 unmodified lines | |||
| 493 | { | 493 | { |
| 494 | int ret; | 494 | int ret; |
| 495 | 495 | ||
| 496 | pr_err("Attempting late microcode loading - it is dangerous and taints the kernel.\n"); | ||
| 497 | pr_err("You should switch to early loading, if possible.\n"); | ||
| 498 | |||
| 496 | atomic_set(&late_cpus_in, 0); | 499 | atomic_set(&late_cpus_in, 0); |
| 497 | atomic_set(&late_cpus_out, 0); | 500 | atomic_set(&late_cpus_out, 0); |
| 498 | 501 | ||
| @@ -541,6 +544,8 @@ put: · 42 unmodified lines | |||
| 541 | if (ret == 0) | 544 | if (ret == 0) |
| 542 | ret = size; | 545 | ret = size; |
| 543 | 546 | ||
| 547 | add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK); | ||
| 548 | |||
| 544 | return ret; | 549 | return ret; |
| 545 | } | 550 | } |
| 546 | 551 | ||