From nobody Sun May 31 19:19:04 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 4gT6Mx6x8Hz6gbfL for ; Sun, 31 May 2026 19:19: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gT6Mx6RgLz3lZs for ; Sun, 31 May 2026 19:19:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780255149; 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=VMp0y3VnnAfaSSX519+Rk0MTJUqb6VbMlZoBaJcCMKs=; b=pSPd+dCxwE2QvdTzHVa6yEh3X2abAhQyyxkUb7foJ52uqyn4QBwtsf7xnsB0x8eIhoI5MH 5LdxRaPBqI9EexZ05MpqZT+EYAwZvrEfRgjXi1EXbFTfMEXJ27rVCgUmvxWRU9qIMUqALP d/nXZ290ll34YYsYbPpPZaghTv/xULKYAS19F1HwzrE5Z3d7Cwei4t2A/Gs46FIi6oIrvF xP0FDvKPwttYqaZ/ayucUPKVcLwnG8F8oqjYNctbDJHlwAH/zCRISH7JCl1ban0hRMBMcb eibzbygzWuxJStYJoyoH32q1XfhRCyKAkdlO+yGbx/cDHbxD/XWpo0D8pP3JTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780255149; a=rsa-sha256; cv=none; b=flfEjLTyLELkZo6FJnvINRmjWT7IXj/3i6Uqb6qehnRdlTBlnvXJ1kCIA9I/o+rYMv0Xsj Nu5mMwWbli8zcYODxEDFs9zOVXZEZOJYwYRk1GN+X0ZHkN6MKeOBDxaKR4D9CCcpc4c8KN fAnH0EKcqciShRK/evW9EWRLu62lSEuhKJnModUpv4i0k6GXlQSjmtht0O3iWRQkuXv4Xu 4s2OWj/XcqmhlVi8d64yppF7MIhOczChZpmEzpXwOSWUwETX3oqy0EW5wmLNWBvOFnMcrz D+k8uoXhft6Pc/gib8y5bvWVNcQ7G1Abx4KTCnplfGxibw6420/E8VPnfWg7dA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780255149; 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=VMp0y3VnnAfaSSX519+Rk0MTJUqb6VbMlZoBaJcCMKs=; b=BOyVHO5oIL0HJrmI13zPKsLqx1qwwWz93IySlpv1SoVpXgTD0XbcNf89StWNJ60+0ZKzSr ugmqy4Q8SP+znPMK1699HoVOkOpkRDeRsp8IqWY2BUmwi8Inv1LV/d6JDI7aNpYt7yap97 UJUntKVNWrMlZ9P8FJ22rzL7MYBOPkkyL8ULilQcIS6D8KljpvH97icfAie0AIkOBHRnsb WCt4EHK/N+bBPGE/NZgEOkzdSTP1NkLwtdn1b/+6QhExzhs04GF/7VBKdrAIYBQwlFXSkD 9vSRqPojmk25Lk7D+K5lyL/lVdchNLry+RDBh+U37OpxZjVqwt0chmNmJyjD8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gT6Mx5NwBz14Dm for ; Sun, 31 May 2026 19:19:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 218f0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 31 May 2026 19:19:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 963a92d63b74 - main - amd64: explain in more details why the slop is needed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 963a92d63b7443d27588fb4260bd4226f7525117 Auto-Submitted: auto-generated Date: Sun, 31 May 2026 19:19:04 +0000 Message-Id: <6a1c89a8.218f0.4e9be02f@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=963a92d63b7443d27588fb4260bd4226f7525117 commit 963a92d63b7443d27588fb4260bd4226f7525117 Author: Konstantin Belousov AuthorDate: 2026-05-31 19:15:37 +0000 Commit: Konstantin Belousov CommitDate: 2026-05-31 19:18:46 +0000 amd64: explain in more details why the slop is needed Sponsored by: The FreeBSD Foundation MFC after: 1 week --- stand/man/loader.efi.8 | 3 +++ sys/amd64/amd64/machdep.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index 32729ff519a2..d9ee55ee192e 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -261,7 +261,10 @@ Invalid syntax and the like are silently ignored. .Ss Staging Slop The kernel must parse the firmware memory map tables to know what memory it can use. +It also needs to allocate memory for the kernel page tables. Since it must allocate memory to do this, +without overwriting important structures, +for instance the trampoline page table, .Nm ensures there's extra memory available, called .Dq slop , diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 8df4868f5312..79bef08f8a64 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1273,6 +1273,13 @@ amd64_bsp_ist_init(struct pcpu *pc) * - there is a usable memory block right after the end of the * mapped kernel and all modules/metadata, pointed to by * physfree, for early allocations + * + * The memory block after the end of the kernel is important, loader + * must ensure that no critical data structures are put there. Among + * them is the trampoline page table, which must not be overwritten by + * the allocations until pmap_bootstrap() switches %cr3 to the initial + * version of the kernel page table. Size of the block is controlled + * by the 'staging_slop' command for loader.efi. */ vm_paddr_t __nosanitizeaddress __nosanitizememory amd64_loadaddr(void)