From patchwork Mon Sep 9 07:05:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 827706 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AC9613AD1C; Mon, 9 Sep 2024 07:08:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725865700; cv=none; b=G8QhHaMlz9KZmATQu6IRxJdK4u6nErBgN26TVfJNfy0uHRThkg0DYvm/iN9R/yipZGvzHOyFw4KLsmllGl890lrw38kVE5DJ+zTMSO/oNUw6laP5SncdXB0fV9QsCDBzi5YbfiyWCHWiqYiUs6/X+QBUD/w4o8D+g8I5TYB02PY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725865700; c=relaxed/simple; bh=RMuc+tRrmkYpvFs6XoBT06qJxFcaXeP4F1UTo91Sw8M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XN1mEvb25jSIz0dnZCLqJSof+UfmsMvtCrJA57UM3VfHm4KRjjj2EmzcfNEsM9bF/Zn45X1cmGuashpP6yEdtxNz3BB9IzNwi9Boa1U/wJDWJnBW7rLySId/MgupNZ8isVyvIFPkAbjAuD7Y8s4T2yezG1AwcpIa2sGITi7uwmM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lS78+Lk2; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lS78+Lk2" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-374c962e5adso2152152f8f.1; Mon, 09 Sep 2024 00:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725865697; x=1726470497; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=miIa0uylE1UFUz+fjwRH8q3H5W2F4hzW6ItDHV+UbYY=; b=lS78+Lk2n0ieNORBO1hGCGQVQDgpLFx6HylIWYw8Sxy2cOXjOt+l4H4tl+y2RwmOea ZSMKU8Ej6MgRoV1iuEm61vqHzl6xM0tFIqqIFU8bLhDzMSrWwoGGqdSuK/hh7R3s360B I1F38/vPKRUCdCoWR8QEs5m6c1G6cb8P1eNUxs7TPmEAfxDzkhtP88rj1ROJxnHRNB/g bs+SBMMZpLRM7ofqEbOx6lh+5kiwE3daMsrVXSZmS8x2r/Z9DekUZZfYTA4rIV+tqYRY j132atV8ba3MXRI7BchBBvyATnhDCGrKXXFaNHI47ucQ7zs2ONQh85j6wkuVOCybxrKW Tuhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725865697; x=1726470497; 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=miIa0uylE1UFUz+fjwRH8q3H5W2F4hzW6ItDHV+UbYY=; b=ipZxceh+e7QNLM5o7It0inLXheh3BmLQzhdcFl7K1oL7ebl6hOQF8b7MZksy4Vwu6e kjP9o8769WcuuVn9G58vk4JXyaotYhoEd076qTTgZbBrR0LuNjCxaxacyIRc2340zsDR GyxQ7W0ZEWGaArYHTSkRnHWowtXJR60U4bZLnt64SouKMhwRtxzsiUeXt5DmgHm5LvjW za68R2JkmJvHyx8B6Gd/DYMD1JBNr1xaTnRckxopYfA/ySSrUXvOKENUXC0xmCNZrdHB JgQznA6wLe8ebTzfKTYuKClhNjLTyiLYjcZFJqDy99/IKQJ5KQKqi8H1Nh5/l6eSqL1L fiRw== X-Forwarded-Encrypted: i=1; AJvYcCV7l2g2Sb7Cg/5lzYGfLWEsdql4VJ31wz95O6FCrVKGvDViDbb1su1wXyK2owUHl7qEgFBAkuBd7HRbmqUO+Ymn@vger.kernel.org, AJvYcCVhc5NMFEVHJ1t0l4IxbhdQ+hqn1mFONYU1+U9p307RfT0DIBlpDShtFvUE71IfGc7pCA/XZVXAp9FqDXA=@vger.kernel.org, AJvYcCWBw7PtNFPsCJFS1gpnEx+cNZA7T9DXXtC2TFQ/i/TevjGW7tYMyRaWFoA5bJmq07vyq+l5Kko6dx3pDw==@vger.kernel.org, AJvYcCWRwbk6pSI6smdN7QpZdgtOp1LjbFUtz7hF59Mxb9Bv0rP8HHODYPe193Hk+NnSC6ovdX6ZQh8jvJM0+TIboQ==@vger.kernel.org, AJvYcCX5h0TXHKAbcOebbm2m+ddCFiJwdGq6ieCPxTnIwHdVwJAZ2mfz6WJym612Fs5tATiws+YlHlLu6H++Zh6e@vger.kernel.org, AJvYcCXT4ysz5bf/O4MXm/T0DR2BMEql4inr+3EMLGYbTl3KxhoUujfJxCZepW9oZ6ihdjNFJds=@vger.kernel.org X-Gm-Message-State: AOJu0YzrYzhZET3c08dQ9B/FVT/iO4XfCf3VMd+WnV1kFz6x3fveUP0X 6FzqUBgdQpZQHtcJxtYiuwYVwwWjcElWygGifuETZvGgZ26bV9ol X-Google-Smtp-Source: AGHT+IF7PvU559w9RG/+WWePAWHfln7qrp/xZmFruXqBgk/EtXWofmJCF9Gu7pllhU4Q5vs+uudvoA== X-Received: by 2002:a5d:4146:0:b0:367:938f:550 with SMTP id ffacd0b85a97d-3779bb2e591mr10665534f8f.25.1725865696041; Mon, 09 Sep 2024 00:08:16 -0700 (PDT) Received: from fedora.iskraemeco.si ([193.77.86.250]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956d375asm5178754f8f.66.2024.09.09.00.08.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 00:08:15 -0700 (PDT) From: Uros Bizjak To: x86@kernel.org, linux-crypto@vger.kernel.org, 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 Cc: Uros Bizjak , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "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 Subject: [PATCH v2 00/19] random: Resolve circular include dependency and include Date: Mon, 9 Sep 2024 09:05:14 +0200 Message-ID: <20240909070742.75425-1-ubizjak@gmail.com> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 the 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-- We would like to include in . In [1] we would like to repurpose __percpu tag as a named address space qualifier, where __percpu macro uses defines from . The major roadblock to inclusion of is the above mentioned legacy inclusion of in that causes circular include dependency that prevents inclusion. This patch series is the "nice cleanup" part that: a) Substitutes the inclusion of with the inclusion of where needed (patches 1 - 17). b) Removes legacy inclusion of from (patch 18). c) Includes in (patch 19). 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: Kent Overstreet --- v2: - Reword commit messages to mention the removal of legacy inclusion of from - Add missing substitution in crypto/testmgr.c (reported by kernel test robot) - Add Acked-by:. Uros Bizjak (19): x86/kaslr: Include instead of crypto: testmgr: 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 in fs/crypto/keyring.c 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 in prandom: Include in arch/x86/mm/kaslr.c | 2 +- crypto/testmgr.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 | 1 + 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 + 23 files changed, 22 insertions(+), 24 deletions(-)