amd64 wakeup: recalculate mitigations after APICs are woken

APICs are needed to broadcast IPIs for MSR writes.

PR:	270489
Reviewed by:	dchagin, emaste, jhb
Tested by:	dchagin, manu
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39302
This commit is contained in:
Konstantin Belousov 2023-03-29 02:51:44 +03:00
parent 4dc3b1fa1b
commit cd137909c3

View file

@ -294,19 +294,21 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result,
* in acpi_sleep_machdep(), after the microcode was
* reloaded. Then recalculate the active mitigation
* knobs that depend on the microcode and
* cpu_stdext_feature3.
* cpu_stdext_feature3. Do it after LAPICs are woken,
* so that IPIs work.
*/
identify_cpu_ext_features();
hw_ibrs_recalculate(true);
hw_ssb_recalculate(true);
amd64_syscall_ret_flush_l1d_recalc();
x86_rngds_mitg_recalculate(true);
mca_resume();
if (vmm_resume_p != NULL)
vmm_resume_p();
intr_resume(/*suspend_cancelled*/false);
hw_ibrs_recalculate(true);
amd64_syscall_ret_flush_l1d_recalc();
hw_ssb_recalculate(true);
x86_rngds_mitg_recalculate(true);
AcpiSetFirmwareWakingVector(0, 0);
} else {
/* Wakeup MD procedures in interrupt enabled context */