From patchwork Mon Mar 27 08:08:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiwei Li X-Patchwork-Id: 13188709 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 DD1FCC7619A for ; Mon, 27 Mar 2023 08:10:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pghux-0007Ks-P9; Mon, 27 Mar 2023 04:09:27 -0400 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 1pghuu-0007Ha-1V; Mon, 27 Mar 2023 04:09:24 -0400 Received: from smtp25.cstnet.cn ([159.226.251.25] helo=cstnet.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pghuq-00054Y-9n; Mon, 27 Mar 2023 04:09:23 -0400 Received: from localhost.localdomain (unknown [180.175.29.170]) by APP-05 (Coremail) with SMTP id zQCowACnrWUkTyFksV29Cg--.4754S2; Mon, 27 Mar 2023 16:09:09 +0800 (CST) From: Weiwei Li To: qemu-riscv@nongnu.org, qemu-devel@nongnu.org Cc: palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, dbarboza@ventanamicro.com, zhiwei_liu@linux.alibaba.com, wangjunqiang@iscas.ac.cn, lazyparser@gmail.com, Weiwei Li Subject: [PATCH v2 00/10] target/riscv: Simplification for RVH related check and code style fix Date: Mon, 27 Mar 2023 16:08:48 +0800 Message-Id: <20230327080858.39703-1-liweiwei@iscas.ac.cn> X-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x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUb XdbUUUUUU== X-Originating-IP: [180.175.29.170] X-CM-SenderInfo: 5olzvxxzhlqxpvfd2hldfou0/ Received-SPF: pass client-ip=159.226.251.25; 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 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 This patchset tries to simplify the RVH related check and fix some code style problems, such as problems for indentation, multi-line comments and lines with over 80 characters. The port is available here: https://github.com/plctlab/plct-qemu/tree/plct-virtfix-upstream v2: * add comment to specify riscv_cpu_set_virt_enabled() can only be called when RVH is enabled in patch 4 (suggested by Richard Henderson) * merge patch from LIU Zhiwei(Message-ID: <20230325145348.1208-1-zhiwei_liu@linux.alibaba.com>) to patch 5 * use env->virt_enabled directly instead of riscv_cpu_virt_enabled() in patch 6 (suggested by LIU Zhiwei) * remain the orginal identation for macro name in patch 8 (suggested by LIU Zhiwei) LIU Zhiwei (1): target/riscv: Convert env->virt to a bool env->virt_enabled Weiwei Li (9): target/riscv: Remove redundant call to riscv_cpu_virt_enabled target/riscv: Remove redundant check on RVH target/riscv: Remove check on RVH for riscv_cpu_virt_enabled target/riscv: Remove check on RVH for riscv_cpu_set_virt_enabled target/riscv: Remove riscv_cpu_virt_enabled() target/riscv: Remove redundant parentheses target/riscv: Fix format for indentation target/riscv: Fix format for comments target/riscv: Fix lines with over 80 characters target/riscv/arch_dump.c | 7 +- target/riscv/cpu.c | 8 +- target/riscv/cpu.h | 29 +-- target/riscv/cpu_bits.h | 5 +- target/riscv/cpu_helper.c | 142 ++++++------ target/riscv/csr.c | 52 ++--- target/riscv/debug.c | 10 +- target/riscv/insn_trans/trans_rvv.c.inc | 36 +-- target/riscv/machine.c | 6 +- target/riscv/op_helper.c | 21 +- target/riscv/pmp.c | 48 ++-- target/riscv/pmp.h | 9 +- target/riscv/pmu.c | 7 +- target/riscv/sbi_ecall_interface.h | 8 +- target/riscv/translate.c | 14 +- target/riscv/vector_helper.c | 292 ++++++++++++++---------- 16 files changed, 378 insertions(+), 316 deletions(-)