From patchwork Tue Jul 12 06:32:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiwei Li X-Patchwork-Id: 12914559 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 F3956C43334 for ; Tue, 12 Jul 2022 07:01:22 +0000 (UTC) Received: from localhost ([::1]:57380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oB9tZ-0004SD-Ta for qemu-devel@archiver.kernel.org; Tue, 12 Jul 2022 03:01:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oB9SN-0003Yw-DY; Tue, 12 Jul 2022 02:33:15 -0400 Received: from smtp21.cstnet.cn ([159.226.251.21]:53760 helo=cstnet.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oB9SJ-0001bq-CL; Tue, 12 Jul 2022 02:33:15 -0400 Received: from localhost.localdomain (unknown [180.156.173.38]) by APP-01 (Coremail) with SMTP id qwCowADns1idFc1ijYPeDg--.64613S2; Tue, 12 Jul 2022 14:33:03 +0800 (CST) From: Weiwei Li To: palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, qemu-riscv@nongnu.org, qemu-devel@nongnu.org Cc: wangjunqiang@iscas.ac.cn, lazyparser@gmail.com, Weiwei Li Subject: [PATCH v2 0/6] Improve the U/S/H extension related check Date: Tue, 12 Jul 2022 14:32:30 +0800 Message-Id: <20220712063236.23834-1-liweiwei@iscas.ac.cn> X-Mailer: git-send-email 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173.38] X-CM-SenderInfo: 5olzvxxzhlqxpvfd2hldfou0/ Received-SPF: pass client-ip=159.226.251.21; envelope-from=liweiwei@iscas.ac.cn; helo=cstnet.cn X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" This patchset tries to improve the U/S/H related check: * add check for the supported privilege modes conbinations: only supporting M, S mode is not a suggested combination * add check for "H extension depends on I extension" * add check for "H extension implicitly requires S mode" * add check for csrs only existed when U mode is supported * fix and simplify the checks in hmode/hmode32 Any suggestions are welcome. v2: * update patch 3 to make the newlines start at the same position as above line * update patch 5 to add check for "H extension implicitly requires S mode" Weiwei Li (6): target/riscv: add check for supported privilege modes conbinations target/riscv: H extension depends on I extension target/riscv: fix checkpatch warning may triggered in csr_ops table target/riscv: add check for csrs existed with U extension target/riscv: fix checks in hmode/hmode32 target/riscv: simplify the check in hmode to resue the check in riscv_csrrw_check target/riscv/cpu.c | 17 ++ target/riscv/csr.c | 491 ++++++++++++++++++++++++--------------------- 2 files changed, 279 insertions(+), 229 deletions(-)