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: 825827 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 0A0C019995A; Thu, 5 Sep 2024 12:20:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725538831; cv=none; b=hHHg11C/xH26xPjEFtAgeiyarM2Aoizu0b/Mon9j7TiGMEN5VO1LwBesjoEyynPGBHhX97ULj4lI/Ypy5MA6HzQOC7hbRViuQLwggK6iR7VJA7isBpaelI6Huq0siKtoRFXsCx4sAoHt1ldtxUH3pXOF53nxNSjxO23jTiZNvHQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725538831; c=relaxed/simple; bh=k3d5+rFgYAJki2pkwsH+WHyHFP4ovjkew9/QpqQfEss=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=b4NE2GFkbT1mS3TsJ6cQmdJAdUQF/N6A8LP/Ma7HCwqyzQAEhyA7roE2dnsXbfSQY0d382B2dBhHKPv9TTZblf0K7eKXTDT4CK2x8dy6WFD0x+HlJgeoKBxzIv62mdpLyceR16aiyoPGqSap7muBWzWcXTvJ5XCpZkvrddlFMS4= 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=jdLWvl0m; arc=none smtp.client-ip=209.85.128.50 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="jdLWvl0m" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-42c828c8863so5790195e9.3; 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=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=3/jh7PZokx9IFNSzbVHcZfaNGnzkrP5bD95SXRchUZc=; b=jdLWvl0mvdR9Jvoq0INa17/90TGOp18AC28xjTOr58sKF2qRxZoeS/6d7pGCT2LauO xiviKm0EBUEqljVZPQgwsXlZVTlhJAj4R/AvKAAjniuFpdM6ikuZTIR/xAD5si0DXH6Y 3onRPp8jq3F7EtgjmWZ/t551BH/1Z5EmRxO5CFDz5EeVkH5TUXSB85cJ42tjR30PwhP1 rOJ8qlmWHIuHygSV9VztWMoSGYUCZgyc/Adq7xrXv2GD08qx5qrv+DKtZn81MXWPL4Qc LaPOORanRclL33CX7VXTt4rqNkFzwB049Rt18CMExzpYF/qQug3FmcYeacZKwmasFmxZ lt5g== 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=aHrBp3ub+CkcqX5w/FYlI717uUZLNjIf4IlwI9U0H3skyCd5woiZxtFoDDgepe9qj/ MwQVfOKdtjDFYUFeag/IW1zCB6PqjRwgoFFYUKe4GbbouKVjNMAuVpOY6ub2TKT0mZT7 +yzmI4dij21yWbeyEJn9F0ETWA2e+pQmg/Nk8WH4aWBvxv27ntys252nMsxN68Ool4BH meOa25eGyne/0Jsp3IbZfLPtgwnZCML/kHIWH1KsC+CfCitCdrgF8uoFmGymctkAHKFA 4OmdylYj4wODaf3zNXrQvLUaDnhSx00bbssjEbSK2RsNp55zUMz837UHhnO8fAP36O7Y ZPZg== X-Forwarded-Encrypted: i=1; AJvYcCU5cZ12ln2I+LnLTK7lh+ne3s+39JqB0UF3FxtCrt36nlbITL+mA8qya3+4AO5tZpXoqENOPbNXCocieA==@vger.kernel.org, AJvYcCUlIV1f0OoL6+UBZ1mmCkJ1HZo2AErjapf/uhzLCEouP6lSiIsYIsLuMpyeurU2A5XnhOGzE+ExOmzVCbA=@vger.kernel.org, AJvYcCUt+vt+mcfltrNIII6v3puh1Inn8TSDKODafb+3p8mZmh26WPykmb6c61139fwHXoJ1bUbjpQbFwJZ352YqpQF1@vger.kernel.org, AJvYcCV+cdUmmy5Q7EZwiUxtKFq4eWjmPJCfDcnPCbaZZXIMFIA9YREUFvGgR0AkeWopbVu11aNlGe7Jd0xiU1CMFw==@vger.kernel.org, AJvYcCXafJUJeimifN0VZYW8TGiCXAY1bjaG6MvGdtPisgvJOvD26BwzybmbJc0q4yHl8umkhuo=@vger.kernel.org X-Gm-Message-State: AOJu0YyjRbmANjN48dlOAD/ThK1XlW0kW/VpM920Pbl5ymlpZQ/oeRQR NR/ETZ2KuVTUVrikWoaJ8Ce6xEa7lCkumTizYjOsCMgfygKLpGVTY55SMJlXmIo= 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 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 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(-)