Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp929976pxb; Fri, 22 Apr 2022 14:36:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1o0zb/iQFVFmWLEYoMUuOtf2ihH9pyyBYogNyB0utEC0ETq/AX6wGAa+tx/1dOi7K5HdI X-Received: by 2002:a63:bd49:0:b0:39d:a2d3:94a2 with SMTP id d9-20020a63bd49000000b0039da2d394a2mr5487883pgp.242.1650663411367; Fri, 22 Apr 2022 14:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650663411; cv=none; d=google.com; s=arc-20160816; b=COnLOxsa086l9t4wFxxp3dovaiMiVU1dsRZNOOR8L2MrA6Ysolbk5hT81li+6e/DoA 1bjrhGjniOt/UD62cOKbcvWVtQE9H84uzA6x88YztW8+YskRT0XzYfjTY4A2+sKV3ly6 liLwFjYLtAaYg7ELG7L4rzJIO48PPLeAkJyBlAE/v1Vta+vq6ZZ2NkNQ81Lcw9QTy2PX yoJ3+rFJU53e84nxRNiNNutDwgaoer7U9v2fqUYgCMswsHEqL2smtZD/Uo2RkzrNqYCe EbMTIkol6ZyIKJxa0RBCam4is0UjRH8dAFijrSMxMP56qVIiWLqmuz3dpIdYnVMwxL8L eMAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:cc:content-transfer-encoding :mime-version:message-id:date:subject:dkim-signature; bh=VAtOPkJ1SY/tzMbGCTKTKv8dG7z23I5mteO8idQRNqw=; b=S/pM9lVub/zmDfHXo1K7KBL+V6DypF0++ZUDWC87S0IgAnpk9cf/Pv3GbKtyb21VNS AYLaXgCczdXm1rolCTCaqLRDG2AeRXGQZUmHKc2MvV378fMjP1Mym5AfmgXy24x9KIW7 MqPTd1De+IM8F5e/BExxeExhlUsfuourfZl6456U8p0OT8X2cXnjLFOmF/ZxUCHLXjGh hUHLGvgNzU1yVOsVWL74RDhQqSOwdlbR9ZQyi7G2zQpBOs3c8u1fb/AkpmiTzhizDzu+ OTDoT3YvBcHNbKClv+gqtiE6nMZUVEHO+geGezG/WsPhJ6brGAXLwhOmnz/LdVyd9HF4 mo4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=F03wFIkv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w14-20020a63b74e000000b0039d6a62c9afsi9304091pgt.289.2022.04.22.14.36.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:36:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=F03wFIkv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 44D1A1CA88D; Fri, 22 Apr 2022 12:44:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390523AbiDURIh (ORCPT + 99 others); Thu, 21 Apr 2022 13:08:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232476AbiDURId (ORCPT ); Thu, 21 Apr 2022 13:08:33 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D85AA3ED01 for ; Thu, 21 Apr 2022 10:05:40 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id j8so5433469pll.11 for ; Thu, 21 Apr 2022 10:05:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=subject:date:message-id:mime-version:content-transfer-encoding:cc :from:to; bh=VAtOPkJ1SY/tzMbGCTKTKv8dG7z23I5mteO8idQRNqw=; b=F03wFIkvH5mHwPm9Vdu97iKnCWlemvMdFvOppF2ZHGD8qtffYcRETG3VtVhIj4qvYx XWmKJ/KsFbZPc1kUl1FxRWXZr5+5Vn5eHGrysqnfIv3aZFgOr4xeSn3fDvZQG9uLzcMQ M/9UffPcFn07CYsjM+L2p5OHf9tHrF5TTki3qW1CH4jL0aF8veH/OpcovTFTbw2NpU3+ 0w3kbZmQ1MT0WHZoHPveAXxJmj6KLpBbvQvXnpN51UYFdvkEMfI1ozg8XM9sEgA33H1f KB577+f/yUEmDZQCuJmDNEJ/9zZ3H9cfwN3Q/rDUZlUDARsAPSs1PEcRG2meHbtvi8Pg RvWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:date:message-id:mime-version :content-transfer-encoding:cc:from:to; bh=VAtOPkJ1SY/tzMbGCTKTKv8dG7z23I5mteO8idQRNqw=; b=rAkEvp5n25+vX5V4u3xEnn9kxiL2z1i3xx6z/syoGrxYUL2V10wDrGasOoG/GuMIrv Bir2lDb9KgIm7pdk0YvMMVzq+PvoS6Y9eImkdpYng78yMWE2J26/LSdQReBitWi5mCRN tiiefgJaOBUz890BPIJqoeKYlFN4wlYSFNF4Znhc/ddAyrAeShcDxHO4buH6Wzl3BSUl IdisOEQWjIPHXJFD5JBTXWI6IjfBmJIWpkgchIaOjr8SM/f0wL2hUYNmIdCIliQjJ7/g HZYBO0ovHgOdMHGPAyc6jTt/heAg85tuQzKZMWbIxf1emhGBVgai/kIPkiwHDVM4YW5T gM6A== X-Gm-Message-State: AOAM531e0FIVMYQgm58TeN789UYBa17AlGL/ckG1O/Z3FbrRzVmbXZP3 Qk7uXROOJksVdnJDGFA8RxONAw== X-Received: by 2002:a17:90b:384e:b0:1d2:798d:6f42 with SMTP id nl14-20020a17090b384e00b001d2798d6f42mr635645pjb.5.1650560740380; Thu, 21 Apr 2022 10:05:40 -0700 (PDT) Received: from localhost ([12.3.194.138]) by smtp.gmail.com with ESMTPSA id j6-20020a63b606000000b003808b0ea96fsm23186858pgf.66.2022.04.21.10.05.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 10:05:39 -0700 (PDT) Subject: [PATCH v1] RISC-V: Only default to spinwait on SBI-0.1 and M-mode Date: Thu, 21 Apr 2022 10:03:55 -0700 Message-Id: <20220421170354.10555-1-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, atishp@atishpatra.org, anup@brainfault.org, Will Deacon , mark.rutland@arm.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux@rivosinc.com, Palmer Dabbelt From: Palmer Dabbelt To: linux-riscv@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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 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 --- 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