From nobody Thu Jun 4 00:36:22 2026 X-Original-To: dev-commits-src-branches@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 4gW5Gb3F5jz6h61n for ; Thu, 04 Jun 2026 00:36:23 +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 4gW5GZ6kZyz3pmC for ; Thu, 04 Jun 2026 00:36:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780533382; 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=lnB03oEA5dzbMm7qIbUCBUp/yMKWVj8C6LZEL6xYIMM=; b=SYoXqGg9pndxrP31AOUs0U7tj2Z42Ityp7WUww951MMS6EnVGdNyBKg3jJIQlfqea9Sjli wQIjgIHLjy5GZXXRD6gjfnsE9qW5P5IaMfGMb5VgeQWjYtWGh4Zrx8jdR0nyuHVDfd17EZ Q5sAohFM7Uhw6quJOtaYwPqtQVlbCFpVObzVQQI4dRGwdg9+K1UylDHJJdXdnElMotriud zVNguf+bbD/LsiG2LRtolK43zCI+b9Dn3OQtbfsBSse5TllWaGA00wW/HGu8d0OCt4T6cb 8iIVHTHXRwmUyipl+kCg7m+x0nDFBSfL5p5vJXkepUO6h5dZ74SSZl9D5DtKDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780533382; a=rsa-sha256; cv=none; b=f6WpJhZHfS4kG2kvWVi2j2Xw0PzaS6B5oqJMTzFGIok71DzXpfpvUvLIAY1DXieSIMiumw gR1WLwLP3OZm+opjSXccW1RE9wRI1Er53uqCDsx2ie/rjj8CfM+pthoWP+Gv+prO/oSH4/ 59h2B8Uog69bwI1a2DYP89TYe1+XVNKzryxUBE66DO+v5b0G4Xykj90z9GXt5WQzFrAuvF BrNPRE8Cz7t2qiACzE/YSHUuv++3Au2DQO4/joDC9xVmBJ8iAx330BtrxJjIb2fdG9/xyo RBSu4tukx8ADEYB0mpfEzafb6XYePqzI+9q2VBN1s5ZkCHxMVEqdAl3sboLgWw== 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=1780533382; 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=lnB03oEA5dzbMm7qIbUCBUp/yMKWVj8C6LZEL6xYIMM=; b=rNFSiPm2ohacSIzMwjXEf/j8SX7OK+OGoriZwiyaw6/Dhyb4xpVtTLKdy3ikOXPVl1k2G0 KVV+7l9aZKYvIwBo/+6deezQkDjeV78bynV2F0AZEUOfTW03L53jhk7yF2BS94+1dUKOVf oWFNhRD57wD3WiUC30kc1SJt1KHKDYoJpojCVEIcg62wzjRuttcvHAyicnMGG2q1/uSwjX xVRBz61c8oci1HY3YPOKg5Rrd09ONCRycSAOjvrvhrHPokKnu9tofa6hy4+4zqq4EqJTMp 8JaSJunru0LctABnNSHGR4lyM/kQQXwUmzWdLJ16KbrMygH5nJEJz4mjWIkOkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gW5GZ626dzb24 for ; Thu, 04 Jun 2026 00:36:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 21eba by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 04 Jun 2026 00:36:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e5488ddf9b22 - stable/15 - amd64: explain in more details why the slop is needed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: e5488ddf9b22e8894cb0650f530abea5d10c4045 Auto-Submitted: auto-generated Date: Thu, 04 Jun 2026 00:36:22 +0000 Message-Id: <6a20c886.21eba.62f2c4f0@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e5488ddf9b22e8894cb0650f530abea5d10c4045 commit e5488ddf9b22e8894cb0650f530abea5d10c4045 Author: Konstantin Belousov AuthorDate: 2026-05-31 19:15:37 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-04 00:34:43 +0000 amd64: explain in more details why the slop is needed (cherry picked from commit 963a92d63b7443d27588fb4260bd4226f7525117) --- 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 8bb88dd2e24f..9ff31b02dcb6 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -228,7 +228,10 @@ rootdev=disk0s1a .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 0d4ed59a98b1..d51e5501aca9 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)