Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29237734rwd; Wed, 5 Jul 2023 09:02:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlGNZ9q021f6Spw20jY+WUkFJ9qL9oV3s0b9gRkNvszUsDkM2zc55V0uuD90yv2pkcOzRtBQ X-Received: by 2002:a05:6a00:1392:b0:667:d0ff:6a0f with SMTP id t18-20020a056a00139200b00667d0ff6a0fmr4451588pfg.5.1688572923313; Wed, 05 Jul 2023 09:02:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688572923; cv=none; d=google.com; s=arc-20160816; b=y6w+fBMmdhklj8W3vs980SFJFVG7q7QuKCvWHr7xZ1UzIJxrEqI9CM8JC49DnYvDus JGlrWf9h7Sd1wRcMSVigq7/FjaYkSvyDTCJvxOxvIkUDJGlTxCHSrDhNpxO3lwOD9GUd Q6rmeemjecTj1xRzZu6SuTUEq7VSRkunoNpyF5hnRitAeeVGQgzl8wy+3aGtxjDGw3Ex jYfEBau8s/PHzu9H7iV1ISdaafiWpDmE2OqMqr0JUYSKjY4i9upr4/sAS756JZfxAu58 gjJ/dF/xadClzprKZY3gfhNegWw5K6URtiJJv1zb05XTkDenj/vcorKMDsHaJ8rM3a4I o29w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=bkUoG+L6Gc/FljCZD/tXYCRllz67Rh2nIbBivClEET0=; fh=yuyZVw9y3oQpvGMfMmaTu4LUJJNBkh855+sIY6oHbbw=; b=oFq6D9QKcY0ctlKPwnvPzeVg2ULlGtKjyKno72hoJNBmJxauRGcSd5ym6yLP/ePAzm 0djKy0h+urNpVaBtdwABKjw2NTRGkqI1D3HsUjZJK0WQB+xweim6PWkTCFr/c6V8svVh zmoPcZ9wBIBt1Is1O/2hT34hxmhbJW3YGxpypDj/jpdIRaUuO8Z9zsnzBBTinn89a8Py Fi9sa9SRJdZOqWcT2Dwo2vV+s4WuOt+WoHV/JeYfRDStJF8ScUNIC2WQRy52zfFgavPE twnpOzsUVagZX4UpsmwmDpN7Ya1EQObs/ZERQXhvvQsBwIMTXKbPj0Nn+rhN1Pob2CP2 D/ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=CbnZ3gwf; 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 k14-20020a056a00168e00b00666892d1ec3si24323241pfc.360.2023.07.05.09.01.16; Wed, 05 Jul 2023 09:02:03 -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=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=CbnZ3gwf; 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 S232525AbjGEPwI (ORCPT + 99 others); Wed, 5 Jul 2023 11:52:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjGEPwH (ORCPT ); Wed, 5 Jul 2023 11:52:07 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7705E1732 for ; Wed, 5 Jul 2023 08:52:02 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2b6a675743dso106570741fa.2 for ; Wed, 05 Jul 2023 08:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1688572321; x=1691164321; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=bkUoG+L6Gc/FljCZD/tXYCRllz67Rh2nIbBivClEET0=; b=CbnZ3gwfvWWXIIghXULsz6NIP5rnHhM0x78jL+4sIHTjvJeU3DzIlDuIl2Mh31YhRX jWmZHVwr/K5jAhyLoKLUWJw1HTq+f1d6YifnbeLqsQj1TN9pHZ2UvXjceftWXXqZ2H8C R/Ebm9bWLFlbb/GpueRSSCueHI5XyOjn8x+HjPBU9E6Gh7lN6NvcEqCfsHFZPEo6hR0Z np9VLqPcHy/P7eSvTV4qu45BVbxs+pyB3zUyReQK4UmWVF1v6Hw1Q7+RJEuF0Rc6hA6+ MGEl8ChtNFAgO8RLF1Ln3YEfPhoQpsFjgWDkfAxkCAtYY+qrIZAa8soBmUDkkNVdTge8 fHsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688572321; x=1691164321; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bkUoG+L6Gc/FljCZD/tXYCRllz67Rh2nIbBivClEET0=; b=AiiijBpYbfUXlbeD7dQWFn4S25Zg4/nNOHt60HAiGrtveUf+kMN3Kjw4rGJRd6DPNl oHIhfcV2gcjKMGB9NNl83Hu0YkpcSYvGkeFwGxALEk+PotZWHu83p6zJlx5dtAR3baU5 J9GjRvac2n8oSSOx2dToqx0DjSoaPau0nP62EdkBt2khoi1EkfiFffl//nrJnFrRHCsg ufusB9Ee9H3F2JvOf0FsHN74nIvf259VtXn1oT/d8qC01QEaCwELitQ7+uz2tCTque56 dhTASUR4rOocuAOvJHKuTWWdKBASCCKbpaOtWRGuFR65C4oqQt+G4jfs+S7Q10A3EFo8 cC8A== X-Gm-Message-State: ABy/qLZdS+hXcc8CyWPvucZ9MIb+Pt/C1hMTRGSnLBi6L6SmEWyjOITL 5RbfdFlUfkes+xkyR6k8en41/cisR27hLsT8P7o4Lw== X-Received: by 2002:a05:6512:3da5:b0:4f8:6e6e:3f42 with SMTP id k37-20020a0565123da500b004f86e6e3f42mr18675814lfv.14.1688572320599; Wed, 05 Jul 2023 08:52:00 -0700 (PDT) MIME-Version: 1.0 References: <20230703-repayment-vocalist-e4f3eeac2b2a@wendy> <20230703-girdle-underling-880f633c4c73@wendy> In-Reply-To: <20230703-girdle-underling-880f633c4c73@wendy> From: Evan Green Date: Wed, 5 Jul 2023 08:51:24 -0700 Message-ID: Subject: Re: [PATCH v3 01/11] RISC-V: Provide a more helpful error message on invalid ISA strings To: Conor Dooley Cc: palmer@dabbelt.com, conor@kernel.org, Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Albert Ou , Jonathan Corbet , Andrew Jones , Heiko Stuebner , Sunil V L , linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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_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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 3, 2023 at 3:29=E2=80=AFAM Conor Dooley wrote: > > From: Palmer Dabbelt > > Right now we provide a somewhat unhelpful error message on systems with > invalid error messages, something along the lines of > > CPU with hartid=3D0 is not available > ------------[ cut here ]------------ > kernel BUG at arch/riscv/kernel/smpboot.c:174! > Kernel BUG [#1] > Modules linked in: > CPU: 0 PID: 0 Comm: swapper Not tainted 6.4.0-rc1-00096-ge0097d2c= 62d5-dirty #1 > Hardware name: Microchip PolarFire-SoC Icicle Kit (DT) > epc : of_parse_and_init_cpus+0x16c/0x16e > ra : of_parse_and_init_cpus+0x9a/0x16e > epc : ffffffff80c04e0a ra : ffffffff80c04d38 sp : ffffffff81603e2= 0 > gp : ffffffff8182d658 tp : ffffffff81613f80 t0 : 000000000000006= e > t1 : 0000000000000064 t2 : 0000000000000000 s0 : ffffffff81603e8= 0 > s1 : 0000000000000000 a0 : 0000000000000000 a1 : 000000000000000= 0 > a2 : 0000000000000000 a3 : 0000000000000000 a4 : 000000000000000= 0 > a5 : 0000000000001fff a6 : 0000000000001fff a7 : ffffffff816148b= 0 > s2 : 0000000000000001 s3 : ffffffff81492a4c s4 : ffffffff81a4b09= 0 > s5 : ffffffff81506030 s6 : 0000000000000040 s7 : 000000000000000= 0 > s8 : 00000000bfb6f046 s9 : 0000000000000001 s10: 000000000000000= 0 > s11: 00000000bf389700 t3 : 0000000000000000 t4 : 000000000000000= 0 > t5 : ffffffff824dd188 t6 : ffffffff824dd187 > status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000= 000000003 > [] of_parse_and_init_cpus+0x16c/0x16e > [] setup_smp+0x1e/0x26 > [] setup_arch+0x6e/0xb2 > [] start_kernel+0x72/0x400 > Code: 80e7 4a00 a603 0009 b795 1097 ffe5 80e7 92c0 9002 (9002) 71= 5d > ---[ end trace 0000000000000000 ]--- > Kernel panic - not syncing: Fatal exception in interrupt > > Add a warning for the cases where the ISA string isn't valid. It's still > above the BUG_ON cut, but hopefully it's at least a bit easier for users. > > Signed-off-by: Palmer Dabbelt > Signed-off-by: Conor Dooley Reviewed-by: Evan Green