Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2060466rdb; Thu, 7 Dec 2023 17:51:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfRrKLE5nwjmECJTrL/F2nuQ+7O3nc5bhcdAGcXpxZbDegUrqaWdgB2t7gheEli34hee1l X-Received: by 2002:a05:6a20:3d85:b0:18f:97c:8a27 with SMTP id s5-20020a056a203d8500b0018f097c8a27mr4497334pzi.82.1702000282562; Thu, 07 Dec 2023 17:51:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702000282; cv=none; d=google.com; s=arc-20160816; b=O40Zs1H6Tte6UFe4b4zQv4ikRLs9sYfVSBkPv/E2qG27wHxpr6aZ6mt8mCjU51OuRM sPxx9o89VoYXzOm+mZUj4zzJdR/htnUN5s4sk94Eg6Eu7vMu6/eQXNJUFUhhk+BPO74c iWXCudVoZPcjPg5OWF8aWI1AlBOG4KAQmnPPDQBbYzxOVghZ6cabV2QJA8AVCIS0E9P0 6P/JCu22d/5JS2CB8HYzd/4dfm6IdAWW7FfGGnvfw1gZ1UIi2q7zoFUOqChnMiXWjELe gSyexIJoFQqxCeaDI+fQmtx6j2OItxPkRFmzy3DLvaD/EwNKNWiNfotIM6OsDr/uqwKy Cw+w== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ec/nRynnolXrhtv1pbGc5r0Wmr9TMCS3TCCUsNOizUs=; fh=Ucb2Qh3zC/NbEpS0Lnf9zKRbnbiJksqFZipAEe7pC+0=; b=Vqu8RASHCArhrt5diCS6zh8Uf2wEGHR/pt9DtcYSugg2yChAYGvqSkAlpexMdr7vyG gsWI4mFnhlqzNLa8JXbykeo3Bxi8uh9Af9xzV+T3G6aGyQvqSR38ZJ3FJVioCcuODLvc xePVrVb6818iNiVFhA4ay1omm5TUicACQdVwGGeYoBYXk3kdJdvVIXXO/0JbWtxBg+Xa mvxaKSSrqwn/UTkdv4soKl/lZdq4FUnifm/ti3LczBZkUTwY51vmyeFAMmDg5rGuGCad 6WRwLQoESld3Vm8ckjhWQcXrqexY0BYDvgkrS0WuLyS6yB5mSNr2dSEliSLhv+9QQ10Z 0nsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f9qCwfZ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id fh3-20020a056a00390300b006ce010d03d1si639371pfb.295.2023.12.07.17.51.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 17:51:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f9qCwfZ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 03C9C807F965; Thu, 7 Dec 2023 17:50:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbjLHBuI (ORCPT + 99 others); Thu, 7 Dec 2023 20:50:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbjLHBuG (ORCPT ); Thu, 7 Dec 2023 20:50:06 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D40B10DA for ; Thu, 7 Dec 2023 17:50:12 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C87CFC433C7; Fri, 8 Dec 2023 01:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702000211; bh=8AivNxnB656tRHSe2fXOSDD3zu3/bxUYioH4swsST14=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f9qCwfZ0UskUmg58lyYLFKsRZ9IZ4oanS1CsN6cMTPCzg+zCKc/1FB28mjRRHKJlF 112+HURh2Nek5ZybJ/TVFD4ISNyuLVOOu78sZoC60/iUenWdHFoqVihoSD+IxCbBo6 HFRieHRA8Y8CQVEkZgVXwEdv1geDJalhGAQ2DifSWNhIYACcb2gFGzWPw1mOgEH1wm d86xd5XyLjh02lEYL+XQD/l1y7QfRLhNqTHIx4EKrcayFRpid563bS0QT4bBKY7U7w L5f6D65LGAQMG5O5f1cVANxhYNHkqSOftS5dtwT7DbD6NF7UYtM1mheqbTBIIz3IkE HqQuqOc5GjoGg== Date: Thu, 7 Dec 2023 20:50:05 -0500 From: Guo Ren To: Sami Tolvanen Cc: Samuel Holland , Palmer Dabbelt , linux-riscv@lists.infradead.org, Albert Ou , Andy Chiu , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , Conor Dooley , Greentime Hu , Heiko Stuebner , Masahiro Yamada , Nam Cao , Paul Walmsley , linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: Fix SMP when shadow call stacks are enabled Message-ID: References: <20231121211958.3158576-1-samuel.holland@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 07 Dec 2023 17:50:25 -0800 (PST) On Fri, Dec 01, 2023 at 09:40:55AM -0800, Sami Tolvanen wrote: > Hi Samuel, > > On Tue, Nov 21, 2023 at 1:20 PM Samuel Holland > wrote: > > > > This fixes two bugs in SCS initialization for secondary CPUs. First, > > the SCS was not initialized at all in the spinwait boot path. Second, > > the code for the SBI HSM path attempted to initialize the SCS before > > enabling the MMU. However, that involves dereferencing the thread > > pointer, which requires the MMU to be enabled. > > > > Fix both issues by setting up the SCS in the common secondary entry > > path, after enabling the MMU. > > Thanks for the patch! Looks like my qemu setup doesn't hit this issue, > but nevertheless, the fix looks good to me. Because there is no function call in relocate_enable_mmu :) > > Reviewed-by: Sami Tolvanen > > Sami > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv