From nobody Thu Nov 12 09:14:43 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 4jQF8M61wTz70G4V for ; Thu, 12 Nov 2026 09:14:43 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jQF8M51mfz4qYW for ; Thu, 12 Nov 2026 09:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794474883; 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=P7mBXQxysoCPmUmTkmFXxGMs3oel7yZAtuBWOMn878U=; b=Bbp6Ew+y5baS1UM9kS1gfOGG18KwTJq3kIm4KNGh0tlds4YNKwd1dH26pdIda8uICe1Uiv pWR02iuQSnr39ILsN65DoSBFu07YlXKtwOmNtVUifC/AKyjcIQPgHFYEQdcqLW+YQSz/y4 2skXuGutHI/wn7JIofIg5dUHJaqb6zUmZtqJqD4rEwZgjKjLWbrUWt7w17LlE6jW1nI9kO wvVfqTgvv7lSkov1AVYo+bOKwwiCOOxHBmsjbYt+xYr0UT7bElojKLKi16qoDHvQ4Da9P8 K3pTPWpkXCE+mAaumYOyhEfB/CJMmhnbBMtb63XJ1O0H84Sx7nTosug78TSkRg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794474883; b=m23b7r8h6ke2SJVM+SyZkiX2dSALOQ4gZ464CGKDnTfujcoLMFsjdtjmvVWy/Z8oMK3yaG w1w5TdIPj9pNGmemTGZ2JvoUaVbmbL5NH4O2PyEFJwtgo6yb3pORZCseEGR99Iq+e/15h7 hxUSB1QQfmkRj4P0j59M3hg5lr42zvYM5OXMWmhBZziMn39K03+4Gd85Sstc2qD1hedHXK FgjqLfUSPNCcoyRhkxkVdcW7PFL71oCMsRl5mW/UX6cW7ia7VH7JWDl13ng6o8HOJmesV0 Zt3lpUvt1U4gdNEjxv0Xg/ySYlp5zGqarPx5rn8cQ0yy8BRd3d4Jjjr0Ujte7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794474883; 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=P7mBXQxysoCPmUmTkmFXxGMs3oel7yZAtuBWOMn878U=; b=cwt9MObW9zxZ4AYjFn3J6U3F76r/DJbq+4BhLRFhA3Iua5+5mjlJKPY5VjFKPP0o6TOgXp wNqUplMwhU1T8KGdb5JPFBmbiGaE75hcwmSXpcsOnhf9fMwnvrA/xJywfMUuvdx8IiQxQW S1n4lAwqiKCIZPbew1bMsKFMHnieWEw/Rp261Nz6m+JGTVYAStq0p2LQY90yFPEoz2HTIB /vGDLHAojZUOqFF+5HfODda0edVaaTU3hn5ZankRgnCnjz+TUVNoeXxiEbKTjDZvwQ0qxr 5itb4bBoWXxA12omn1Kyu+Keao5wtXjvz6fdvvVn7A62D2cLs+qzJi+hlaOq2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jQF8M4gyGzx9l for ; Thu, 12 Nov 2026 09:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1cf9c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 12 Nov 2026 09:14:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Cochard Subject: git: 46c2d93c5728 - main - loader.efi: Allocate ram disks as EfiReservedMemoryType List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olivier X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46c2d93c572865f6441788ad8416ff7ff971829a Auto-Submitted: auto-generated Date: Thu, 12 Nov 2026 09:14:43 +0000 Message-Id: <6af58383.1cf9c.544f34dd@gitrepo.freebsd.org> The branch main has been updated by olivier: URL: https://cgit.FreeBSD.org/src/commit/?id=46c2d93c572865f6441788ad8416ff7ff971829a commit 46c2d93c572865f6441788ad8416ff7ff971829a Author: Olivier Cochard AuthorDate: 2026-11-08 20:35:08 +0000 Commit: Olivier Cochard CommitDate: 2026-11-12 09:08:46 +0000 loader.efi: Allocate ram disks as EfiReservedMemoryType The kernel adds EfiLoaderData ranges to physmap and reuses the pages, so a memdisk=root is overwritten while the system runs. The kernel skips EfiReservedMemoryType, which ACPI requires for a registered RAM disk. Fixes: 85fb40bad584 Reviewed by: imp Approved by: imp Sponsored by: Netflix Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/96 --- stand/efi/loader/decompress.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/stand/efi/loader/decompress.c b/stand/efi/loader/decompress.c index fbf800f87862..11199e1ed3bc 100644 --- a/stand/efi/loader/decompress.c +++ b/stand/efi/loader/decompress.c @@ -20,13 +20,14 @@ #define ULL(x) ((unsigned long long)(x)) /* - * While memdisk_uefi.efi used EfiReservedMemoryType, we need to use - * EfiLoaderData instead, the standard memory type the loader uses to pass - * memory to the kernel. This is also safe if we're chain booting to another efi - * progarm since the memory will be available to that program. The other type - * isn't necessarily in the pmap, so the md driver fails. + * RamDisks live for the life of the next stage or longer. ACPI requires this + * for disks registered with the RamDisk protocol, and most operating systems + * will ignore this memory if not given other instructions. The FreeBSD + * kernel will skip it, but will properly use reserved memory for ram disks + * when told about them by the boot loader. */ -static EFI_MEMORY_TYPE mem_type = EfiLoaderData; + +static EFI_MEMORY_TYPE mem_type = EfiReservedMemoryType; struct decomp_state {