Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20564953rwd; Thu, 29 Jun 2023 04:14:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7RqYXMPkCp38IsHFh7Hgqk5rzy8Ez6BGx/TIyhbQKAvSZdrSHE2yYytlWl/zBMR6Fd5h3O X-Received: by 2002:a92:4a07:0:b0:345:aee1:eae0 with SMTP id m7-20020a924a07000000b00345aee1eae0mr10166970ilf.12.1688037245648; Thu, 29 Jun 2023 04:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688037245; cv=none; d=google.com; s=arc-20160816; b=eWMGZY6ofS/RePLLoKCnHuqgW6s/5b5NpGQ0Xpvfueuq5dNz77hLCwsomxmBR7rtJb LSfbCte2rrWTqerj2xGwR8/t2asyaMqmZEkw4RkD4MdaZ3y4jKFs58SGeqYyOek2nHdT BcN5UkEI/QnOMl0o5y5RaItyW8VWFCVp/TIefjDsh9bmyfAWkBqerYKfoOLR2rVeXUWV 7xhZdcUxpotSZtjhx9U3tU7vQD5X79mZrgUgZ6uVDII83lt8T58Q8v2TwNQO/uI8P6ZP KqdsKJfhRKFCr2Aj4B64PsktRJAjh5U5l1Zg2PoA/TOtfv5Uk3E0TM7HM0wfJzw1/7G9 iuDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4VnJRF+bvKvFG7e8QSGNJVbP7sD6ShtvV0wC+uPz2w4=; fh=r4NJ5aRdgpFmbPmuDu+a1GjZ5FRPtfTkHQFeiacollg=; b=0CgfotVHBq5rQAJ+1aARUsPcqBGz8b7/M8om1SAllhUM1oMzPc9ms4LDfSTrb+quaX pz2iTuvHujAVdDw8IL4dF9xKbSPmZPjhcW3RaI/Dfe+1KIhJrEJutxjruyirieM108lp Ak0WKloCkmxomK9qBmymp1hdgmxwikF0QIuph3dD82tYrSB3ZzWzoni+635xGIjt2/wA 0TSQnzQ+UXlrXI53Q9QCCq5WG6A+LjAMymvkuIkOxU9YELDOD+ApQbW7gcxVlJTw2U9u pSsa08ftTd6HwAEmNzUsrtbbMzYGd9nUJFyyjv9h7lsEdfZmGpqKyNx7F//RPHyGOJeZ oJfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="o+qZW/ID"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b1-20020a630c01000000b0054fd670e85fsi10315546pgl.233.2023.06.29.04.13.50; Thu, 29 Jun 2023 04:14:05 -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=@gmail.com header.s=20221208 header.b="o+qZW/ID"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231248AbjF2K6y (ORCPT + 99 others); Thu, 29 Jun 2023 06:58:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbjF2K6u (ORCPT ); Thu, 29 Jun 2023 06:58:50 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 520B4C3 for ; Thu, 29 Jun 2023 03:58:49 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-765a5f7abc6so53844885a.2 for ; Thu, 29 Jun 2023 03:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688036328; x=1690628328; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4VnJRF+bvKvFG7e8QSGNJVbP7sD6ShtvV0wC+uPz2w4=; b=o+qZW/ID5ykc5l20pWKMRIfquYco820JW+lACiz582Rsj0smJHw5Z3gH65bwUneaXA yNqJHtP+M8vGgBhLymuXaUOXZ1UyEfXQ2lp7hMt4szT+h7oko6ubijEU9SlZcazeE678 zEOmKvdpw9Hth6CA9pDyIqCdNno+GS/7J03Sgblkfs5mhZrsRPy+TkvermqpEXR7WYdD 82mgiIaB8umzKsR3XxXeg5WMQyy9cmuNEuVDM21wTsA7j2rXLY8twTS6UH4q2a8Krxil 1tQ6fEKUot0PAbjfskZeyu3UWOshyNFXy+O3e2/yJfAGBSyu/9zQQsJzQ6PmcUjN8p85 U3mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688036328; x=1690628328; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4VnJRF+bvKvFG7e8QSGNJVbP7sD6ShtvV0wC+uPz2w4=; b=gzxGzt5HDZhvFEuuZVJMZ/JbqjyYcrr8NrW6Ptp4ManaTliX65dtFfDzBcOPA9ZaoS cnJJFQu6ReL6bSMj66gKGiz6o0l4FrY2Il7YFpqnlyGZxcTUx0DNZ94njj11Hnt8i964 a5fF5F46JKqRWbVujdn6J3BFlnjtTXSXs6IUfIkwkSVx0bW5LpsfG7fbY5uWesc2/iSE Nrtidk4eK49tsAnd06Jem1hOJYn0PMSWULvLRcZDpuo+PRJIx5eq/U40H6KDtvJsEBJK xKhB8EYAWrnvWutXGfYrMICDz8MA7IgYSJDKtaOsqcceH8urR2ASfKYnZGzy6psrEYLV xy5g== X-Gm-Message-State: AC+VfDzJCzVZz6C9yuSysXl1Tr4SsifZZ0TLICB44H8FjLRfKhTSySB7 X5Qq8t3BUvh7iJRH9tWE4rA= X-Received: by 2002:a05:620a:d89:b0:767:2f4a:e07a with SMTP id q9-20020a05620a0d8900b007672f4ae07amr2027566qkl.68.1688036328270; Thu, 29 Jun 2023 03:58:48 -0700 (PDT) Received: from localhost.localdomain ([58.240.82.166]) by smtp.gmail.com with ESMTPSA id 29-20020a17090a195d00b0025ef39c0f87sm9734017pjh.0.2023.06.29.03.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 03:58:47 -0700 (PDT) From: Song Shuai To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, conor.dooley@microchip.com, ajones@ventanamicro.com, sunilvl@ventanamicro.com, heiko.stuebner@vrull.eu, apatel@ventanamicro.com, suagrfillet@gmail.com, evan@rivosinc.com, greentime.hu@sifive.com, leyfoon.tan@starfivetech.com Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv: BUG_ON() for no cpu nodes in setup_smp Date: Thu, 29 Jun 2023 18:58:39 +0800 Message-Id: <20230629105839.1160895-1-suagrfillet@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 When booting with ACPI tables, the tiny devictree created by EFI Stub doesn't provide cpu nodes. In setup_smp(), of_parse_and_init_cpus() will bug on !found_boot_cpu if acpi_disabled. That's unclear, so bug for no cpu nodes before of_parse_and_init_cpus(). Signed-off-by: Song Shuai --- arch/riscv/kernel/smpboot.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index 6ca2b5309aab..243a7b533ad7 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -187,8 +187,13 @@ static void __init of_parse_and_init_cpus(void) void __init setup_smp(void) { - if (acpi_disabled) + if (acpi_disabled) { + /* When booting with ACPI tables, the devictree created by EFI Stub + * doesn't provide cpu nodes. So BUG here for any acpi_disabled. + */ + BUG_ON(!of_get_next_cpu_node(NULL)); of_parse_and_init_cpus(); + } else acpi_parse_and_init_cpus(); } -- 2.20.1