From patchwork Thu Jan 9 09:10:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Klokov X-Patchwork-Id: 13932234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C73C3E77199 for ; Thu, 9 Jan 2025 09:12:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVoZZ-0001uf-EO; Thu, 09 Jan 2025 04:11:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tVoZR-0001q7-V8; Thu, 09 Jan 2025 04:11:19 -0500 Received: from m.syntacore.com ([178.249.69.228] helo=pmg.syntacore.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tVoZJ-0003j7-S1; Thu, 09 Jan 2025 04:11:14 -0500 Received: from pmg.syntacore.com (localhost.localdomain [127.0.0.1]) by pmg.syntacore.com (Proxmox) with ESMTP id 2EE4BB41CD8; Thu, 9 Jan 2025 12:10:52 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=syntacore.com; h=cc:cc:content-transfer-encoding:content-type:content-type :date:from:from:message-id:mime-version:reply-to:subject:subject :to:to; s=m; bh=NEwevy5HxYv5alAL1TZJjK2zMH7yaQzAg1LtL8/6mac=; b= nG4p6gHPtfuqsRfMNc51zk+RndLOb+Zl731lE1IJdzvfkz4IwFBTr7qouS6fzc4B 3UmIfZ7lCmiGwvoXgzmFAUdq90/WngRz4v05xJ1eCbqWH0tiaeI1LlLG+I6YfsV/ dODJ+ek694TyXI1Est0wpq23ptvZx2zrDddEKfT9nFtLtDVYjM1oMUdItcu1yxRf Zq6mklT2YoT0Gnph/ua62okQ3I9zl1c1IiVIu47TUwCtIF0Pc2xFz7gnc66/ckvL bDxvx3cHdHhRVNSkEBlawpdSfOVC1KnVnVEa77Okssur15N/MKAl5yjxx2iTH33Q MRlu/2sUlZD/n1Xe/MMkNQ== Received: from S-SC-EXCH-01.corp.syntacore.com (exchange.syntacore.com [10.76.202.20]) by pmg.syntacore.com (Proxmox) with ESMTPS id 19336B41CC9; Thu, 9 Jan 2025 12:10:52 +0300 (MSK) Received: from VirtualBox.corp.yadro.com (10.76.4.56) by S-SC-EXCH-01.corp.syntacore.com (10.76.202.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 9 Jan 2025 12:09:30 +0300 From: Ivan Klokov To: CC: , , , , , , , , , , Ivan Klokov Subject: [PATCH v9 0/2] Support RISC-V CSR read/write in Qtest environment Date: Thu, 9 Jan 2025 12:10:42 +0300 Message-ID: <20250109091044.32723-1-ivan.klokov@syntacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.76.4.56] X-ClientProxiedBy: S-SC-EXCH-01.corp.syntacore.com (10.76.202.20) To S-SC-EXCH-01.corp.syntacore.com (10.76.202.20) Received-SPF: pass client-ip=178.249.69.228; envelope-from=ivan.klokov@syntacore.com; helo=pmg.syntacore.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org These patches add functionality for unit testing RISC-V-specific registers. The first patch adds a Qtest backend, and the second implements a simple test. --- v9: - Fix build errors. v8: - Delete RFC label. v7: - Fix build errors, add Reviewed-by, Acked-by. --- Ivan Klokov (2): target/riscv: Add RISC-V CSR qtest support tests/qtest: QTest example for RISC-V CSR register hw/riscv/riscv_hart.c | 55 +++++++++++++++++++++++++++++++++++ tests/qtest/libqtest.c | 27 +++++++++++++++++ tests/qtest/libqtest.h | 14 +++++++++ tests/qtest/meson.build | 2 +- tests/qtest/riscv-csr-test.c | 56 ++++++++++++++++++++++++++++++++++++ 5 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 tests/qtest/riscv-csr-test.c