Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2221907/?format=api
{ "id": 2221907, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2221907/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260410120319.064561422@kernel.org/", "project": { "id": 8, "url": "http://patchwork.ozlabs.org/api/1.2/projects/8/?format=api", "name": "Linux ext4 filesystem development", "link_name": "linux-ext4", "list_id": "linux-ext4.vger.kernel.org", "list_email": "linux-ext4@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260410120319.064561422@kernel.org>", "list_archive_url": null, "date": "2026-04-10T12:20:16", "name": "[22/38] random: Provide CONFIG_ARCH_HAS_RANDOM_ENTROPY", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "c9fb739eb7c0f0017da3dbbe8461b090d441b6a9", "submitter": { "id": 92397, "url": "http://patchwork.ozlabs.org/api/1.2/people/92397/?format=api", "name": "Thomas Gleixner", "email": "tglx@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260410120319.064561422@kernel.org/mbox/", "series": [ { "id": 499451, "url": "http://patchwork.ozlabs.org/api/1.2/series/499451/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=499451", "date": "2026-04-10T12:18:27", "name": "treewide: Cleanup LATCH, CLOCK_TICK_RATE and get_cycles() [ab]use", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499451/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2221907/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2221907/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <SRS0=+pkU=CJ=vger.kernel.org=linux-ext4+bounces-15757-patchwork-incoming=ozlabs.org@ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-ext4@vger.kernel.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "patchwork-incoming@ozlabs.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=C7az2CYX;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=150.107.74.76; helo=mail.ozlabs.org;\n envelope-from=srs0=+pku=cj=vger.kernel.org=linux-ext4+bounces-15757-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)", "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c15:e001:75::12fc:5321\"\n arc.chain=subspace.kernel.org", "gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org", "gandalf.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=C7az2CYX;\n\tdkim-atps=neutral", "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15757-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"C7az2CYX\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201" ], "Received": [ "from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fsc6y2fmkz1yGS\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 22:48:42 +1000 (AEST)", "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fsc6y246Wz4wJh\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 22:48:42 +1000 (AEST)", "by gandalf.ozlabs.org (Postfix)\n\tid 4fsc6y1zHnz4wJR; Fri, 10 Apr 2026 22:48:42 +1000 (AEST)", "from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4fsc6v1RN1z4wJh\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 10 Apr 2026 22:48:39 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 17B123035EDF\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 10 Apr 2026 12:25:37 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 156AA3DB63D;\n\tFri, 10 Apr 2026 12:20:20 +0000 (UTC)", "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id BA1813C4566;\n\tFri, 10 Apr 2026 12:20:19 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 7E21BC19421;\n\tFri, 10 Apr 2026 12:20:18 +0000 (UTC)" ], "ARC-Seal": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1775825322; cv=pass;\n\tb=B8BCdb0DGZWo225/js/YuPBfdj00SVeLlo8CgS33LvxJRBatAfrPlkFal5FQOEOeMr/fyXbuf+CO9ne3qynXRPY9PK40VezumpsN3/RxGixmdG/wBNhyCYQqFzjz60MO/j2X52QrIAJ46+6wDedja0y0g0+kLyCrQ5HgpsxPFiL/+yokoa7P8NAAHj8b7taX/h4wcoNL7bdoBCy1+Vb3OtnC2n9muAEEtDWMh30MB8t1z5av8s9bi4fyo4Eg7ceY+tbA+zMIItg7ikhCXNY8/QWrSbmGeuxOoaqEYYYAvVl/HKAnbeYQ6zQEV2B/txmLgMzBq6ceDNQCBkla/phKYQ==", "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775823619; cv=none;\n b=UaqxFWRQ7jNL7xiUzaFSyabXxWIh1sHjcFZ5L0YIGwKPoryc9DJzNlmf22kexVU3g/SObgPjChXC0vag52rdD1wI4wIxzyPhqBB+Q3FdRZ1+srMBKYLBYLYZO5Lnztr3KJVWPUfUJPFNLc1Qs3imud9HU0P+9REPyuB25co+vPA=" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1775825322; c=relaxed/relaxed;\n\tbh=AqOQD77ovJbDZAalLb7LttNXWfQNwpbHnO0m4lNbaKQ=;\n\th=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version:\n\t Content-Type;\n b=BU0JvhFeDVoa7LCTVQWB1iLpLNC2P9Bqqa+7gjCQqZ5QoQ3Ry1Okk1NoaSzArMaX+OKzmxqIq2DH8N70qQftdsRgZy76ed/wW0ZzvoifcxpC3B+V+UV16Rq1f/vgiFLMMw7ti+xQeptXQ1XA4qUR+7Qw6UY/J2YuUDKsXW0z13uY7U8ORgB/do/MrJRJmV/9Cn5MgAeusxFGnfJVu724lW+s9rP0+L8wqBrSlsgVBcb+THbbTGNJFlqZp/D3QU0gOXmHcp16A0+wQgeYPfh3+hQxQIA+csMIzBjLApoHH9yDgFKdtJ2vwt4B4jLSStsa2K1mphnx6OeQgZjR9dHG7g==", "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775823619; c=relaxed/simple;\n\tbh=qm3xQcBXEr96lL4hegVcj0UIOMtgXH0StGBPsgVLlKQ=;\n\th=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version:\n\t Content-Type;\n b=pwhTH/LlUysvxt6vG27EW+1KliR/E+ys+ncaLsBtCQpNsutspYmuCZ/dM1/T0l1bMcgxe8mnNNNiGytS4ehowhA381vCThIj6rRzvr/dbzvxnhM10vjC2fit5bhUabiuDCFUYWFrZF7EGkGvX4DH+g2Z1iTk/1akeJKEL9fok4w=" ], "ARC-Authentication-Results": [ "i=2; gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=C7az2CYX; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15757-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org", "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=C7az2CYX; arc=none smtp.client-ip=10.30.226.201" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1775823619;\n\tbh=qm3xQcBXEr96lL4hegVcj0UIOMtgXH0StGBPsgVLlKQ=;\n\th=Date:From:To:Cc:Subject:References:From;\n\tb=C7az2CYXx68wjErxLRkuWTeHqh2CiNCWSqYoEW7CDASKgYcRJIgZbMFxC0wyGwYuo\n\t q2wWS5Il3rSZIvkXMrziJDymJeOKDwzCu+GiLTUQ15ObFw+7EBHLm3ubP5lL1H6hxr\n\t ReCtVW/VKZ0Y6HBv+Xxa78vZHjPEyhGg6WzSGQLG1W0Tyuqe7kgGZgc8KKs+JzIX6a\n\t qzTQ3qBxeH5MKjO5ANy/+fOcCKNQ7HWyamJ7hE6VNKzzJsl13+xyi236101/gCvlT5\n\t hn6GusmLxuTParC929bCg39takaaNPRV5A3bS+11CTndJSbqW1MjcdkxKmUqQfmLua\n\t lqUqNEa3EnLWw==", "Date": "Fri, 10 Apr 2026 14:20:16 +0200", "Message-ID": "<20260410120319.064561422@kernel.org>", "User-Agent": "quilt/0.68", "From": "Thomas Gleixner <tglx@kernel.org>", "To": "LKML <linux-kernel@vger.kernel.org>", "Cc": "\"Jason A. Donenfeld\" <Jason@zx2c4.com>,\n Arnd Bergmann <arnd@arndb.de>,\n x86@kernel.org,\n Lu Baolu <baolu.lu@linux.intel.com>,\n iommu@lists.linux.dev,\n Michael Grzeschik <m.grzeschik@pengutronix.de>,\n netdev@vger.kernel.org,\n linux-wireless@vger.kernel.org,\n Herbert Xu <herbert@gondor.apana.org.au>,\n linux-crypto@vger.kernel.org,\n Vlastimil Babka <vbabka@kernel.org>,\n linux-mm@kvack.org,\n David Woodhouse <dwmw2@infradead.org>,\n Bernie Thompson <bernie@plugable.com>,\n linux-fbdev@vger.kernel.org,\n \"Theodore Tso\" <tytso@mit.edu>,\n linux-ext4@vger.kernel.org,\n Andrew Morton <akpm@linux-foundation.org>,\n Uladzislau Rezki <urezki@gmail.com>,\n Marco Elver <elver@google.com>,\n Dmitry Vyukov <dvyukov@google.com>,\n kasan-dev@googlegroups.com,\n Andrey Ryabinin <ryabinin.a.a@gmail.com>,\n Thomas Sailer <t.sailer@alumni.ethz.ch>,\n linux-hams@vger.kernel.org,\n Richard Henderson <richard.henderson@linaro.org>,\n linux-alpha@vger.kernel.org,\n Russell King <linux@armlinux.org.uk>,\n linux-arm-kernel@lists.infradead.org,\n Catalin Marinas <catalin.marinas@arm.com>,\n Huacai Chen <chenhuacai@kernel.org>,\n loongarch@lists.linux.dev,\n Geert Uytterhoeven <geert@linux-m68k.org>,\n linux-m68k@lists.linux-m68k.org,\n Dinh Nguyen <dinguyen@kernel.org>,\n Jonas Bonn <jonas@southpole.se>,\n linux-openrisc@vger.kernel.org,\n Helge Deller <deller@gmx.de>,\n linux-parisc@vger.kernel.org,\n Michael Ellerman <mpe@ellerman.id.au>,\n linuxppc-dev@lists.ozlabs.org,\n Paul Walmsley <pjw@kernel.org>,\n linux-riscv@lists.infradead.org,\n Heiko Carstens <hca@linux.ibm.com>,\n linux-s390@vger.kernel.org,\n \"David S. Miller\" <davem@davemloft.net>,\n sparclinux@vger.kernel.org", "Subject": "[patch 22/38] random: Provide CONFIG_ARCH_HAS_RANDOM_ENTROPY", "References": "<20260410120044.031381086@kernel.org>", "Precedence": "bulk", "X-Mailing-List": "linux-ext4@vger.kernel.org", "List-Id": "<linux-ext4.vger.kernel.org>", "List-Subscribe": "<mailto:linux-ext4+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-ext4+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "X-Spam-Status": "No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org" }, "content": "Chasing down to what random_get_entropy() resolves is a 'spot the mouse'\ngame through a maze of #ifdeffery. Also the placement in timex.h is\nnon-obvious and has just been chosen because it provides conveniant access\nto the underlying get_cycles() #ifdeffery.\n\nProvide a config switch which is selectable by the architecture and a\ntemporary #ifdef guard in timex.h. Architectures which select the config\nswitch must provide asm/random.h with the architecture specific\nimplementation.\n\nUpdate all usage sites to include linux/random.h so that the gradual\nconversion does not cause build regressions.\n\nThis is part of a larger effort to remove get_cycles() usage from\nnon-architecture code.\n\nSigned-off-by: Thomas Gleixner <tglx@kernel.org>\nCc: \"Jason A. Donenfeld\" <Jason@zx2c4.com>\n---\n arch/Kconfig | 3 +++\n arch/loongarch/kernel/relocate.c | 1 +\n arch/mips/kernel/relocate.c | 1 +\n crypto/jitterentropy-kcapi.c | 1 +\n include/linux/random.h | 15 +++++++++++++++\n include/linux/timex.h | 2 ++\n kernel/kcsan/core.c | 1 +\n 7 files changed, 24 insertions(+)", "diff": "--- a/arch/Kconfig\n+++ b/arch/Kconfig\n@@ -370,6 +370,9 @@ config ARCH_HAS_CPU_FINALIZE_INIT\n config ARCH_HAS_DELAY_TIMER\n \tbool\n \n+config ARCH_HAS_RANDOM_ENTROPY\n+\tbool\n+\n # The architecture has a per-task state that includes the mm's PASID\n config ARCH_HAS_CPU_PASID\n \tbool\n--- a/arch/loongarch/kernel/relocate.c\n+++ b/arch/loongarch/kernel/relocate.c\n@@ -9,6 +9,7 @@\n #include <linux/kernel.h>\n #include <linux/printk.h>\n #include <linux/panic_notifier.h>\n+#include <linux/random.h>\n #include <linux/start_kernel.h>\n #include <asm/bootinfo.h>\n #include <asm/early_ioremap.h>\n--- a/arch/mips/kernel/relocate.c\n+++ b/arch/mips/kernel/relocate.c\n@@ -19,6 +19,7 @@\n #include <linux/libfdt.h>\n #include <linux/of_fdt.h>\n #include <linux/panic_notifier.h>\n+#include <linux/random.h>\n #include <linux/sched/task.h>\n #include <linux/start_kernel.h>\n #include <linux/string.h>\n--- a/crypto/jitterentropy-kcapi.c\n+++ b/crypto/jitterentropy-kcapi.c\n@@ -42,6 +42,7 @@\n #include <linux/fips.h>\n #include <linux/kernel.h>\n #include <linux/module.h>\n+#include <linux/random.h>\n #include <linux/slab.h>\n #include <linux/time.h>\n #include <crypto/internal/rng.h>\n--- a/include/linux/random.h\n+++ b/include/linux/random.h\n@@ -139,4 +139,19 @@ int random_online_cpu(unsigned int cpu);\n extern const struct file_operations random_fops, urandom_fops;\n #endif\n \n+unsigned long random_get_entropy_fallback(void);\n+\n+/*\n+ * random_get_entropy() is used by the /dev/random driver in order to extract\n+ * entropy via the relative unpredictability of when an interrupt takes places\n+ * versus a high speed, fine-grained timing source or cycle counter. Since it\n+ * will be occurred on every single interrupt, it must have a very low\n+ * cost/overhead.\n+ *\n+ * If an architecture does not provide it, then use random_get_entropy_fallback().\n+ */\n+#ifdef CONFIG_ARCH_HAS_RANDOM_ENTROPY\n+#include <asm/random.h>\n+#endif\n+\n #endif /* _LINUX_RANDOM_H */\n--- a/include/linux/timex.h\n+++ b/include/linux/timex.h\n@@ -66,6 +66,7 @@ unsigned long random_get_entropy_fallbac\n \n #include <asm/timex.h>\n \n+#ifndef CONFIG_ARCH_HAS_RANDOM_ENTROPY\n #ifndef random_get_entropy\n /*\n * The random_get_entropy() function is used by the /dev/random driver\n@@ -85,6 +86,7 @@ unsigned long random_get_entropy_fallbac\n #define random_get_entropy()\trandom_get_entropy_fallback()\n #endif\n #endif\n+#endif\n \n /*\n * SHIFT_PLL is used as a dampening factor to define how much we\n--- a/kernel/kcsan/core.c\n+++ b/kernel/kcsan/core.c\n@@ -18,6 +18,7 @@\n #include <linux/moduleparam.h>\n #include <linux/percpu.h>\n #include <linux/preempt.h>\n+#include <linux/random.h>\n #include <linux/sched.h>\n #include <linux/string.h>\n #include <linux/uaccess.h>\n", "prefixes": [ "22/38" ] }