git: 2753bbe71b5a - main - amd64/efi: Remove setting hints for rsdp

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sat, 02 Jul 2022 14:04:10 UTC
The branch main has been updated by imp:

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

commit 2753bbe71b5adce61a1bfb9535bc33735c35887c
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-07-02 14:01:09 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-07-02 14:02:12 +0000

    amd64/efi: Remove setting hints for rsdp
    
    Given that hints set this way don't work when a static kenv is compiled
    into the kernel. acpi.rsdp has been set for this for the past 6 years,
    and all kernels in that time have used it in preference to the hints. As
    such, we no longer hints.*, so remove them.
    
    Sponsored by:           Netflix
    Reviewed by:            jhb
    Differential Revision:  https://reviews.freebsd.org/D35634
---
 stand/efi/loader/arch/amd64/elf64_freebsd.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/stand/efi/loader/arch/amd64/elf64_freebsd.c b/stand/efi/loader/arch/amd64/elf64_freebsd.c
index 4bdf675cd5a3..290d1c4696da 100644
--- a/stand/efi/loader/arch/amd64/elf64_freebsd.c
+++ b/stand/efi/loader/arch/amd64/elf64_freebsd.c
@@ -119,12 +119,6 @@ elf64_exec(struct preloaded_file *fp)
 	/*
 	 * Report the RSDP to the kernel. While this can be found with
 	 * a BIOS boot, the RSDP may be elsewhere when booted from UEFI.
-	 * 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 12.
 	 */
 
 	rsdp = efi_get_table(&acpi20_guid);
@@ -133,29 +127,23 @@ 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);
 		}
 	}