From owner-dev-commits-src-all@freebsd.org Mon Sep 13 16:56:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 834D667E504; Mon, 13 Sep 2021 16:56:03 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Xg72xcSz3FfC; Mon, 13 Sep 2021 16:56:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 454692871; Mon, 13 Sep 2021 16:56:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DGu304018316; Mon, 13 Sep 2021 16:56:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DGu3b2018315; Mon, 13 Sep 2021 16:56:03 GMT (envelope-from git) Date: Mon, 13 Sep 2021 16:56:03 GMT Message-Id: <202109131656.18DGu3b2018315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e99255c8a6ca - main - amd64: do not touch low memory in acpi_wakeup_ap() if booted by UEFI 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: e99255c8a6cae324aeede7f5013d080a2d361e3f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 16:56:03 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e99255c8a6cae324aeede7f5013d080a2d361e3f commit e99255c8a6cae324aeede7f5013d080a2d361e3f Author: Konstantin Belousov AuthorDate: 2021-09-11 18:19:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-13 16:51:52 +0000 amd64: do not touch low memory in acpi_wakeup_ap() if booted by UEFI Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31916 --- 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