From patchwork Wed Mar 13 08:46:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Maiolino X-Patchwork-Id: 1911565 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=sods4RVI; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=dP6L+uaS; 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=kvm-riscv-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 4Tvkf132mBz23qj for ; Wed, 13 Mar 2024 19:47:05 +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:References:In-Reply-To: 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: List-Owner; bh=e0vZGt1dybq9fP0XYnbYqLuP6B/h/8xvYd6ZocSI4Fo=; b=sods4RVI/5iJhI Pkt0Zv1fPQEJDzmkAZG66oTYadZowLFNNp60VNKCt1hWiScdHODF5L+bB/I6Uo0bi83gPqRxtchXb jbmSgHKD2gw5RJ/T6/XUWPJuYBpnyJSmxsxT7X9Gg+sM+a6Mr4+BUL79JZqlGA65RC/6ER40/GOzg VOxpJKy8KK+KUAcESYOtYt69cDkXZGPJUdKFxsbUQJYmcyAXbADEa56PpC3aJAyUERjIVRXw5nDMG 85NPekLJbJTd//q1+pkMcYEl8GNw2rbglv+Ionr8J2mwJ6pLUsJIqT89vkibmfaSpHO2gfcU6fVH9 +XDjjvRa+dI57HAbVbAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkKGN-00000009N0v-48Lo; Wed, 13 Mar 2024 08:47:03 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkKGK-00000009MyL-2em3 for kvm-riscv@lists.infradead.org; Wed, 13 Mar 2024 08:47:01 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id D3FBECE18D3; Wed, 13 Mar 2024 08:46:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 271F2C43399; Wed, 13 Mar 2024 08:46:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710319618; bh=NBxQdRWKdqvK15btoFkgdnu9o7m62tsv99FbfaSAv6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dP6L+uaS8RPVYgYZHYPN6cR2DHr/SD9sgVioXc7GshfFSvhO4tKmBQupzOmryHMM6 bRpNteS3tutgCrExI1zf53nsKDrOkH/gAqgLFYmEOSkQqPvxueOpD3LJtNDho7DFIC GHdDjciIo+z4hODXz3V9R/7ByjdYCyUZere7/MYsaBlPwtwoNFqsboE2jcOff+JTzX wYGDTGQviEvvp9PAbt2x4xXLTh1ybHgDrdLLmYBHCseC/JP8/806P1uZR26f71lBPd +wx/Juoqha+XZXcKSaNjOw47LD89DoWF+3H95yltcsScKzXdfKvB/XYrir9NCvirJy VNaEXvSBKJPvQ== From: cem@kernel.org To: kvm-riscv@lists.infradead.org Cc: ajones@ventanamicro.com, tech-prs@lists.riscv.org Subject: [PATCH V2 5/6] riscv: Test for specific SBI implementation ID Date: Wed, 13 Mar 2024 09:46:23 +0100 Message-ID: <20240313084644.277426-6-cem@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313084644.277426-1-cem@kernel.org> References: <20240313084644.277426-1-cem@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240313_014700_873072_47FAE536 X-CRM114-Status: UNSURE ( 7.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -3.5 (---) 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: From: Carlos Maiolino Retrieve the ID from the SBI, and test it against the SBI_IMPLID enviroment variable. Signed-off-by: Carlos Maiolino Reviewed-by: Andrew Jones --- V2: - Update commit description to fit 70 chars - Move sbi_ecall() after expected assignme [...] Content analysis details: (-3.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [145.40.73.55 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches 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.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Carlos Maiolino Retrieve the ID from the SBI, and test it against the SBI_IMPLID enviroment variable. Signed-off-by: Carlos Maiolino Reviewed-by: Andrew Jones --- V2: - Update commit description to fit 70 chars - Move sbi_ecall() after expected assignment to make consistent with other tests riscv/sbi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/riscv/sbi.c b/riscv/sbi.c index bc0f5c68..65492fd6 100644 --- a/riscv/sbi.c +++ b/riscv/sbi.c @@ -51,6 +51,15 @@ static void check_base(void) } report_prefix_pop(); + report_prefix_push("sbi_impl_id"); + if (env_or_skip("SBI_IMPLID")) { + expected = strtol(getenv("SBI_IMPLID"), NULL, 0); + ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_GET_IMP_ID, + SBI_EXT_BASE, 0, 0, 0, 0, 0); + gen_report(&ret, 0, expected); + } + report_prefix_pop(); + report_prefix_push("probe_ext"); expected = getenv("PROBE_EXT") ? strtol(getenv("PROBE_EXT"), NULL, 0) : 1; ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_PROBE_EXT, SBI_EXT_BASE, 0, 0, 0, 0, 0);