Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26613603rwd; Mon, 3 Jul 2023 12:09:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlEcf1efZIS423Hb548b8qtREv6dNPZRtYOStzJ3+zEy7sur1dCl0S5OPc6uN7HDIJp2CO2E X-Received: by 2002:a05:6a21:7899:b0:12b:f2bf:c3d9 with SMTP id bf25-20020a056a21789900b0012bf2bfc3d9mr11526015pzc.55.1688411370820; Mon, 03 Jul 2023 12:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688411370; cv=none; d=google.com; s=arc-20160816; b=CRC3XXSDrxfUgvZnyCyEadl0jNLMD1sULLDdPn4Qi0ClIgGR/J7cN09XOY/FI3I/S+ 8cs04f2zCkAw6OZuOa3zwIHfeuYfp3pBRYyEZpngRQWGj8u7O67qUWGPwpz8ojyIeJL6 2AqT3/XYhKuElp6DUq1bn5I/54WERRouNG4NIevsAPo4kQaWMN6Y4lWsR45oRrwLAyF9 ncvVFrrR2qVYxVCzfoF6ZD8P7x23bm6HHgxMhuzJZ1HEVyLFQ2duYX2CGpp2qyfB1RQF di/X54xeuVf/EC2ITuR6osMwC/LAqx288CWusslq0Y58fUD5K0Dj9dXm4MF8jj13EGJm 8/kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=MOtc6zCNqfFCNPpF4rY3p1YQeV3pqsAvO5B1y3ur7yo=; fh=KXFMxus5tCuAmjbkXANb/77QV2/VeKubVmTTrn7DMg0=; b=TOGBIQNaTwSFrBUmqL+VCS3csd0JRRtJ+azOz+c90iCYe72pdFR0XYnxanDDgIOi3L dmvHNkjfngZ4pfEhHAOJSCNmcH3tVgD0vp085dOkZzvaciI1To6HnDPWYxXvve2WQPq1 GigSiIJsTcwtFi6Lyhma258Xcpwl3310DKZ7A0yOh4RynMm/NyhrArL7fzlTiuYVzm/I o+o7PVAxznbjpgL6ui9F6d1SibD+jtaBAqAEwwTtoSBxavjkO+NSe+4WagTZHITtLI+S +fqDV5QmT9pDKLKRIHs9Cwx9K0cnqJc7KNP6KeTys7CyGnoLbt7lVmsxuF1ftKFW74bX dGDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BLoUJjEC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t9-20020a170902e84900b001a1e0fd406csi19892915plg.217.2023.07.03.12.09.15; Mon, 03 Jul 2023 12:09:30 -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=@kernel.org header.s=k20201202 header.b=BLoUJjEC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230406AbjGCS6I (ORCPT + 99 others); Mon, 3 Jul 2023 14:58:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229943AbjGCS6H (ORCPT ); Mon, 3 Jul 2023 14:58:07 -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 6E375E64 for ; Mon, 3 Jul 2023 11:58:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0214560FF4 for ; Mon, 3 Jul 2023 18:58:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B090C433C7; Mon, 3 Jul 2023 18:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688410685; bh=AK9PcQaTNxkV/SL5cfvD+YxtSuu86pJE+53SF0Jwwas=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BLoUJjECcMb8kNvQXzqLTa4KDHESnLW3fAkoCfHA12EhmGnDCqYGeIcDaYsdzZsW2 eE1dQeoaqBw3slf8LgWyhXJx/nYZ3F352gDoP857Xy5xcEzx78tlMchOexIHK7n2eH URTUG5iWEyZ1/oy7M2yykaOsta2fxtiEelJz9MjcG9Yes73h4DNh0102YxIZe5693F ORwNjaGX6JcZ75U3/xfiPJXRdDyJz0Joatz0cGrja99PCUG2DmE9vuoyHI4iN4tgI4 jutrdZ5R3pyi4G9YAIJSacqwEwzQaN9uZ9hkl0s6YOQe7lQmZtxwMGA1/7gtYW3Deu 3epwaiSluCu+A== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qGOkN-00AFCj-Fo; Mon, 03 Jul 2023 19:58:03 +0100 Date: Mon, 03 Jul 2023 19:58:03 +0100 Message-ID: <86v8f0x1ok.wl-maz@kernel.org> From: Marc Zyngier To: Palmer Dabbelt Cc: linux-kernel@vger.kernel.org, Conor Dooley , apatel@ventanamicro.com, Linus Torvalds Subject: Re: [PATCH] risc-v: Fix order of IPI enablement vs RCU startup In-Reply-To: References: <20230703183126.1567625-1-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: palmer@rivosinc.com, linux-kernel@vger.kernel.org, conor@kernel.org, apatel@ventanamicro.com, torvalds@linux-foundation.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Mon, 03 Jul 2023 19:45:43 +0100, Palmer Dabbelt wrote: > > On Mon, 03 Jul 2023 11:31:26 PDT (-0700), Marc Zyngier wrote: > > Conor reports that risc-v tries to enable IPIs before telling the > > core code to enable RCU. With the introduction of the mapple tree > > as a backing store for the irq descriptors, this results in > > a very shouty boot sequence, as RCU is legitimately upset. > > > > Restore some sanity by moving the risc_ipi_enable() call after > > notify_cpu_starting(), which explicitly enables RCU on the calling > > CPU. > > > > Fixes: 832f15f42646 ("RISC-V: Treat IPIs as normal Linux IRQs") > > Reported-by: Conor Dooley > > Signed-off-by: Marc Zyngier > > Link: https://lore.kernel.org/r/20230703-dupe-frying-79ae2ccf94eb@spud > > Cc: Anup Patel > > Cc: Palmer Dabbelt > > Cc: Linus Torvalds > > --- > > arch/riscv/kernel/smpboot.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c > > index bb0b76e1a6d4..f4d6acb38dd0 100644 > > --- a/arch/riscv/kernel/smpboot.c > > +++ b/arch/riscv/kernel/smpboot.c > > @@ -238,10 +238,11 @@ asmlinkage __visible void smp_callin(void) > > mmgrab(mm); > > current->active_mm = mm; > > > > - riscv_ipi_enable(); > > - > > store_cpu_topology(curr_cpuid); > > notify_cpu_starting(curr_cpuid); > > + > > + riscv_ipi_enable(); > > + > > numa_add_cpu(curr_cpuid); > > set_cpu_online(curr_cpuid, 1); > > probe_vendor_features(curr_cpuid); > > Thanks. I was going to send another PR this week anyway, I can just > pick this up if you want? Yes please! M. -- Without deviation from the norm, progress is not possible.