From nobody Sat Jul 02 14:04:08 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 5A18E87B55E; Sat, 2 Jul 2022 14:04:09 +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 4LZv206cTvz3DYj; Sat, 2 Jul 2022 14:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656770649; 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=6uqQEWOndqhhglxiB8wFzEJvqOcX/OKOlKiZTdpR1lc=; b=Qpz16x3sOcgCGTQ7oWV40zbvLhjMXk8BpIQxVk2P1u/4UwyKlHWomrHxcr+E8IOw5nUpgt 06kYosQ9MvaKgQkEy2rfPGt+mzVuyJOuNtbp3p6o9P/HS7EerrJGMxgbAGbmTuSJcz0aHr m8lT3I/rKw4tF7Wgo3L+xvzXcxEyC2OdZliovotovvvNKUUreQxR3CDiXYwczuoWeTNlqx lYwuC/Bcl/bgVAb+nWs3YAkNray+ESckizo686VvRDraGxMq6XBgdDVhcN56uqHC3lKvNN hTl/lbyKdwsV81ihftTZjG9zMa82v8KX2Yt9/2Jc1sVxsV2wOcDucrwkJsoHWg== 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 9512911796; Sat, 2 Jul 2022 14:04:08 +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 262E48fX038852; Sat, 2 Jul 2022 14:04:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 262E48Vt038851; Sat, 2 Jul 2022 14:04:08 GMT (envelope-from git) Date: Sat, 2 Jul 2022 14:04:08 GMT Message-Id: <202207021404.262E48Vt038851@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: 37a3df3d6162 - main - loader: Set preferred kenv for acpi.rsdp on arm64 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: 37a3df3d6162b8f408b7d8a669245716771c309b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656770649; 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=6uqQEWOndqhhglxiB8wFzEJvqOcX/OKOlKiZTdpR1lc=; b=UMSCiYL5LzKDHW6fptkAkBmvKy3Ok4EFTZ0nIMMNDE+A2tV3Isr6RIX0Li0Cx2x5heUoJ7 UqdYtbjj0K9rIc+kwOdVBY5w9tKaWn5YXZ4jzytWzfQTQu/gCxIoQvaXHdKR69zGfPY/b3 a2YEOZpJ4Qk4qhs6e43gzHVGqFP/I+3NQKWbHo2rUfyQwDkjQ+lCOEGIqtpXgxTXvFaKmE Kf91MsI1IM/jwmDGrwfBK0cMLKwZ3UAiL/rOK6wJRWPU3eC4NuvToic0Ji/aZGZIieGaKn SHP/ypFalwtGuVvE3nzq/TANURFQQ2skf2umcQQZjYnjbHTjY4W4GkmTDPO2Vg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656770649; a=rsa-sha256; cv=none; b=OEC+VhEHbGDh4e5Iq2YyEwo5SHXOCBdDS3be/GOBXMmEp/xRk21SW+EjHtDTatHQemHO6c ShC7OTcG9KEpIUWxqJFZKbt1iZVN1AYEJyrOo34UWY7XedwVSByQ6Xr7ylJLtq4uSfC9e/ bboKDhMzCmMLaMI4Nwfd5NVofNtb9+cF2wPjJCjsqg2/VVNbmaV3rKCw+aPAZGRsPMgqGJ PYa1aIB2R/qGv12XLwvZPZtb8lu/Vq06/wJaPBfMrlUTLQtROrGKh0hGzy6WQnbdsPBCAJ 2PYItr6gvj+FGuec20WiDfcXIexPQnKLiypTM5zTOt+H2a7W1qOdZaMUhT22Zw== 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=37a3df3d6162b8f408b7d8a669245716771c309b commit 37a3df3d6162b8f408b7d8a669245716771c309b Author: Warner Losh AuthorDate: 2022-07-02 14:00:40 +0000 Commit: Warner Losh CommitDate: 2022-07-02 14:02:12 +0000 loader: Set preferred kenv for acpi.rsdp on arm64 Several years ago, x86 moved from using hints to communicate this information to using the simpler acpi.rsdp variables. If one compiles static hints into the kernel, then these hints are ignored. We can remove this when we branch FreeBSD 15. Thought about BURN_BRIDGES here, but it's too messy. Sponsored by: Netflix Reviewed by: andrew, jhb Differential Revision: https://reviews.freebsd.org/D35632 --- stand/efi/loader/arch/arm64/exec.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/stand/efi/loader/arch/arm64/exec.c b/stand/efi/loader/arch/arm64/exec.c index 6cf4a4fd8e4d..3cf1c1857f51 100644 --- a/stand/efi/loader/arch/arm64/exec.c +++ b/stand/efi/loader/arch/arm64/exec.c @@ -81,6 +81,15 @@ elf64_exec(struct preloaded_file *fp) int err, revision; void (*entry)(vm_offset_t); + /* + * Report the RSDP to the kernel. The old code used the 'hints' method + * to communite this to the kernel. However, while convenient, the + * 'hints' method is fragile and does not work when static hints are + * compiled into the kernel. Instead, move to setting different tunables + * that start with acpi. The old 'hints' can be removed before we branch + * for FreeBSD 15. + */ + rsdp = efi_get_table(&acpi20_guid); if (rsdp == NULL) { rsdp = efi_get_table(&acpi_guid); @@ -88,23 +97,29 @@ elf64_exec(struct preloaded_file *fp) if (rsdp != NULL) { sprintf(buf, "0x%016llx", (unsigned long long)rsdp); setenv("hint.acpi.0.rsdp", buf, 1); + setenv("acpi.rsdp", buf, 1); revision = rsdp->Revision; if (revision == 0) revision = 1; sprintf(buf, "%d", revision); setenv("hint.acpi.0.revision", buf, 1); + setenv("acpi.revision", buf, 1); strncpy(buf, rsdp->OemId, sizeof(rsdp->OemId)); buf[sizeof(rsdp->OemId)] = '\0'; setenv("hint.acpi.0.oem", buf, 1); + setenv("acpi.oem", buf, 1); sprintf(buf, "0x%016x", rsdp->RsdtPhysicalAddress); setenv("hint.acpi.0.rsdt", buf, 1); + setenv("acpi.rsdt", buf, 1); if (revision >= 2) { /* XXX extended checksum? */ sprintf(buf, "0x%016llx", (unsigned long long)rsdp->XsdtPhysicalAddress); setenv("hint.acpi.0.xsdt", buf, 1); + setenv("acpi.xsdt", buf, 1); sprintf(buf, "%d", rsdp->Length); setenv("hint.acpi.0.xsdt_length", buf, 1); + setenv("acpi.xsdt_length", buf, 1); } }