Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp723437pxb; Fri, 22 Apr 2022 09:52:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxDTudUXThwdnEkdQOxb5j6az+5hjMoAfySF5NQqXt6hV3CSw9lVwvkayL7c6zyym3ML8f X-Received: by 2002:a63:5b49:0:b0:39d:261c:b416 with SMTP id l9-20020a635b49000000b0039d261cb416mr4639520pgm.61.1650646342406; Fri, 22 Apr 2022 09:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650646342; cv=none; d=google.com; s=arc-20160816; b=owOE/4vAz+MACaSgshCxMhUen2TZlrxsJ6tQWSwA4+MDmFa2j4QyI/J3TAY3Sqo465 NzWCiKMQoClCyJ31if0GFzrdTGobo2Z3Wsfs66T70YZsgKFh1jcmPtjBZJBxxvkn8oUj mquvxq0bq06JD2CiyWLKoom/jKh9R1U/s/OOzQEGvvR8P3Fa+P2t+Aa3peQdkBRavEMf AWXO1OTd5ri08znW1cPv6M2Te9BKndkRG7ppowXoQn+4/ojHGKrfrchti9QVQJxDfpIp aUDCSrfQl3erCdAW3qsGwaYXjnUkRa0g9azyHfXgjCZou7omJJ544bQcsXyH4GwgNU/G 37vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=NqW1sJzlV4aSvanIKfDeQQY+sx3syjrs7XXIQkRWQtw=; b=EsqaPQj23LprMSZwmyq67kfIvzevQFdrAjIBxuNJ2JEPtO0H5vuMDIT1FWQfr75DK2 6nK/xciHEdRxUIoZX/Rgk8ZzUHgiNf0drUqe3Bbx8Jq8abWLOF4l5yrtAFEliSaDr/h2 QJqjCm1D1powf1OhrgFbeKNHcM4nMXXPmmJVoBiYB78e0YC4w2GMvTCHyDUAkR6Q2BSk m5dkEuzWZHHLAV2J8bmfqkLAhgLFACe1MY1SNAZ5iKLCzHIPeO9myMUzj13ubrCFvbQQ TJrntuxVr55eJwpUd1AqEba4LG4srYHaGparrSmeilMs5XH1FVBi03+2BSoWntYth50o vYGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=ExaW9k1V; 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 e11-20020a17090301cb00b00153b2d1657fsi4388321plh.391.2022.04.22.09.52.03; Fri, 22 Apr 2022 09:52:22 -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=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=ExaW9k1V; 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 S1444002AbiDVE4E (ORCPT + 99 others); Fri, 22 Apr 2022 00:56:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443528AbiDVE4C (ORCPT ); Fri, 22 Apr 2022 00:56:02 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A561965A4 for ; Thu, 21 Apr 2022 21:53:09 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id u3so9362617wrg.3 for ; Thu, 21 Apr 2022 21:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NqW1sJzlV4aSvanIKfDeQQY+sx3syjrs7XXIQkRWQtw=; b=ExaW9k1Vitir2nINZomSBatVKKgAReK/fsbXvrAbn5dB27O90V3mOmiO3YAOwCQbjQ KO5nRkXFQ2jkYtOGrCSAW2kHDHqTx+r4K7qW3xyoxlzKKHpKJj3C2mHxXPBXEjhfW05K VwN3yjyHJ62HDahQZqTeMjLhjF38r9RSs6KFHp2iHHfMF9J4gRozQr6M8wzL6caMHMg1 pVfrKha+2YMwqqQn+cSK/cobq6zGK0HCRIgP93d48oGZUZxHzEjmJkKTiOlZ++2PKerr 5dnVo7MhjEaLGiwzbJt1TbXG1MT28I3fQJv9yvaAZ+1NF7eZocbk5BHj0OeqG9yV02sb hGDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NqW1sJzlV4aSvanIKfDeQQY+sx3syjrs7XXIQkRWQtw=; b=ZPRnfPVfdWEEcLAOyvdqhufYuLCf0ybOoXbTk1Xvt0Z3dkwPvvDbPUTKwa1c7ecXPO CbjYDW2QqAMh+ZKOa01VrCLjRbfirZQYckZ1vpaau83s1yezkHwJIk/8D2RgqJS71gbN P+Jn7giAueEM+cZT2cApcSyG6TXL8WyyxvXqjsAi1yhJ0a/AV5pgGoe3a2e2ZzwG9ekq Ki5baTCpw0gjgJks436q/c8nWjdrQ8k7DB+HrgqhpadpBMMtd6Kzbw3u2pHu1JFI+vE0 hLFipy3nSOizHlWI54XNDHKcqMyVG8+sqgt1JXqRzdeilSVn40EU0xPnXUOKxSFX8Png GawA== X-Gm-Message-State: AOAM533+9rUv1gjrSpj4aoYJNI/MqaPBymGTMuG+31Q3REzSX3WHo6bG hZ2DVL1lr8QKm1+DS0lyHSCr46RxZY/vgGI1vtoxXw== X-Received: by 2002:adf:db86:0:b0:205:bccf:8cbf with SMTP id u6-20020adfdb86000000b00205bccf8cbfmr2055381wri.346.1650603188036; Thu, 21 Apr 2022 21:53:08 -0700 (PDT) MIME-Version: 1.0 References: <20220421170354.10555-1-palmer@rivosinc.com> In-Reply-To: <20220421170354.10555-1-palmer@rivosinc.com> From: Anup Patel Date: Fri, 22 Apr 2022 10:22:56 +0530 Message-ID: Subject: Re: [PATCH v1] RISC-V: Only default to spinwait on SBI-0.1 and M-mode To: Palmer Dabbelt Cc: linux-riscv , Paul Walmsley , Palmer Dabbelt , Albert Ou , Atish Patra , Will Deacon , Mark Rutland , "linux-kernel@vger.kernel.org List" , linux-arm-kernel , linux@rivosinc.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE 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 Thu, Apr 21, 2022 at 10:35 PM Palmer Dabbelt wrote: > > From: Palmer Dabbelt > > The spinwait boot method has been superseeded by the SBI HSM extension > for some time now, but it still enabled by default. This causes some > issues on large hart count systems, which will hang if a physical hart > exists that is larger than NR_CPUS. > > Users on modern SBI implemenation don't need spinwait, and while it's > probably possible to deal with some of the spinwait issues let's just > restrict the default to systems that are likely to actually use it. > > Signed-off-by: Palmer Dabbelt Looks good to me. Reviewed-by: Anup Patel Regards, Anup > --- > This seems to be the source of many of my new hangs when trying to test > the NR_CPUS=512 support. It's not really related, just fallout from > testing different setups. > --- > arch/riscv/Kconfig | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 00fd9c548f26..dd5e975abe37 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -359,7 +359,7 @@ config RISCV_SBI_V01 > config RISCV_BOOT_SPINWAIT > bool "Spinwait booting method" > depends on SMP > - default y > + default y if RISCV_SBI_V01 || RISCV_M_MODE > help > This enables support for booting Linux via spinwait method. In the > spinwait method, all cores randomly jump to Linux. One of the cores > @@ -370,6 +370,12 @@ config RISCV_BOOT_SPINWAIT > rely on ordered booting via SBI HSM extension which gets chosen > dynamically at runtime if the firmware supports it. > > + Since spinwait is incompatible with sparse hart IDs, it requires > + NR_CPUS be large enough to contain the physical hart ID of the first > + hart to enter Linux. > + > + If unsure what to do here, say N. > + > config KEXEC > bool "Kexec system call" > select KEXEC_CORE > -- > 2.34.1 >