Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp370709imn; Mon, 25 Jul 2022 19:51:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tYh/qW9+madfOsG3TnCn6q38hxMkX2x8wSD6Zm+NW/dCpu1fVabsrTOkqgu7aV6MinXJEq X-Received: by 2002:a05:6402:35c2:b0:43c:22d8:18b6 with SMTP id z2-20020a05640235c200b0043c22d818b6mr5277105edc.275.1658803903205; Mon, 25 Jul 2022 19:51:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658803903; cv=none; d=google.com; s=arc-20160816; b=X9zbW19uhPxxiA5CHogl1iqYxBS8y5GzZTaLWKIAGBt85koecPV+SX1CYbUa62Y8HY 2PwTsKKAJSc8Q0mf81rKtCqfIsIE3rUj8i3qkjKQ+Z9psBTfUpLw6u91EbvExTeuSRDM +H2+zGokWaRgWFz3CzZ7RO5lcPIjVNqHRdjtZ3baJhKSmdtUnG65BLx9I5K47nf1Ma1n HP6L2Jaa5ohtHSqVEhijHrwWYb7k1sW8kXScWWDjPcZ4f0b4kKHOrwuRhXQKHOGP7fRD RY3dBNRH1qJ4oMjZ61QGOyZBruw05N0G4mCiZfqGOOAaE4P9HuL973TkvCKRhNPRnfQJ av2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=d3mL1k1NMT34C1y5QN9NQJ5hVYOTx4F+h/uvzQ4WTp0=; b=sYcniLInsaYzCNrw4ODtG2ElivvOJcImwf4NHKP97YKAk0IjXMU/6WAei4UyLdUgoR JT7jYGJ3zz8bGi+B887GoNe/14wEUBBSXFD8YxQPtsAybzllZJmkf3ZVmed/wEOzOQym zzV83ek3F9CtZj02uFhYDJsEtI89hzDPsSMyyJt+59fmoEofaIYoXQJohqIvtSTQYTcX rSq7l9jzVNBom9vTs/GnkNKg3SZGBJjVEXjBCQ7eeSI7UV73lJ7wTRoguzT2eNP832ff EKi9BMLNAHIpy9E14+vg+US189lxX9hUORhBNLuKs4kr4cZ4fM3f+J6saETcen/D3kUm nsgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=IS9n5yJ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a1709064fc800b0072af12ec70asi18410455ejw.121.2022.07.25.19.51.17; Mon, 25 Jul 2022 19:51:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=IS9n5yJ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231482AbiGZCq6 (ORCPT + 99 others); Mon, 25 Jul 2022 22:46:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbiGZCq4 (ORCPT ); Mon, 25 Jul 2022 22:46:56 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97F30A1A5 for ; Mon, 25 Jul 2022 19:46:53 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4LsLsQ6nVXz4xD7; Tue, 26 Jul 2022 12:46:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1658803612; bh=d3mL1k1NMT34C1y5QN9NQJ5hVYOTx4F+h/uvzQ4WTp0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=IS9n5yJ30hjXD+pYI3Rk6esf6g8We4+3Te4njNGWL0U+0I/5NauF8044UfZ7tQZqN kA4ym1Ke5i2zt+ILiJCArZ0Kfld8wAGzNU8BoFCQ0j5zdxYM1PXXYT9tKpYZEUw2uI lUaHSEEoTFEwM6XCtfBl1PvdETJT0B6DX+s7LXQI1Q8ehD46urKMpC1NhRgBNmYrVU ThRZkpPq5nwBcLEDAJdfqwTWUpMM3497q+2EurUa44g0em7q4uzgNtBBkrdb+U9v93 46VqWBXvBZeO1rmxeotOVt21TswCPy0gfy+e413vIlFDoXYxonBIbTd2GuamtoO/6Q JfYKQI8Pt/CVA== From: Michael Ellerman To: Yury Norov Cc: linux-kernel@vger.kernel.org, Andy Shevchenko , Rasmus Villemoes , linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt , Paul Mackerras , Stephen Rothwell Subject: Re: [PATCH 1/2] powerpc: drop dependency on in archrandom.h In-Reply-To: References: <20220723214537.2054208-1-yury.norov@gmail.com> <20220723214537.2054208-2-yury.norov@gmail.com> <8735epd204.fsf@mpe.ellerman.id.au> <87wnc1bcwa.fsf@mpe.ellerman.id.au> Date: Tue, 26 Jul 2022 12:46:49 +1000 Message-ID: <87h734bnfq.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yury Norov writes: > On Mon, Jul 25, 2022 at 10:22:13PM +1000, Michael Ellerman wrote: >> Michael Ellerman writes: >> > Yury Norov writes: >> >> archrandom.h includes to refer ppc_md. This causes >> >> circular header dependency, if generic nodemask.h includes random.h: >> >> >> >> In file included from include/linux/cred.h:16, >> >> from include/linux/seq_file.h:13, >> >> from arch/powerpc/include/asm/machdep.h:6, >> >> from arch/powerpc/include/asm/archrandom.h:5, >> >> from include/linux/random.h:109, >> >> from include/linux/nodemask.h:97, >> >> from include/linux/list_lru.h:12, >> >> from include/linux/fs.h:13, >> >> from include/linux/compat.h:17, >> >> from arch/powerpc/kernel/asm-offsets.c:12: >> >> include/linux/sched.h:1203:9: error: unknown type name 'nodemask_t' >> >> 1203 | nodemask_t mems_allowed; >> >> | ^~~~~~~~~~ >> >> >> >> Fix it by removing dependency from archrandom.h >> >> >> >> Signed-off-by: Yury Norov >> >> --- >> >> arch/powerpc/include/asm/archrandom.h | 9 +-------- >> >> arch/powerpc/kernel/setup-common.c | 11 +++++++++++ >> >> 2 files changed, 12 insertions(+), 8 deletions(-) >> >> >> >> diff --git a/arch/powerpc/include/asm/archrandom.h b/arch/powerpc/include/asm/archrandom.h >> >> index 9a53e29680f4..21def59ef1a6 100644 >> >> --- a/arch/powerpc/include/asm/archrandom.h >> >> +++ b/arch/powerpc/include/asm/archrandom.h >> >> @@ -4,7 +4,7 @@ >> >> >> >> #ifdef CONFIG_ARCH_RANDOM >> >> >> >> -#include >> >> +bool __must_check arch_get_random_seed_long(unsigned long *v); >> >> >> >> static inline bool __must_check arch_get_random_long(unsigned long *v) >> >> { >> >> @@ -16,13 +16,6 @@ static inline bool __must_check arch_get_random_int(unsigned int *v) >> >> return false; >> >> } >> >> >> >> -static inline bool __must_check arch_get_random_seed_long(unsigned long *v) >> >> -{ >> >> - if (ppc_md.get_random_seed) >> >> - return ppc_md.get_random_seed(v); >> >> - >> >> - return false; >> >> -} >> > >> > I'd rather we didn't have to force this out of line. >> > >> > I think I see a different way to fix it, I'll just do some more build >> > tests. >> >> Of course my idea didn't work :} >> >> So I'll just ack your patch for now, and maybe I can get the headers >> cleaned up in future to allow it to be out-of-line again. > > I understand that it looks like a tradeoff - we inline a couple of small > functions with the cost of uninlining an almost innocent victim. Yeah. The truth is the cost to access the RNG will far outweigh the cost of that out-of-line call, so there's no real issue. But it's also such a small function that it just cries out to be inlined :) > The complete solution would be probably a splitting ppc_md declaration > out of asm/machdep.h. I wanted to do that, but I'm not a PPC guy, and > just don't know how to split the header correctly. I managed to drop the includes of seq_file.h and dma-mapping.h, which seemed to fix the circular include problem, but there's a bit of fall out in unrelated files. I think I can get that sorted though eventually. > Anyways, thanks for the ack. Applied on bitmap-for-next. No worries. cheers