From patchwork Wed Apr 5 08:58:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiwei Li X-Patchwork-Id: 13201427 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 1BEDEC7619A for ; Wed, 5 Apr 2023 08:59:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjyyO-0000fq-Ef; Wed, 05 Apr 2023 04:58:32 -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 1pjyyM-0000fQ-Bq; Wed, 05 Apr 2023 04:58:30 -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 1pjyyI-0003Cs-PB; Wed, 05 Apr 2023 04:58:30 -0400 Received: from localhost.localdomain (unknown [180.175.29.170]) by APP-05 (Coremail) with SMTP id zQCowAAH+BQoOC1kWY5GDg--.24854S2; Wed, 05 Apr 2023 16:58:17 +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 v3 0/4] target/riscv: Simplification for RVH related check and code style fix Date: Wed, 5 Apr 2023 16:58:09 +0800 Message-Id: <20230405085813.40643-1-liweiwei@iscas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2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjfUoO J5UUUUU 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) v3: * rebase on riscv-to-apply.next (partial patches in v2 have been applied) * Fix new found format problem in patch 2,3,4 of v3 Weiwei Li (4): target/riscv: Remove riscv_cpu_virt_enabled() 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 | 47 ++-- target/riscv/cpu.h | 31 +-- target/riscv/cpu_bits.h | 2 +- target/riscv/cpu_helper.c | 274 ++++++++++---------- target/riscv/csr.c | 90 +++---- target/riscv/debug.c | 21 +- target/riscv/fpu_helper.c | 24 +- target/riscv/gdbstub.c | 3 +- target/riscv/insn_trans/trans_rvv.c.inc | 36 +-- target/riscv/m128_helper.c | 16 +- target/riscv/machine.c | 18 +- target/riscv/op_helper.c | 20 +- target/riscv/pmp.c | 66 ++--- target/riscv/pmp.h | 9 +- target/riscv/pmu.c | 7 +- target/riscv/sbi_ecall_interface.h | 8 +- target/riscv/translate.c | 26 +- target/riscv/vector_helper.c | 317 ++++++++++++++---------- 19 files changed, 552 insertions(+), 470 deletions(-) Reviewed-by: Daniel Henrique Barboza