Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Sep 2021 00:48:20 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: ecab307389ee - stable/13 - amd64: do not touch low memory in acpi_wakeup_ap() if booted by UEFI
Message-ID:  <202109200048.18K0mKXd048404@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=ecab307389eed81c7c3dd803954aa97a2bf04305

commit ecab307389eed81c7c3dd803954aa97a2bf04305
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-09-11 18:19:27 +0000
Commit:     Konstantin Belousov <kib@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
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109200048.18K0mKXd048404>