git: ecab307389ee - stable/13 - amd64: do not touch low memory in acpi_wakeup_ap() if booted by UEFI
Konstantin Belousov
kib at FreeBSD.org
Mon Sep 20 00:48:20 UTC 2021
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=ecab307389eed81c7c3dd803954aa97a2bf04305
commit ecab307389eed81c7c3dd803954aa97a2bf04305
Author: Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-09-11 18:19:27 +0000
Commit: Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-09-20 00:47:20 +0000
amd64: do not touch low memory in acpi_wakeup_ap() if booted by UEFI
(cherry picked from commit e99255c8a6cae324aeede7f5013d080a2d361e3f)
---
sys/x86/acpica/acpi_wakeup.c | 40 ++++++++++++++++++++++++++--------------
1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c
index b4bbe660bea4..ef52ccc3aef6 100644
--- a/sys/x86/acpica/acpi_wakeup.c
+++ b/sys/x86/acpica/acpi_wakeup.c
@@ -164,16 +164,22 @@ acpi_wakeup_cpus(struct acpi_softc *sc)
int cpu;
u_char mpbiosreason;
- /* save the current value of the warm-start vector */
- mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF);
- outb(CMOS_REG, BIOS_RESET);
- mpbiosreason = inb(CMOS_DATA);
-
- /* setup a vector to our boot code */
- *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET;
- *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4;
- outb(CMOS_REG, BIOS_RESET);
- outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */
+#ifdef __amd64__
+ if (!efi_boot) {
+#endif
+ /* save the current value of the warm-start vector */
+ mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF);
+ outb(CMOS_REG, BIOS_RESET);
+ mpbiosreason = inb(CMOS_DATA);
+
+ /* setup a vector to our boot code */
+ *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET;
+ *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4;
+ outb(CMOS_REG, BIOS_RESET);
+ outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */
+#ifdef __amd64__
+ }
+#endif
/* Wake up each AP. */
for (cpu = 1; cpu < mp_ncpus; cpu++) {
@@ -197,11 +203,17 @@ acpi_wakeup_cpus(struct acpi_softc *sc)
pmap_remap_lowptdi(false);
#endif
- /* restore the warmstart vector */
- *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec;
+#ifdef __amd64__
+ if (!efi_boot) {
+#endif
+ /* restore the warmstart vector */
+ *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec;
- outb(CMOS_REG, BIOS_RESET);
- outb(CMOS_DATA, mpbiosreason);
+ outb(CMOS_REG, BIOS_RESET);
+ outb(CMOS_DATA, mpbiosreason);
+#ifdef __amd64__
+ }
+#endif
}
#endif
More information about the dev-commits-src-all
mailing list