From nobody Sun Oct 11 01:06:25 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 4j2Mqp6Rjbz6w8FC for ; Sun, 11 Oct 2026 01:06:30 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j2Mqp55kzz3GbS for ; Sun, 11 Oct 2026 01:06:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791680790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2VkwTKYDBlCuYWaonRtjd/fNi+XjWeGkECRri5wpH8U=; b=XLYoGBMGjZzEjwz1ibx9L0spa4BiyD8oJVQd+NAaKGOP3Ed2Kh4oJomOSD0qdO6oqMKx9y ckmJgI86eU+sRXUjLoe2TK96b6xkF8BtMvpiqDsIq1pOKJ9A7jkN1Xveyjw6TjApxZee1Z NMqrhONACZ2w737E656UkebofAXzr+B1bIVJPBEvID0M0i5jbMHGtMb3LgpmqZcZmnldD7 sqG+CdCcBKcykUAheolZ+PBfh7cfTm+pCsq6TJaFS+b3TuwR9c+4H0kgallf92ocG3Ylns Hkng0r4N3jphuC+uXuP76xS+FqEA6xISM4dR6Rx5xiZ56l1QXiqgA+hlmtYlqQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791680790; b=avupWWvb2JoMcPqIMYOTtkr9s99oYKmT7XqR4oDuqOITQAXdfSb+LpdJYc+hLjP+nHNUUy xusDEA3FkXVOFTRTDheHabs+PxYGS1G0LVoDw3uco7QacewbiexAaRXAPMhuYVpq+SMwFZ jFYNwXws7mOEZSamiGgtue6iGRrZZS029Xtf+/MO6+PyhrG3ONgmTqu+8Jmqz5txTYXAVW U4jdMwKBf8sgeTZRzAUTZJU/owu+mZy6CHuGDks+RVASgLAdLxd8CNmuOmP4GgcWtUE1jU cKXJYlYtUQDLb4fhzq5NJkK4Gx1FtdHIo6FLODWC9E6yiUWuXb5EfbFqbc0VkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791680790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2VkwTKYDBlCuYWaonRtjd/fNi+XjWeGkECRri5wpH8U=; b=o2YZqukWJGW8cZ/TKggbHTEkkHLiWK28gqUGjfK0IHNvNdao/LVq/PSd7Y9peIPXOt+xza isgKgkFl+dD6h0uy6iuK/hT3j/2zJtDscuTPrR6lfAG4EI9F1l1JUd4hTFy1wrPp6RKaGI b/Xax+qS1RNQIqIYdN/3IT+9XvLojl8OMCnvkvyGZRn+vlRNT0JtEbs6/EZyAyAPW99bEc +lzpqtSrrvvOdWLAUheAPK94sa4t2fK6/V8ZU5l1GolfnWsAS1Jh5GfWzp2YHyG6y/sThY zpQgyfEsvKZq4dsgdC0gx5lrZuP6Re1gidPbrm47HT5cidlsbZxevKo9vGjvxA== 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 4j2Mqp3W43zJ8r for ; Sun, 11 Oct 2026 01:06:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33a24 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 11 Oct 2026 01:06:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: David E. O'Brien From: Kevin Bowling Subject: git: e10bda708903 - stable/15 - random: TPM_HARVEST should have been named RANDOM_ENABLE_TPM List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD 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: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e10bda7089033ece33bec182e748a8361cf5764e Auto-Submitted: auto-generated Date: Sun, 11 Oct 2026 01:06:25 +0000 Message-Id: <6acae111.33a24.1d15c349@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e10bda7089033ece33bec182e748a8361cf5764e commit e10bda7089033ece33bec182e748a8361cf5764e Author: David E. O'Brien AuthorDate: 2025-10-28 03:53:43 +0000 Commit: Kevin Bowling CommitDate: 2026-10-11 01:05:00 +0000 random: TPM_HARVEST should have been named RANDOM_ENABLE_TPM * Enable RANDOM_ENABLE_TPM by default * The commit of TPM_HARVEST failed to add it to NOTES so that the LINT kernel would build the code. Fixes: 4ee7d3b0118c82e651712bb65da53d08e78cd7b1 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53460 Include the follow-up header guard fix so RANDOM_ENABLE_TPM also provides the entropy harvest task in struct tpm_sc. (cherry picked from commit 3deb21f1afd5c4abfd9cb93ca120097a841536c5) (cherry picked from commit f1b9c1aafd8496c5bfdbc2be57bcfecfe58f12a8) --- share/man/man4/random.4 | 1 + sys/amd64/conf/GENERIC | 6 +++++- sys/amd64/conf/MINIMAL | 6 +++++- sys/arm/conf/GENERIC | 4 ++++ sys/arm64/conf/std.arm64 | 4 ++++ sys/conf/NOTES | 2 ++ sys/conf/options | 1 + sys/dev/tpm/tpm20.c | 10 +++++----- sys/dev/tpm/tpm20.h | 2 +- sys/riscv/conf/GENERIC | 4 ++++ 10 files changed, 32 insertions(+), 8 deletions(-) diff --git a/share/man/man4/random.4 b/share/man/man4/random.4 index 04d46e4d32aa..457f49f3d3ce 100644 --- a/share/man/man4/random.4 +++ b/share/man/man4/random.4 @@ -30,6 +30,7 @@ .Sh SYNOPSIS .Cd "options RANDOM_LOADABLE" .Cd "options RANDOM_ENABLE_ETHER" +.Cd "options RANDOM_ENABLE_TPM" .Cd "options RANDOM_ENABLE_UMA" .Sh DESCRIPTION The diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index d775b20653f6..0548c90985d1 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -311,7 +311,6 @@ device crypto # core crypto support device aesni # AES-NI OpenCrypto module device loop # Network loopback device padlock_rng # VIA Padlock RNG -device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support device vlan # 802.1Q VLAN support device tuntap # Packet tunnel. @@ -325,6 +324,11 @@ device xz # lzma decompression # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter +# random(4) +device rdrand_rng # Intel Bull Mountain RNG +device tpm # Trusted Platform Module +options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0 + # USB support options USB_DEBUG # enable debug msgs device uhci # UHCI PCI->USB interface diff --git a/sys/amd64/conf/MINIMAL b/sys/amd64/conf/MINIMAL index 06680cf6c774..b7baa2bd061d 100644 --- a/sys/amd64/conf/MINIMAL +++ b/sys/amd64/conf/MINIMAL @@ -128,7 +128,6 @@ device uart # Generic UART driver # Pseudo devices. device loop # Network loopback device padlock_rng # VIA Padlock RNG -device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support # The `bpf' device enables the Berkeley Packet Filter. @@ -136,6 +135,11 @@ device ether # Ethernet support # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter +# random(4) +device rdrand_rng # Intel Bull Mountain RNG +device tpm # Trusted Platform Module +options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0 + # VirtIO support device virtio # Generic VirtIO bus (required) device virtio_pci # VirtIO PCI device diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index 22bb75993834..0d741a7e584a 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -216,6 +216,10 @@ device ffec # Freescale Fast Ethernet Controller device neta # Marvell 10/100/1000 Network controller device smsc # SMSC LAN91C111 +# random(4) +device tpm # Trusted Platform Module +options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0 + # Sound support device sound diff --git a/sys/arm64/conf/std.arm64 b/sys/arm64/conf/std.arm64 index f9a7d9a2f7f4..427ac0ddad44 100644 --- a/sys/arm64/conf/std.arm64 +++ b/sys/arm64/conf/std.arm64 @@ -106,3 +106,7 @@ device efirtc # EFI RTC # SMBIOS -- all EFI platforms device smbios + +# random(4) +device tpm # Trusted Platform Module +options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0 diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 494303203e2f..70834e93f3f0 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2824,6 +2824,8 @@ options RANDOM_ENABLE_UMA # slab allocator # environment. options RANDOM_ENABLE_ETHER # ether_input +options RANDOM_ENABLE_TPM # implies TPM_HARVEST + # Module to enable execution of application via emulators like QEMU options IMGACT_BINMISC diff --git a/sys/conf/options b/sys/conf/options index d0737f6595ce..10485fe7f765 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -958,6 +958,7 @@ RANDOM_LOADABLE opt_global.h # the uma slab allocator. RANDOM_ENABLE_UMA opt_global.h RANDOM_ENABLE_ETHER opt_global.h +RANDOM_ENABLE_TPM opt_global.h # This options turns TPM into entropy source. TPM_HARVEST opt_tpm.h diff --git a/sys/dev/tpm/tpm20.c b/sys/dev/tpm/tpm20.c index ca73b0de8529..c521ca9dda9d 100644 --- a/sys/dev/tpm/tpm20.c +++ b/sys/dev/tpm/tpm20.c @@ -42,7 +42,7 @@ MALLOC_DEFINE(M_TPM20, "tpm_buffer", "buffer for tpm 2.0 driver"); static void tpm20_discard_buffer(void *arg); -#ifdef TPM_HARVEST +#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM static void tpm20_harvest(void *arg, int unused); #endif static int tpm20_restart(device_t dev, bool clear); @@ -185,7 +185,7 @@ tpm20_ioctl(struct cdev *dev, u_long cmd, caddr_t data, return (ENOTTY); } -#ifdef TPM_HARVEST +#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM static const struct random_source random_tpm = { .rs_ident = "TPM", .rs_source = RANDOM_PURE_TPM, @@ -213,7 +213,7 @@ tpm20_init(struct tpm_sc *sc) if (result != 0) tpm20_release(sc); -#ifdef TPM_HARVEST +#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM random_source_register(&random_tpm); TIMEOUT_TASK_INIT(taskqueue_thread, &sc->harvest_task, 0, tpm20_harvest, sc); @@ -228,7 +228,7 @@ void tpm20_release(struct tpm_sc *sc) { -#ifdef TPM_HARVEST +#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM if (device_is_attached(sc->dev)) taskqueue_drain_timeout(taskqueue_thread, &sc->harvest_task); random_source_deregister(&random_tpm); @@ -277,7 +277,7 @@ tpm20_shutdown(device_t dev) return (tpm20_save_state(dev, false)); } -#ifdef TPM_HARVEST +#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM /* * Get TPM_HARVEST_SIZE random bytes and add them * into system entropy pool. diff --git a/sys/dev/tpm/tpm20.h b/sys/dev/tpm/tpm20.h index 7f6e8f39c5e6..96b2920283b6 100644 --- a/sys/dev/tpm/tpm20.h +++ b/sys/dev/tpm/tpm20.h @@ -128,7 +128,7 @@ struct tpm_sc { lwpid_t owner_tid; struct callout discard_buffer_callout; -#ifdef TPM_HARVEST +#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM struct timeout_task harvest_task; #endif diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index e5f88b811219..49055af9d5ee 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -207,6 +207,10 @@ options FDT device iicbus # Bus support, required for iicoc below. device iicoc # OpenCores I2C controller support +# random(4) +device tpm # Trusted Platform Module +options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0 + # Include SoC specific configuration include "std.allwinner" include "std.cvitek"