From nobody Tue Feb 10 02:44:23 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f95Vv4jc1z6RGpj for ; Tue, 10 Feb 2026 02:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f95Vv3x0Vz3RRy for ; Tue, 10 Feb 2026 02:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770691463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JwnPKGYRUAk6HpJ7N5d0MVvleBNgjoPHgOIQC1ic5fs=; b=xfdMYEo7L4ek1zBcHWLrMlK0Zc5fL8X4/fAzahXcOax3rVvK5hIsb8wkQqXlL50ho6ZXFy B17/xblI5rNCah6sEuO2smN1tNMEw/dC5HRgnXpPnUNVGbMJiZpmEQtfPShf7faOE0olla X1QLpsqjIBXXWamSsZRpwotnFk0r2Sfx1NljWRBuLeKD/DdrKL/STNkADDxS8u+pbJtMw/ ZRXWuuaMgm3CwXykAJmT9rzUUFbgLoZ/H0GfZLbUz4uPaBRj1CaTyFBs3FyXQb/yhx7E2D D9tDkVrL3mBFUUisNJ59snrvjaWqtWTDVW7YE4/bkHZ79rdXbH/a0KuhYhw6Kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770691463; a=rsa-sha256; cv=none; b=ZCvZl/3/wBfbluYx/T8LELOmUOAM7CTYERIOOkjSlGyXOJJxxxw2NNi66XjymQlXTIYf6W sva3d2b44BrVw/Z9CMzAxLy6kyYi0QHpenyUHyD9sCRZmhlL/6K+NbyzNllFbCy0CkKHng bwcrf9eRkIpvSXmD+eyFan4lfiDm8mnY4zN2mnwrmyJTrTK7amGr3tV650yLiEWsZkl9zY sOVWMhiatsD7E1AM9FDmMgOwF+ynvF+oIwkNLmmYPqWjPy6mJw1momwEFdAaGAasRrop+0 osDTW1dfmGdYzxyY4zM4FKeW4k4Y4ycrW4cQFKIrGJ2/V+Sx5ZnSPWf9/aLW/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770691463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JwnPKGYRUAk6HpJ7N5d0MVvleBNgjoPHgOIQC1ic5fs=; b=L4V6kVnQNNjFhT4dAxJdjMsxjqkKC3tTVB4M3/TCEh8cEMoAPlC95bebBV5uFE+UncjMoG SANqaw3HkT7N0EFJQLXoqgFVY6gZ+yMIZq8MjE1eeQHrg3UFOI2XCLLlx9eP8z1CRmWlvS 4+lGlLvcLz7jhZaOuc31o4/uV4fNkf52VxkpWX53q+YmLB6eiIz0fVlbWlgqxZ9BctFAqQ bExGgL07bFQcg7QIi2o48L9j3PfKza8XzmBFc9KBSIketdhLtZ0NS8A8zQDznUs+W4U4eL Z/XaVUJeQhvMXSVb3MugrA17tad/sLYLJwNupBUcLG9jE+DtnvejzxytijDF0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f95Vv3Jk0z10rg for ; Tue, 10 Feb 2026 02:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e10f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 10 Feb 2026 02:44:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5f3192b3fddd - main - amd64/acpica/acpi_wakeup.c: do not store to WARMBOOT_OFF in efi_boot case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f3192b3fddd974db36af0279403aba1371c68ec Auto-Submitted: auto-generated Date: Tue, 10 Feb 2026 02:44:23 +0000 Message-Id: <698a9b87.3e10f.73acc6a4@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5f3192b3fddd974db36af0279403aba1371c68ec commit 5f3192b3fddd974db36af0279403aba1371c68ec Author: Konstantin Belousov AuthorDate: 2026-02-10 01:37:18 +0000 Commit: Konstantin Belousov CommitDate: 2026-02-10 02:38:33 +0000 amd64/acpica/acpi_wakeup.c: do not store to WARMBOOT_OFF in efi_boot case Split acpi_wakeup_cpus() into acpi_wakeup_cpus_bios() and acpi_wakeup_cpus_efi(). The former needs to manipulate zero page and CMOS state, the later does not. Referenced commit left the write to WARMBOOT_OFF in case of acpi_wakeup_ap() failed. Fixes: e99255c8a6cae324aeede7f5013d080a2d361e3f Reviewed by: imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D55205 --- sys/amd64/acpica/acpi_wakeup.c | 58 ++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index 6e6b9ac618dd..1200d20f14c2 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -75,9 +75,7 @@ extern struct susppcb **susppcbs; static cpuset_t suspcpus; static void acpi_stop_beep(void *, enum power_stype); - static int acpi_wakeup_ap(struct acpi_softc *, int); -static void acpi_wakeup_cpus(struct acpi_softc *); #define ACPI_WAKEPT_PAGES 7 @@ -129,24 +127,22 @@ acpi_wakeup_ap(struct acpi_softc *sc, int cpu) #define BIOS_WARM (0x0a) static void -acpi_wakeup_cpus(struct acpi_softc *sc) +acpi_wakeup_cpus_bios(struct acpi_softc *sc) { uint32_t mpbioswarmvec; int cpu; u_char mpbiosreason; - if (!efi_boot) { - /* 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' */ - } + /* 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' */ /* Wake up each AP. */ for (cpu = 1; cpu < mp_ncpus; cpu++) { @@ -160,12 +156,26 @@ acpi_wakeup_cpus(struct acpi_softc *sc) } } - if (!efi_boot) { - /* restore the warmstart vector */ - *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, mpbiosreason); +} + +static void +acpi_wakeup_cpus_efi(struct acpi_softc *sc) +{ + int cpu; - outb(CMOS_REG, BIOS_RESET); - outb(CMOS_DATA, mpbiosreason); + /* Wake up each AP. */ + for (cpu = 1; cpu < mp_ncpus; cpu++) { + if (!CPU_ISSET(cpu, &suspcpus)) + continue; + if (acpi_wakeup_ap(sc, cpu) == 0) { + panic("acpi_wakeup: failed to resume AP #%d (PHY #%d)", + cpu, cpu_apic_ids[cpu]); + } } } @@ -264,8 +274,12 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); lapic_xapic_mode(); - if (!CPU_EMPTY(&suspcpus)) - acpi_wakeup_cpus(sc); + if (!CPU_EMPTY(&suspcpus)) { + if (efi_boot) + acpi_wakeup_cpus_efi(sc); + else + acpi_wakeup_cpus_bios(sc); + } } if (!CPU_EMPTY(&suspcpus))