From nobody Tue Nov 11 00:30:59 2025 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 4d56s032PKz63kCc; Tue, 11 Nov 2025 00:31:00 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4d56s00tRRz3G4j; Tue, 11 Nov 2025 00:31:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762821060; 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=coIryeXruseRQOutFXdbQkYqyWcV1NqRe/PvCQpLR7E=; b=ll8RYJUm403UKg4d4Cx0LZuiQZeBAF071n9F1SlZ8RgGuEUfNIofhiEDmKJdeX7Dlmengh wOq03Xw8gzGjaiussUO4DjIR3kXMrKC1BN+7r2uYMw3l0NbXySqXJwXUP/aZmVlhiR+sjN 9EsbZmO8tvimVwG5W8AUzwkNPqr1biembAajHl8kRPCImMuel5jfhhUz6bu0Z/gTtmwV8q QNt0G+PyOva8Eaqe0KED7cEbsSD05hhVjFNi2jDheY3k3EUICYRipLazGKRuVyCkbo3n3r 7u1Nyn/QplnMju9khY6crjMtGS5QWfsm7uGjWasutQUIcFLk2xeKEsM2o4DDOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762821060; 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=coIryeXruseRQOutFXdbQkYqyWcV1NqRe/PvCQpLR7E=; b=XulWV2j9y0+Hx4jTL50sEndbnaN9QxT2JmC+omuwNuWy4VKp+ff+jgbTgfUmtuEpI6J7VK 4XTbWNdQ4jAimmd6S9cb6dGvfaOqTJVV5QbojOWNhQQn6L+piBrIFhrMog5KbKwJufvSrJ extMsweIym1BTrzhPer0Vphl/Sp4dqd2abkGqAHyKXwznhAnBfn0EnDTmaONsxm0GcXJ5c IpiumbJnxvSRCFaGszsaU/iKqPpY5+p1a0LtqeGIuf0ZRrgrAvi/mQMQjR6f1S8I9XcKtr LKvWvg+IAyUgr8v71LOAG3so+Kz/qRogiqo184lfEfEpNh/gyGxlrh381lQEcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1762821060; a=rsa-sha256; cv=none; b=uOFOce12jMH+cNv+1R5+VfvLXbigv+JdQdYAyKdEwzFEdJebT2a86pqPo4yxu+p5u2NOD3 +prDvw9MQdQs863sGKW9/CmMrAVQ8OA5J14qJr3fP8PldBPfydd+yG6Qq9G75Jpw8ZICXY U6Qa9M198MXYCX/syF5Zz2pidksEiBbn3m4W+L7IRw1YZLX54oi+RYCC+k3Vrkh207xVjt 6Tc04q3B7eQJ52fIHafkjC/m1Z4Tq+uTj0F8EERw/DWtWg8Hp1rFAG42P2A+MDnXTGmHh+ q5OFqLs3CaAHpXDEy0OLkcUgm/hZMhrOIj5Hj89ygeMzS35l8XE89OWzV+oABQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4d56s00Bljzhkt; Tue, 11 Nov 2025 00:31:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5AB0UxsC027194; Tue, 11 Nov 2025 00:30:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5AB0UxVW027191; Tue, 11 Nov 2025 00:30:59 GMT (envelope-from git) Date: Tue, 11 Nov 2025 00:30:59 GMT Message-Id: <202511110030.5AB0UxVW027191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "David E. O'Brien" Subject: git: 3deb21f1afd5 - main - random: TPM_HARVEST should have been named RANDOM_ENABLE_TPM 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obrien X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3deb21f1afd5c4abfd9cb93ca120097a841536c5 Auto-Submitted: auto-generated The branch main has been updated by obrien: URL: https://cgit.FreeBSD.org/src/commit/?id=3deb21f1afd5c4abfd9cb93ca120097a841536c5 commit 3deb21f1afd5c4abfd9cb93ca120097a841536c5 Author: David E. O'Brien AuthorDate: 2025-10-28 03:53:43 +0000 Commit: David E. O'Brien CommitDate: 2025-11-10 20:54:48 +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 --- 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/riscv/conf/GENERIC | 4 ++++ 9 files changed, 31 insertions(+), 7 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 fb8473505128..1de895a5b333 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -309,7 +309,6 @@ device wpi # Intel 3945ABG wireless NICs. device crypto # core crypto support device aesni # AES-NI OpenCrypto module device loop # Network loopback -device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support device vlan # 802.1Q VLAN support device tuntap # Packet tunnel. @@ -323,6 +322,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 61c713c609a4..2bd8851ab20c 100644 --- a/sys/amd64/conf/MINIMAL +++ b/sys/amd64/conf/MINIMAL @@ -113,7 +113,6 @@ device uart # Generic UART driver # Pseudo devices. device loop # Network loopback -device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support # The `bpf' device enables the Berkeley Packet Filter. @@ -121,6 +120,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 a0568466cfaf..003f13c8f1cc 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 df71aa60099d..71d14dc8915f 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2825,6 +2825,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 b00b381d1da1..963263e8a732 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -956,6 +956,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 067e7ccae8f9..6c587818058d 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_save_state(device_t dev, bool suspend); @@ -184,7 +184,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, @@ -212,7 +212,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); @@ -227,7 +227,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); @@ -254,7 +254,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/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index a8500fe80019..a7e1200e3884 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -204,6 +204,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"