From patchwork Thu Sep 5 12:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 13792247 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8CD6CD5BB7 for ; Thu, 5 Sep 2024 12:20:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C74B10E86B; Thu, 5 Sep 2024 12:20:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VJv7FSE8"; dkim-atps=neutral Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id BBC0E10E86B; Thu, 5 Sep 2024 12:20:28 +0000 (UTC) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42bbe908380so5803705e9.2; Thu, 05 Sep 2024 05:20:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725538827; x=1726143627; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3/jh7PZokx9IFNSzbVHcZfaNGnzkrP5bD95SXRchUZc=; b=VJv7FSE88hVXVwRggxGas/nxy3i8cstnLHERKaRP2Re62sGbfmt7bcEJFhqi4o9KEA rtMH+3QC1wagSNv6kmEaKSSquRViwNExoenu2TzP1cbMlkW5EtkcZGA5DOJdjE2BzbJu ph+YwjLcQzATfwZh8UPF/N6cYRIRgw0jL3eAl9OCdGD269I1kya/vFaya7/R9fNYxXsv 8zSHODz6/+SM5PKrFwiQ5J+YDwn62WQbQxZ2KSGgyOh93O0xjumfYGfe61/7H+JDSxjp 6YaQQT57mjKJ41iKdcCUPK51TVKziKmXttsw7EbdAauTJ9uzf3WUE+KqDC+PoMIjswrp erHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725538827; x=1726143627; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3/jh7PZokx9IFNSzbVHcZfaNGnzkrP5bD95SXRchUZc=; b=djCZUBpBy4hEIs2vNZhjcUcOqAqnoqiSnGoRzO0nMfhod0mYu0arpY0BCTFA/FHyiV hiDcbD4xn3GRGW4lVbKGpZOzctSmZTiAPQPtYFvyzLNE+xobllrybgaDJsTVCnao/Lqi S5kMESPkjP1dngG20g2CNfX4FDKO6PdZbvz1EPCcs+Z28znZNwm2gmte37oR0eJdQ//u D7UxbItn5Vl24OE3DnZBMn4z7vpbyzj2I+OdzK5ROtAwyEYWTA5kYnF13KeswkoE8fi4 DZeRxjgTJwhaUhXDsmZdawyJwQO65xa7gZNaR/rAXMY6KP3PWOamUakkQOhdpvVjxg9u UN5g== X-Forwarded-Encrypted: i=1; AJvYcCURHmLatdLMYbxwF/sTuce7OCiR0cKtTEts4zqWrdHOdRrxGuSUel/GSbxnYTKPT+qUzr0AobFUglk=@lists.freedesktop.org, AJvYcCXBgY5YlhBXUUYz/Y2SxEwlRtVBGP9TLMJaNKE2naArBjcLTZZ0efd6tudy9S1UNGdnkHuSgpHplvRG@lists.freedesktop.org X-Gm-Message-State: AOJu0YxHOjaJ+qFMqYqJ5dWQK7Gw45H1GyChv7S71kggK2pp0+tStNd1 qAa62ZjjKUr0NOmEKIOJDfYiaRNoBv89Pspqn5kcHjG5V9wGumpe X-Google-Smtp-Source: AGHT+IGWPyCho2CwtU7ltqrAmM8Ihsxd2i3XPne6K7qzyDA9oAvQKOeAenEfeGB2Pd/DmOGVTlsXwA== X-Received: by 2002:a05:600c:4eca:b0:426:5471:156a with SMTP id 5b1f17b1804b1-42bdc6334cbmr128537975e9.13.1725538826233; Thu, 05 Sep 2024 05:20:26 -0700 (PDT) Received: from fedora.iskraemeco.si ([193.77.86.250]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e27364sm230390515e9.34.2024.09.05.05.20.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 05:20:25 -0700 (PDT) From: Uros Bizjak To: linux-kernel@vger.kernel.org Cc: Uros Bizjak , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Hans Verkuil , Mauro Carvalho Chehab , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Eric Biggers , "Theodore Y. Ts'o" , Jaegeuk Kim , "Jason A. Donenfeld" , Linus Torvalds , Hannes Reinecke , "James E.J. Bottomley" , "Martin K. Petersen" , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Andrew Morton , Brendan Higgins , David Gow , Rae Moar , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jiri Pirko , Petr Mladek , Steven Rostedt , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , Stephen Hemminger , Jamal Hadi Salim , Cong Wang , Kent Overstreet , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-mtd@lists.infradead.org, linux-fscrypt@vger.kernel.org, linux-scsi@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Subject: [PATCH 00/18] random: Include and resolve circular include dependency Date: Thu, 5 Sep 2024 14:17:08 +0200 Message-ID: <20240905122020.872466-1-ubizjak@gmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There were several attempts to resolve circular include dependency after the addition of percpu.h: 1c9df907da83 ("random: fix circular include dependency on arm64 after addition of percpu.h"), c0842fbc1b18 ("random32: move the pseudo-random 32-bit definitions to prandom.h") and finally d9f29deb7fe8 ("prandom: Remove unused include") that completely removes inclusion of . Due to legacy reasons, includes , but with the commit entry remark: --quote-- A further cleanup step would be to remove this from entirely, and make people who use the prandom infrastructure include just the new header file. That's a bit of a churn patch, but grepping for "prandom_" and "next_pseudo_random32" "struct rnd_state" should catch most users. But it turns out that that nice cleanup step is fairly painful, because a _lot_ of code currently seems to depend on the implicit include of , which can currently come in a lot of ways, including such fairly core headfers as . So the "nice cleanup" part may or may never happen. --/quote-- __percpu tag is currently defined in include/linux/compiler_types.h, so there is no direct need for the inclusion of . However, in [1] we would like to repurpose __percpu tag as a named address space qualifier, where __percpu macro uses defines from . This patch series is the "nice cleanup" part, and allows us to finally include in prandom.h. The whole series was tested by compiling the kernel for x86_64 allconfig and some popular architectures, namely arm64 defconfig, powerpc defconfig and loongarch defconfig. [1] https://lore.kernel.org/lkml/20240812115945.484051-4-ubizjak@gmail.com/ Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: David Airlie Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: Hans Verkuil Cc: Mauro Carvalho Chehab Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: Eric Biggers Cc: "Theodore Y. Ts'o" Cc: Jaegeuk Kim Cc: "Jason A. Donenfeld" Cc: Linus Torvalds Cc: Hannes Reinecke Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: John Fastabend Cc: Andrii Nakryiko Cc: Martin KaFai Lau Cc: Eduard Zingerman Cc: Song Liu Cc: Yonghong Song Cc: KP Singh Cc: Stanislav Fomichev Cc: Hao Luo Cc: Jiri Olsa Cc: Andrew Morton Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Jiri Pirko Cc: Petr Mladek Cc: Steven Rostedt Cc: Andy Shevchenko Cc: Rasmus Villemoes Cc: Sergey Senozhatsky Cc: Stephen Hemminger Cc: Jamal Hadi Salim Cc: Cong Wang Cc: Uros Bizjak Cc: Kent Overstreet Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: linux-media@vger.kernel.org Cc: linux-mtd@lists.infradead.org Cc: linux-fscrypt@vger.kernel.org Cc: linux-scsi@vger.kernel.org Cc: bpf@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Cc: kunit-dev@googlegroups.com Uros Bizjak (18): x86/kaslr: Include instead of drm/i915/selftests: Include instead of drm/lib: Include instead of media: vivid: Include in vivid-vid-cap.c mtd: tests: Include instead of fscrypt: Include instead of scsi: libfcoe: Include instead of bpf: Include instead of lib/interval_tree_test.c: Include instead of kunit: string-stream-test: Include instead of random32: Include instead of lib/rbtree-test: Include instead of bpf/tests: Include instead of lib/test_parman: Include instead of lib/test_scanf: Include instead of netem: Include in sch_netem.c random: Do not include prandom: Include arch/x86/mm/kaslr.c | 2 +- drivers/gpu/drm/i915/selftests/i915_gem.c | 2 +- drivers/gpu/drm/i915/selftests/i915_random.h | 2 +- drivers/gpu/drm/i915/selftests/scatterlist.c | 2 +- drivers/gpu/drm/lib/drm_random.h | 2 +- drivers/media/test-drivers/vivid/vivid-vid-cap.c | 1 + drivers/mtd/tests/oobtest.c | 2 +- drivers/mtd/tests/pagetest.c | 2 +- drivers/mtd/tests/subpagetest.c | 2 +- fs/crypto/keyring.c | 2 +- include/linux/prandom.h | 1 + include/linux/random.h | 7 ------- include/scsi/libfcoe.h | 2 +- kernel/bpf/core.c | 2 +- lib/interval_tree_test.c | 2 +- lib/kunit/string-stream-test.c | 1 + lib/random32.c | 2 +- lib/rbtree_test.c | 2 +- lib/test_bpf.c | 2 +- lib/test_parman.c | 2 +- lib/test_scanf.c | 2 +- net/sched/sch_netem.c | 1 + 22 files changed, 21 insertions(+), 24 deletions(-)