From patchwork Wed Mar 20 15:45:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 1914153 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=lELn0/un; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=cHBzVYKn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V0Cbx274Gz1yXD for ; Thu, 21 Mar 2024 02:45:49 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xCCMIXb7jJTP7j07upnhEPR3Nj1CY3dETf+r2GmtPKI=; b=lELn0/unAEKmvU KrbzjzLD2/Na1GvtqseWsFAodZI4kTUUNtzQTtE+bCgUmO183phRO1LkqNbmvQIulNxLGlNUCuzr4 xwONQAFSGEgYbg019+4+P7HfOvhJcr/ywoxVwsdXnK4x9/SCkS7IGLd88uPcJBD+fnFDp4LfgT0aN MeT7Oq1CDMVEuYaWHhtMaUZfSjv5u5SF+dJDeJyhSRdIC5Paghy9x2JBdz2Z1KqewXrkphNcr4n8z Auzuthm2KUTqwGD/28WnEUoLZ4If2aeELgPfRmxYc13PXssuYmJJ8N4Vk/4MRaH1CG+bsKNga8PjS yb5TCS/ys96gMw/Wp/nA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmy8K-0000000092S-0mcW; Wed, 20 Mar 2024 15:45:40 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmy8G-0000000090x-1tAg for opensbi@lists.infradead.org; Wed, 20 Mar 2024 15:45:38 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-33e12bcf6adso1340925f8f.1 for ; Wed, 20 Mar 2024 08:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1710949534; x=1711554334; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ME+Hge/ZVWMDB++rdHhlnbLVGnq2gHwzz/C/sDUG7Eo=; b=cHBzVYKnzPOFGRn0kvQ6A6UkhmItFDZgI5wxRaO77IAXbsGZ5ZqjAfdMkehemqJDDZ HYp8LTl6cMjGYgED5Y/vFiQr+8Smwao5xPu4Vd982b2AeJ0+DP3kAQy8ghcEbSPhqtSt 85XM0zM7rEU5nH4Lacp2JXsHAMPFF0J8rlcklFBJoUyDlbtm0qpApt8I2UUsdXfXBS29 ahzRMbS6kRtOVJ54YA1KQwyfdtU2yf5ktONXYoLkBalEkUx3guMlQEkv1btMjY3r02y3 7W7qhI8REJ7zL9wP8mJhDkEE2QXkMUKn+JJ7TwMiC+pPlVpTW8eYCQMJefdUi91/+qNc 8VPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710949534; x=1711554334; 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=ME+Hge/ZVWMDB++rdHhlnbLVGnq2gHwzz/C/sDUG7Eo=; b=U1FVDL9mYYSsWWqKy2WDznB1uaR2lbYfhiBMWV+aDWYuyWoosThSKD5Z6lP2iP5hJj CLMsZuVxXB5u7G/WP7R/fdeEx3HMgG+61cIUDlnNRe0ZVYpqAD3UZeRyM687wSjjXuus zCWfzZBfO1XwlFB3Ojr9aOxeIIVpXeQVkcbze1tY+eJxF6JQBdiASBWlmo+70hj67Msa tQbaqWmtjuete1D/sx+OqqoEWSk77Bka4PR8NLuMjHrhMYJGeaPp9EDPeMCW4wQ3rWhF NQTULOPAHKXNTIwEjSTSo35KWdVN6T7Xzty60e4VLGd1mPreZYw/M/LoTL0PlydnTupM QmEA== X-Gm-Message-State: AOJu0YzbtN9OJpCN/voJwZjS7wlIG8w98PsFgX6EOIkzXC9daOukp/p8 td3k814Yk1iYlWQI7JnJo4bydfNqjmYYOHcF2aAVTtfxK9jgb6to64H+DghbAleujCbn36K2pOP cf5s= X-Google-Smtp-Source: AGHT+IGwQsGWXU1dJfY1C0ZjemY9Mcg0bGbTiVipsuYWyTdh/3+xkDeIKzRiK3AVx6m4J/DZY+/Tnw== X-Received: by 2002:a05:6000:b4d:b0:33e:527:e1a7 with SMTP id dk13-20020a0560000b4d00b0033e0527e1a7mr1597473wrb.2.1710949533966; Wed, 20 Mar 2024 08:45:33 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:bf45:7333:c501:a0d2]) by smtp.gmail.com with ESMTPSA id n15-20020a056000170f00b0033d6bc17d0esm1211511wrc.74.2024.03.20.08.45.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 08:45:33 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: opensbi@lists.infradead.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Atish Patra , Anup Patel , Andreas Schwab Subject: [PATCH v2] lib: sbi: Add missing sscrind and sscfg extensions in sbi_hart_ext[] Date: Wed, 20 Mar 2024 16:45:31 +0100 Message-ID: <20240320154531.1496553-1-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240320_084536_537744_67FD8CED X-CRM114-Status: UNSURE ( 9.30 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The sbi_hart_ext[] array is missing these two extensions ids. It is expected that this array contains all the extensions declaration at the same index of the SBI_HART_EXT_* define. Without this, when [...] Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:429 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The sbi_hart_ext[] array is missing these two extensions ids. It is expected that this array contains all the extensions declaration at the same index of the SBI_HART_EXT_* define. Without this, when adding a new extension, there is a mismatch between ids and extension names and it can even display corrupted extension names. Signed-off-by: Clément Léger Reviewed-by: Heinrich Schuchardt --- Changes in v2: - Add _Static_assert() to check sbi_hart_ext[] array size --- lib/sbi/sbi_hart.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index 3d13694..80efeaa 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -666,8 +666,13 @@ const struct sbi_hart_ext_data sbi_hart_ext[] = { __SBI_HART_EXT_DATA(sdtrig, SBI_HART_EXT_SDTRIG), __SBI_HART_EXT_DATA(smcsrind, SBI_HART_EXT_SMCSRIND), __SBI_HART_EXT_DATA(smcdeleg, SBI_HART_EXT_SMCDELEG), + __SBI_HART_EXT_DATA(sscsrind, SBI_HART_EXT_SSCSRIND), + __SBI_HART_EXT_DATA(ssccfg, SBI_HART_EXT_SSCCFG), }; +_Static_assert(array_size(sbi_hart_ext) == SBI_HART_EXT_MAX, + "sbi_hart_ext[] array should contain all extensions ids"); + /** * Get the hart extensions in string format *