Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2690942iof; Wed, 8 Jun 2022 10:01:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxw9fOidXye/cOuYThoSQ8ifjJ8M0UCtEEkgARVAWLJ7fWAZgfH85C8YwmMzxWeTM7hlTvw X-Received: by 2002:a63:3184:0:b0:3fc:5893:c866 with SMTP id x126-20020a633184000000b003fc5893c866mr31132585pgx.56.1654707683591; Wed, 08 Jun 2022 10:01:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654707683; cv=none; d=google.com; s=arc-20160816; b=LaszEUeoV0Wif2NACvK9vvnMHmvlLNdk/9NodtGBiSPDiOCeGBUGk5+unDla7a4GAa ZbR8u4sLZR75JDN2YpEFwwxFLRYnv0De844eDpb1KEL5TFi1leSncwv18LLedzc+h5DS ENGyQpdu9j/Lzx7UNuA3tze/kKg5XQkaU4IwORHkVTwAp9Fa1jzcUs1xRjwrlOnK0buA Nc8XKPFZt32D4nwpnJ8cGxGQh8JmbGV9vKxeEj3fzAZvK9nDlggp9fswDRaIKUdqE36/ d1gcWhAz+11Sef/wwqjDS24ZSAW3vgRjtNLXZe0CyftNGZ5ApjgWOkeSpl6cTAP44Yw2 Fd/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PxkU1zqSpy3+j4QBEZfELzSFwLGuTltk4n6Ro6hW0SE=; b=qsgSd/Y7fbs0uoazxXAgM1zNPmF7bFphMXI7fY1HgxKHnOm5QPhV1c47iaiV1nAsit iaNQZwJgGII2aBlU3jQROBQdQfo4XNiqpeZuYcvRm1DSw+IiJmZpIcP5BR208FY+sgx0 tDd0pQ5lDw4BHR4FfzSfuWPgLQ8bWBz5BAxxGw9m2wj2nWpxQ+tbF7ddV6gQOqb8+hPn 040PQ/A3RGtGAS6kpnPOyAkeaKB2jv2caoREkv+35+CxyFY1l8Bpqg3ar8REUW2FLw1v 3fH9xYxARWGT4fomCjixuctmvS1vVdRDhjHPQ0GEXpFSwPOH9WfdDDrmp94zFKWlwJgW 4j4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y0iV9olU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u5-20020a170902e5c500b00163a6be1210si31515656plf.228.2022.06.08.10.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 10:01:23 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y0iV9olU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 61D5B254478; Wed, 8 Jun 2022 09:31:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245515AbiFHQbM (ORCPT + 99 others); Wed, 8 Jun 2022 12:31:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343541AbiFHQbA (ORCPT ); Wed, 8 Jun 2022 12:31:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BAEE24792B for ; Wed, 8 Jun 2022 09:29:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A332461900 for ; Wed, 8 Jun 2022 16:29:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76102C3411D; Wed, 8 Jun 2022 16:29:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654705775; bh=Rl+DUn/Nzlxn4nlbJanjmwhDoU4icyUwT8ssx2EkXCs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y0iV9olUahbUYftDKWhbviAUNLNB6RMv87CvNijiYZZQUVVXNYYJT3gP7/0+lEjZB hElkhcZJCfcUII6GJh8rEoRFr7BqZ0Z+F7dpPS33V/tD8SJsf2HJTZHCGGl+84O2vK juvkd8yiWoboAfKsckJzf8gQMubWwBbkv5+98hJFU/cq/sgOBq5d39GRTkks/dABRL /BMsME2Va5LAjG9J7Eu2+pbcdIG8aDJ1CAt2TkHtyHEKwziYeQiJ2nDitm+Dy9flHM 23zN5b/0zb0x/bqQWaRx9J4+s3jWcwSkl4Y2S+WnWz9jC87ceClq0BBEg6XGh4WnDA nMnoxx4bx3bWA== Date: Thu, 9 Jun 2022 00:20:52 +0800 From: Jisheng Zhang To: "Jason A. Donenfeld" Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Stephen Boyd , Phil Elwell , Ard Biesheuvel , Russel King , Catalin Marinas , Paul Walmsley , Palmer Dabbelt Subject: Re: [PATCH] riscv: initialize jump labels before early_init_dt_scan() Message-ID: References: <20220607195752.1146431-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220607195752.1146431-1-Jason@zx2c4.com> X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Tue, Jun 07, 2022 at 09:57:52PM +0200, Jason A. Donenfeld wrote: > Stephen reported that a static key warning splat appears during early > boot on arm64 systems that credit randomness from device trees that > contain an "rng-seed" property, because the dtb is parsed is called > before jump_label_init() during setup_arch(), which was fixed by > 73e2d827a501 ("arm64: Initialize jump labels before > setup_machine_fdt()"). > > The same basic issue applies to RISC-V as well. So this commit moves the > call to jump_label_init() just before early_init_dt_scan(). > jump_label_init() actually requires sbi_init() to be called first for Moving the sbi_init() earlier has been sent out but the patch is missing in 5.19-rc1 https://lore.kernel.org/linux-riscv/20220521143456.2759-1-jszhang@kernel.org/T/#m00c3cb5e4e360ca8d7aa10c79c10437b7307c16c > proper functioning, so it also moves that to the right place. > > Reported-by: Stephen Boyd > Reported-by: Phil Elwell > Cc: Ard Biesheuvel > Cc: Russel King > Cc: Catalin Marinas > Cc: Paul Walmsley > Cc: Palmer Dabbelt > Fixes: f5bda35fba61 ("random: use static branch for crng_ready()") > Signed-off-by: Jason A. Donenfeld > --- > arch/riscv/kernel/setup.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c > index f0f36a4a0e9b..c44c81b1cfb3 100644 > --- a/arch/riscv/kernel/setup.c > +++ b/arch/riscv/kernel/setup.c > @@ -263,13 +263,15 @@ static void __init parse_dtb(void) > > void __init setup_arch(char **cmdline_p) > { > + early_ioremap_setup(); > + sbi_init(); > + jump_label_init(); > + > parse_dtb(); > setup_initial_init_mm(_stext, _etext, _edata, _end); > > *cmdline_p = boot_command_line; > > - early_ioremap_setup(); > - jump_label_init(); > parse_early_param(); > > efi_init(); > @@ -285,7 +287,6 @@ void __init setup_arch(char **cmdline_p) > misc_mem_init(); > > init_resources(); > - sbi_init(); > > #ifdef CONFIG_KASAN > kasan_init(); > -- > 2.35.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv