From nobody Thu Sep 01 16:42:21 2022 X-Original-To: dev-commits-src-main@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 4MJRfP5D9lz4Zv8q; Thu, 1 Sep 2022 16:42:21 +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 4MJRfP2X3Kz3Pjf; Thu, 1 Sep 2022 16:42:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662050541; 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=JfdrUj+BW22AYvRnoO9z/6gW36/EaCmws/2WtlpmlR4=; b=oFTIuMxLPS+FiQ66aNCayH90BmYdJ6bjzSJbp5GKXEDNdpd6Nf0hUhwrPqsNi9ZW1NVJF9 CcZx6M2iv4SAvGAMLf1cr3F2qxgyDQRJb4w5lcWT6PtJuZa/dw14sl2w08kUsfYtf9+m3l +3OYRLCGmjAoj4LQX9i9Hko8rPCSohZB/1kEd1UnIL1c+cQrWieM8GYX00ph3T9RdwuxRR GolwX4Z8eXPPICt4l58zuzzbTP8CUvttAwUaJri7Cw25v07MXEu7QmsH9DrBlAETloAUBb QtGUqEz4o6pNQ/Efywnp/ggVqUos9lrdlEA4O/6InnK/1EI0rbC69z6dvJfuiQ== 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 4MJRfP1Ph7zXgf; Thu, 1 Sep 2022 16:42:21 +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 281GgLUe067681; Thu, 1 Sep 2022 16:42:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 281GgLOk067680; Thu, 1 Sep 2022 16:42:21 GMT (envelope-from git) Date: Thu, 1 Sep 2022 16:42:21 GMT Message-Id: <202209011642.281GgLOk067680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a14b26a6bd3f - main - acpi: Unmap RSDP in more error cases List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a14b26a6bd3f34f27960e02948385993962e32d0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662050541; 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=JfdrUj+BW22AYvRnoO9z/6gW36/EaCmws/2WtlpmlR4=; b=JsyRT2REgnhs0W4B1QMWoULb7Yjjx3vEcNrJcmAv527ve8ZmqvJ3RAUtTkK0Nynhfhrx7s WiUuAZzf4H+rvWDWaFTqZqls7E9KFiaeL30meKvaKeSsMAXgHrxZTq0hhGFFQaS6vsCBJx dGkK6wc3qBQvpAtF26w2HiW8pdSOKzZqv3barkNoEnoeey2q7xCMjI48OqgBRdw+5zdNCx z6c7Kxwr3qfu+H9qQzM7xU1oU/VNAPivJeMY1+LyC3RN+vb2D8rp7IfORgbwAN9F64CWPl hwfLWeTkZnfz85vn/dIppIMFTw8iwlfnvI0hGbFZB7YWxfS+dLwdZwq3+77vlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662050541; a=rsa-sha256; cv=none; b=fpLtg3M++amq/hu2safu+U0KI3KXvzy4b+jjPMLEvVvku9uu3ECpYsWdPv1ON802nOxmFA rX9Bpmmn1BXrcSXWW0D/cJC13n/A6RjOPc5wCRNQIbo0jdquzsCFUcoBdYcVVk+5ZmijW8 nKbnDP1dBFQGaY8+nfskJQaRnA/YUpuVesJYQLD/LtbVx2VNvwj40H8YedX9U9sVYhPK40 e7js+7fxlPs7VIMhOFfPCwuaSRFEKaB4wMg/5q6l0uApngMo6OW1HqMpd2X3WFcaBi/v4P 94ljacwFx0V3mp74hXfd+Sx0AZVQxWWgKhSZvfDU76DUHCU1xFBdrHqflynAtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a14b26a6bd3f34f27960e02948385993962e32d0 commit a14b26a6bd3f34f27960e02948385993962e32d0 Author: Warner Losh AuthorDate: 2022-09-01 16:39:20 +0000 Commit: Warner Losh CommitDate: 2022-09-01 16:39:20 +0000 acpi: Unmap RSDP in more error cases Add missing pmap_unmapbios() calls for when we return 0. Otherwise we can leave the table mapped when it is of no use. Sponsored by: Netflix Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D36405 --- sys/amd64/acpica/acpi_machdep.c | 6 ++++++ sys/arm64/acpica/acpi_machdep.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/sys/amd64/acpica/acpi_machdep.c b/sys/amd64/acpica/acpi_machdep.c index bbeb7cef44c5..1a9f44969d03 100644 --- a/sys/amd64/acpica/acpi_machdep.c +++ b/sys/amd64/acpica/acpi_machdep.c @@ -203,12 +203,16 @@ acpi_find_table(const char *sig) if (AcpiTbChecksum((UINT8 *)rsdp, ACPI_RSDP_XCHECKSUM_LENGTH)) { if (bootverbose) printf("ACPI: RSDP failed extended checksum\n"); + pmap_unmapbios((vm_offset_t)rsdp, + sizeof(ACPI_TABLE_RSDP)); return (0); } xsdt = map_table(rsdp->XsdtPhysicalAddress, ACPI_SIG_XSDT); if (xsdt == NULL) { if (bootverbose) printf("ACPI: Failed to map XSDT\n"); + pmap_unmapbios((vm_offset_t)rsdp, + sizeof(ACPI_TABLE_RSDP)); return (0); } count = (xsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) / @@ -224,6 +228,8 @@ acpi_find_table(const char *sig) if (rsdt == NULL) { if (bootverbose) printf("ACPI: Failed to map RSDT\n"); + pmap_unmapbios((vm_offset_t)rsdp, + sizeof(ACPI_TABLE_RSDP)); return (0); } count = (rsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) / diff --git a/sys/arm64/acpica/acpi_machdep.c b/sys/arm64/acpica/acpi_machdep.c index 8ce4e521860b..6145dfbbc78b 100644 --- a/sys/arm64/acpica/acpi_machdep.c +++ b/sys/arm64/acpica/acpi_machdep.c @@ -176,6 +176,8 @@ acpi_find_table(const char *sig) if (AcpiTbChecksum((UINT8 *)rsdp, ACPI_RSDP_XCHECKSUM_LENGTH)) { if (bootverbose) printf("ACPI: RSDP failed extended checksum\n"); + pmap_unmapbios((vm_offset_t)rsdp, + sizeof(ACPI_TABLE_RSDP)); return (0); } xsdt = map_table(rsdp->XsdtPhysicalAddress, ACPI_SIG_XSDT);