From nobody Sun May 31 19:19:04 2026 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 4gT6Ms0Svvz6gbcg for ; Sun, 31 May 2026 19:19:05 +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 4gT6Mr6n9Gz3lZV for ; Sun, 31 May 2026 19:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780255145; 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=vRZSOf5X+0qqIY6e5BdEbHsGRwrDG9WOXNIj0vWrzL/1VEho6/ME8nzL08N2+OJJ68cRJt IORhbLm00XVqt11HLhsKdffiYITW6oPNWc4WNj6ljRTbH8fxO/BhDPwQUYgsygKpdbZAcF 5r9dOP4nqEPB8JW74MWIu0Gb9h36ygvrS3W3jeF4q0fBF9DtcgPgECOusDaXnVxcnPRw9D mNsUCK2O5oTHCDH0O/YZZR+Jzxx1Df3+RHxDDVpHF0QM5fsVsWEvf/SlutcB6woUNMzGqE Fz9mIwijcQz4TXhd9S5B3i+gSm/EeAlo0V0SOyTayZ77ZSayuxLLas3aVm0JKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780255145; a=rsa-sha256; cv=none; b=vQ8Dovwg0rUAiA7RW6ld1IyRXUzOBE+t4Vy8LKDPQ99XGV69S5BVN9xkls22OGhdtYR8+m FkdD7lzj9lnO4LjE6Eo2rgI8pC+4X6GI7SxAVNX8atyKG9rXyL2619PIKdEVJfE+xwClSO 2gSMwK+3c9fRfo4KRJHrbH8d6cjOwD5VWn6YDVHdZmO4dEZXlvp1dkmrx3q73fhs6JaK4c oCQCKHzVqUJ8GQQK9j91KoRHyBdw65jFjBidTPRMSaTOA+CWvdtM5l91htxa3jtRuYEwPR MvD149jYE8omY77PjnCFs6T3iGnC7EdzywDWwLzjxmkcEg03JIAJ8GMKri6caw== 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=1780255145; 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=sIh9SHGGGp0q3OhfufaSip2ydCSg8SufQufMMgK7ANE5DoYQCo3hUZ5jvQRS4EyieJ3kOM AGDIk7mSNa/Nvi2/IG8KF/Er+QRPIWCAibMVj6K7x37KwJ8YlM3qPqgArxkXgnEIDoXQf5 ruy3QjlpUyEyWMf9lJ95aZqTY3HY0J3cH6+LCEph4FKlCfBAeMs8LABNQQRZs+tKvpiDEB Nb2e57GwHpvFAK5izeON6qNr0U5bv5iyJOJcYENEAgit31PHAFm2OgUJUecX5WAlf6SRe4 t18MwYWGew8yqIGBez9/N2mqb8E6wANZoiszdUubN9ePoaR1brMpHw+tHO8hMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gT6Mr5qqnz14JP for ; Sun, 31 May 2026 19:19:04 +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 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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)