From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EE4BC4167B for ; Fri, 8 Dec 2023 01:50:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232820AbjLHBuK (ORCPT ); Thu, 7 Dec 2023 20:50:10 -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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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