From patchwork Sun Nov 10 17:16:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Raphael Tiovalen X-Patchwork-Id: 2009263 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=HzOkUsSN; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=I+Jtuakt; 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 4XmfVg3hr8z1xty for ; Mon, 11 Nov 2024 04:16:58 +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=UdoURawR5GXfdjEIygvPKbOQ4rhz2se7g4mB3pNLehY=; b=HzOkUsSNvtdSom hmzsaomPBS7+CMCw50PXrqaA1qs95Fw1iBc+awoj84f49muHSLgTO3AEqmSk3QILtZISkApAxlIg9 OS5NoTDKTbQZhFnCHb0PYu25bIg/3wxM1wR9gnCNnffedIUKCtt0Nt5AQcvOeoXiKhq7HElXocC8Q T14WFLGZf0g7nEGii7yxNLUVoStMtBFMXHKp4Zv4EnZGe1l0U+cZXfm3I9CR+HH55+w/INolMbEiv 69Xapvo4BTkpP9Q7RfXA6Z6Q3FmxqE+Nb98wf3X7120zoba2+FmgHcTHLEAobza7rlYbbhM0MgmmD Jb0cWH9xR1TQKnOi9xJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tABYX-0000000FIAy-2RNV; Sun, 10 Nov 2024 17:16:57 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tABYU-0000000FIAD-11Je for kvm-riscv@lists.infradead.org; Sun, 10 Nov 2024 17:16:56 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-71e61b47c6cso3439053b3a.2 for ; Sun, 10 Nov 2024 09:16:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731259013; x=1731863813; 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=ZCCoNTQwwcDguEq3XP3suaGgR9K6ba2ktOXnBr/d6YY=; b=I+JtuaktE3Ga2aqB8SH4z1MaSGOuHoG3/WW+gxy47NnCifIyOBSQ1MxKF+i3R0TY/m fjWdhnKpRSh/r6UFWHl7JP5RA2tJR+Xb+i4LkAoGInjlA/bMyoJretLAPwbkTLB1u/9Y 0PYt/WxnDKeiR+zYyP4YF8L+6im9tOo6j6md51NCHPSmvg4ERbjGT5ZsMNEEzouusI+p N9Ca8aVIiH96tb9ieSjM3sK2pdHirEynasq9VVJtvIZe1ruogKLNUNNvKycnUaEX2FK+ wRXivGVLnR6EFXJeNjWRdbr8XSvdYGmAxkxjViH6Icpd1lQQnL4cBDw9frIllkwkPbQl iowA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731259013; x=1731863813; 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=ZCCoNTQwwcDguEq3XP3suaGgR9K6ba2ktOXnBr/d6YY=; b=fBbf7Qb/00s5LnoSPkOBpwVoD/u7QcC/DAVQfq+61dYHq5UBlNY+0q8KPI3zh1Ve8i CJx0orpXThVOmCTC9RdEuj7G+8mb93utbiKB4d2DRHHx62+ZcSlYIXQJfTkC5Ksc+z/s IYTHTVaMrRFd2Kj/Bb7l0tcjDzv+pCtToqfEDn7bRFs6XNdYV9B6PA3l9DhuZ7DFRguG LkdvJvqkIOZQY9kZPHgcCg1zRp6X8A6Ev75DRCV+WAtKFn0TdQ6XBFMKmjDTR+5ejPq6 Ecb9tklDajL5E4BC6RqgwdiInRcVfdsRUjWg0/iMJkW7k0NkBIygxi6pkLIhHI3GFHf9 I4Zg== X-Forwarded-Encrypted: i=1; AJvYcCU2Y1zthXl+N1nt/h4NnwXh9D1HnlfxddCQbnRcAbgx8SqdjvoolMuKr0Utu5XuN63CJAEUm7+8y0k=@lists.infradead.org X-Gm-Message-State: AOJu0YzeqDjxjq+T7aGQy12z5DwuJgZQTYr6jJDVom7rELwAg2JumF1Y BrHSHCrJ5HE61rUg+/dVqI3bW7gNKk9+vscBCQI3Ba0vD59PVjcV X-Google-Smtp-Source: AGHT+IEBiVfip7v0mmbZOhJon3GVzGyCgLC+LSM84N9LfeypvBBj6i6P9oA2LSCNerQUJMMKI3twGQ== X-Received: by 2002:a05:6a00:4f8c:b0:720:2dbf:9f60 with SMTP id d2e1a72fcca58-72413349738mr13531476b3a.16.1731259012961; Sun, 10 Nov 2024 09:16:52 -0800 (PST) Received: from JRT-PC.. ([202.166.44.78]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724078641a2sm7578415b3a.20.2024.11.10.09.16.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Nov 2024 09:16:52 -0800 (PST) From: James Raphael Tiovalen To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Cc: andrew.jones@linux.dev, atishp@rivosinc.com, cade.richard@berkeley.edu, James Raphael Tiovalen Subject: [kvm-unit-tests PATCH v7 0/2] riscv: sbi: Add support to test HSM extension Date: Mon, 11 Nov 2024 01:16:31 +0800 Message-ID: <20241110171633.113515-1-jamestiotio@gmail.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-20241110_091654_482700_718EC803 X-CRM114-Status: GOOD ( 14.94 ) X-Spam-Score: -2.1 (--) 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: This patch series adds support for testing all 4 functions of the HSM extension as defined in the RISC-V SBI specification. The first patch in version 7 of this series fixes the entry point of the HSM [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 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_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jamestiotio(at)gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:433 listed in] [list.dnswl.org] 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 This patch series adds support for testing all 4 functions of the HSM extension as defined in the RISC-V SBI specification. The first patch in version 7 of this series fixes the entry point of the HSM tests, while the second patch adds the actual test for the HSM extension. Based-on: https://gitlab.com/jones-drew/kvm-unit-tests/-/commits/riscv/sbi v7: - Addressed all of Andrew's comments. - Fixed the entry point of the HSM tests to follow the SUSP tests. v6: - Rebased on top of the latest commit of the riscv/sbi branch. - Removed unnecessary cleanup code in the HSM tests after improvements to the on-cpus API were made by Andrew. v5: - Addressed all of Andrew's comments. - Added 2 new patches to clear on_cpu_info[cpu].func and to set the cpu_started mask, which are used to perform cleanup after running the HSM tests. - Added some new tests to validate suspension on RV64 with the high bits set for suspend_type. - Picked up the hartid_to_cpu rewrite patch from Andrew's branch. - Moved the variables declared in riscv/sbi.c in patch 2 to group it together with the other HSM test variables declared in patch 5. v4: - Addressed all of Andrew's comments. - Included the 2 patches from Andrew's branch that refactored some functions. - Added timers to all of the waiting activities in the HSM tests. v3: - Addressed all of Andrew's comments. - Split the report_prefix_pop patch into its own series. - Added a new environment variable to specify the maximum number of CPUs supported by the SBI implementation. v2: - Addressed all of Andrew's comments. - Added a new patch to add helper routines to clear multiple prefixes. - Reworked the approach to test the HSM extension by using cpumask and on-cpus. James Raphael Tiovalen (2): riscv: sbi: Fix entry point of HSM tests riscv: sbi: Add tests for HSM extension riscv/sbi-tests.h | 13 +- riscv/sbi-asm.S | 33 +-- riscv/sbi.c | 613 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 642 insertions(+), 17 deletions(-) --- 2.43.0