From patchwork Tue Jul 30 23:35:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 11066901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA8E214DB for ; Tue, 30 Jul 2019 23:39:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD51E27F98 for ; Tue, 30 Jul 2019 23:39:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF2D2288B3; Tue, 30 Jul 2019 23:39:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 50A8227F98 for ; Tue, 30 Jul 2019 23:39:36 +0000 (UTC) Received: from localhost ([::1]:36806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsbiR-0006M9-5h for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Jul 2019 19:39:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57772) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsbhP-0005JE-NH for qemu-devel@nongnu.org; Tue, 30 Jul 2019 19:38:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsbhO-0001sl-Mr for qemu-devel@nongnu.org; Tue, 30 Jul 2019 19:38:31 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:2172) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hsbhO-0001r8-DT; Tue, 30 Jul 2019 19:38:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1564529911; x=1596065911; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TzSLaqGd1ijZpKYVZGyg4YDJEHLu4T6oDeS8B/digZY=; b=JnJhv33wo2q+MvYxc42I3et9SWKs1UP8Ey5K86LU0xEKHM7CUHYYHN/X gfgfDySa//bEE/tkSRteguuOq3PDa8e9/WUkDxitt23xKD5gTzXaknqt8 SB0EI3P78kAHvrxk/8Y7WfzW8Yx5IB/Sohb1xeu0n7ebM7g6+bssUMXYl RFVcCKntGU6h1vIVSvzLrPtp04vXdyAbv5BCtKlYekN42JH7t2WcBNq+V aj373e4qNqlv+NEeRogAxowFwS8snm89pqRBr1tBqgi3EzPCRTKi+Ishe veROGgjAkOZuxJHI18e4EZZ1nNJMoVos3LOaLOuDlyc1Z0q4E6LfKOocR Q==; IronPort-SDR: +z5KeEronAc9zV9wGgxQ2fn5sUxKOJ8cPQQjh9l9LyLfKLn51FgEbspg+tQlw+sRUE5t06BQff F2OxtqcFZZR7LrGRQke8JHLx5YJi7OtVNGF1cr9VBSUPXBRQzpX2aXPImJGB64iLr4c2EfjcPX gMog6Gaifv69wSFMnXEq/XVWnKawS7mfypn098Wt4gzlUBQ274g8n+Iff74egrS0wTF9wBYI9d Rz43Z3KEIFd81M5kZm9EYr59tFJz0ixwu+HPuD8wnoW4dP+eNv+VPpUuHjEyQ13M2vAIoCm99p +n4= X-IronPort-AV: E=Sophos;i="5.64,327,1559491200"; d="scan'208";a="116132618" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 31 Jul 2019 07:38:27 +0800 IronPort-SDR: 20B4XNCxalkYbjm2YTXoAa/SILbAcDi7UmYdtD3JbBlM/wmYL24lJFIczfquqgHAhZfDtX8Zb/ jjZsbvuxjgZGuESEyzRPfweivH7wIyKf0NV6J0u3pEFaRr82nmo9yDCpry9s+r9gXhQWHLQvu0 N9zwCV5iQXh7ROgp1dnzPsOrM8BEg+/tB6G7PSTaKrIthZSL7zbe9wMvriycQg5OwMSgkGDGoi +Ihh4laNS3cWCZsjl+n2HNltYWEKNwtQ2PW1adE1c7xurkyXFvr2VNfZur2g6ogLlQyFpkrf0G iKbQSJ7dBDSENoAfQOyd4vM8 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 30 Jul 2019 16:36:28 -0700 IronPort-SDR: QHc8BU6VDFbEpaT4RGNLfWu7UO4GtqSGxx1ouVrcfMbLaZbnw5CZ7FhRr4MiuaWAt5fe7ikDDc 9o1Kv3A6i+eyk2mr3C9vXv1QFp2+FmFOi+R820HfyVzNWfO5LqwZq5fhjSOk21OLuTgEh3vzhb 90vucpeCHd2fZ9ubrRezOs1H3DW2Rvh4FYZBOvM2Vly8aIuSxaAWxQvPxP9NTU3eX00DSofIgb x6wQLzYq5OA+gbS2Xu37mgLKldSXnRkR2zjkBJ9MX227YxDepAdM3rs7s5c+q7xQIDgPMiNFMC EXE= Received: from risc6-mainframe.sdcorp.global.sandisk.com (HELO risc6-mainframe.int.fusionio.com) ([10.196.157.58]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Jul 2019 16:38:27 -0700 From: Alistair Francis To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Date: Tue, 30 Jul 2019 16:35:19 -0700 Message-Id: <868a01ec5dd656f26ebb06d0b4313452f66206e3.1564529681.git.alistair.francis@wdc.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 216.71.154.45 Subject: [Qemu-devel] [PATCH-4.2 v2 1/5] target/riscv: Don't set write permissions on dirty PTEs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair23@gmail.com, palmer@sifive.com, alistair.francis@wdc.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Setting write permission on dirty PTEs results in userspace inside a Hypervisor guest (VU) becoming corrupted. This appears to be because it ends up with write permission in the second stage translation in cases where we aren't doing a store. Signed-off-by: Alistair Francis --- target/riscv/cpu_helper.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index e32b6126af..f027be7f16 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -340,10 +340,8 @@ restart: if ((pte & PTE_X)) { *prot |= PAGE_EXEC; } - /* add write permission on stores or if the page is already dirty, - so that we TLB miss on later writes to update the dirty bit */ - if ((pte & PTE_W) && - (access_type == MMU_DATA_STORE || (pte & PTE_D))) { + /* add write permission on stores */ + if ((pte & PTE_W) && (access_type == MMU_DATA_STORE)) { *prot |= PAGE_WRITE; } return TRANSLATE_SUCCESS; From patchwork Tue Jul 30 23:35:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 11066903 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 36EE2746 for ; Tue, 30 Jul 2019 23:39:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24B8727F98 for ; Tue, 30 Jul 2019 23:39:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18F72288B3; Tue, 30 Jul 2019 23:39:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AF22427F98 for ; Tue, 30 Jul 2019 23:39:38 +0000 (UTC) Received: from localhost ([::1]:36808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsbiT-0006T6-W5 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Jul 2019 19:39:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57838) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsbhQ-0005JG-DK for qemu-devel@nongnu.org; Tue, 30 Jul 2019 19:38:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsbhP-0001tj-7f for qemu-devel@nongnu.org; Tue, 30 Jul 2019 19:38:32 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:2164) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hsbhO-0001jk-VU; Tue, 30 Jul 2019 19:38:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1564529911; x=1596065911; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4KhMKveagWI7BDqokS3HdF3E2uSk0r+2CqujjD2dHoA=; b=YiaQ+8lG+0NNdwFnELEEmlDWQF417TPjfuYUAIOF5KTroSwi7vAotOL7 8gQdyA+793A/r2hp3ADBQgx/vpcRaoS9Z2dNhkKIuxcLD26ETH6eLLuDC BYwYOpS4XOFzdlFV7r2rJENyHk6sPPUh51Q2g8LVn+r2ytt4qo1+t51Yt j3MahhcefOk25fgnDHgc1TUyBXg7eN7o3yhSrY9WZ+tBcaFznHEDSQXG/ U80+cI02hSCPd3tmmgKReJAEKH4FEPGzHC7uBUhxBAIpgUab1gT393kPD gnCcHCduWT5NdkGL+WpxoZNZMHjIBeshXg6u9ABt2R+hAAFWW8zi0l2iy Q==; IronPort-SDR: 59Y+vUayyPAR8JYMqgOcJvn241vNOqF0nuteAexNY114JWhlVWMdawIgPmh1PVnu3/hgsLDiqH dC+181O3MyczNEifaoGCsyfuP0H75KSyVpui+RzDHr2Olmv9j4I4WOgta2cd4u5V+hd+txTW5b +GD6dxuaVr/+2HYjQP1VnPiOrvG6KGyeM1f6B4CNnQKJdNrK4/4Uwkba4T4gbLgVbxNNPhlxaZ hSFFwCZB401mA/JZtVhPbubsRbf1CX3BVNcemTptrlwOCYQFyV143InddSYjozyrajcjX1hiqm RLA= X-IronPort-AV: E=Sophos;i="5.64,327,1559491200"; d="scan'208";a="116132623" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 31 Jul 2019 07:38:29 +0800 IronPort-SDR: cphpGqK1gYEHrkWEMgasX8v8hjI84nEcUkgbPDzX9RJ3xr2/Zw2v3I1/QQxC5ICjCxQdXS0M0q X59LoPY62V6PEmfshXqeHno0uO/0BwRDwyC9vhiuLWAx8qinvCOxNzODvhD4w4xvPtEu/rZ4t0 klxINmLoeBRJhnCBJHecdNvct+YMqZSLqlhJ8LQOJlIizFB7RefBkqpJrL9ALfZVsaYSbdDeky pAwTtmvSFnQ/B8UOeibqc+SP21ZCSkzqVSPfmKJYIRleXyWwcMYiEYbm2qDLfEfQmgpe3K/Npd SSFd5qQb/F3mNUxM7cdQEC5Y Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 30 Jul 2019 16:36:31 -0700 IronPort-SDR: HshvwjrlLf0Ta+3I8QVhMqGse20O1Zn8NoHyY0kQWWuxbVtoqZanLyW95beEmeDNqqo6TLP/X+ /qvOH8xhID32+5n0PRfSOtepXnF0qlMqw/2XpwpC4ZRHOyMfV69Cm0SRvu9NbYD6VgzNcvtwbW xxR4oK/yaW47/te/XixzzxEWt7N0Kwh/cavAnCPbfZGH+nriNM0G80kg4hWAYZNo+jkbGXDEj0 WISKNY9DsCVcOuZ3aEmFGQHGVXTzb5bELoUS1t4Mx5BP6tc4raFMMvM9R4zz3U+bHx6zsIL+Q7 rRg= Received: from risc6-mainframe.sdcorp.global.sandisk.com (HELO risc6-mainframe.int.fusionio.com) ([10.196.157.58]) by uls-op-cesaip02.wdc.com with ESMTP; 30 Jul 2019 16:38:29 -0700 From: Alistair Francis To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Date: Tue, 30 Jul 2019 16:35:21 -0700 Message-Id: <61ae4a524013f0408a9431f1fe856d99bb3f9041.1564529681.git.alistair.francis@wdc.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 216.71.154.45 Subject: [Qemu-devel] [PATCH-4.2 v2 2/5] riscv: plic: Remove unused interrupt functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair23@gmail.com, palmer@sifive.com, alistair.francis@wdc.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Alistair Francis Reviewed-by: Jonathan Behrens Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Chih-Min Chao --- hw/riscv/sifive_plic.c | 12 ------------ include/hw/riscv/sifive_plic.h | 3 --- 2 files changed, 15 deletions(-) diff --git a/hw/riscv/sifive_plic.c b/hw/riscv/sifive_plic.c index 0950e89e15..864a1bed42 100644 --- a/hw/riscv/sifive_plic.c +++ b/hw/riscv/sifive_plic.c @@ -161,18 +161,6 @@ static void sifive_plic_update(SiFivePLICState *plic) } } -void sifive_plic_raise_irq(SiFivePLICState *plic, uint32_t irq) -{ - sifive_plic_set_pending(plic, irq, true); - sifive_plic_update(plic); -} - -void sifive_plic_lower_irq(SiFivePLICState *plic, uint32_t irq) -{ - sifive_plic_set_pending(plic, irq, false); - sifive_plic_update(plic); -} - static uint32_t sifive_plic_claim(SiFivePLICState *plic, uint32_t addrid) { int i, j; diff --git a/include/hw/riscv/sifive_plic.h b/include/hw/riscv/sifive_plic.h index ce8907f6aa..3b8a623919 100644 --- a/include/hw/riscv/sifive_plic.h +++ b/include/hw/riscv/sifive_plic.h @@ -69,9 +69,6 @@ typedef struct SiFivePLICState { uint32_t aperture_size; } SiFivePLICState; -void sifive_plic_raise_irq(SiFivePLICState *plic, uint32_t irq); -void sifive_plic_lower_irq(SiFivePLICState *plic, uint32_t irq); - DeviceState *sifive_plic_create(hwaddr addr, char *hart_config, uint32_t num_sources, uint32_t num_priorities, uint32_t priority_base, uint32_t pending_base, From patchwork Tue Jul 30 23:35:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 11066905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B2A95746 for ; Tue, 30 Jul 2019 23:40:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D0AE27F98 for ; Tue, 30 Jul 2019 23:40:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E7DF288B3; Tue, 30 Jul 2019 23:40:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BC1C27F98 for ; Tue, 30 Jul 2019 23:40:00 +0000 (UTC) Received: from localhost ([::1]:36810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsbip-00071e-EI for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Jul 2019 19:39:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58706) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsbhe-0005eV-OF for qemu-devel@nongnu.org; Tue, 30 Jul 2019 19:38:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsbhb-0002BX-I2 for qemu-devel@nongnu.org; Tue, 30 Jul 2019 19:38:46 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:19364) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hsbha-00025U-45; Tue, 30 Jul 2019 19:38:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1564529922; x=1596065922; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hVtBKdzYjqRlGaozMF9hQt/mWrHXuNhNv7qXXrqCGcs=; b=DUV4T0h7qREHAVy8ySlAfSSoG9hE2dRDQLnF/s/T62NKbKwgF4i42Zkc bKJ1Hyviar1cUESOzFBQ4FjYZZqqw/BMpKYwcsPBfcLw4CZ0a5rqfjPN1 zQ3lHpxSnTfjx6SLqlqRC84s//F3Wqj0nc+y8OE+ZwgAMq6FBb/ohUCwm MAqkuVwkOJR9AnFadaIvRu0vCKe3GM8jgIKdRlyV9Vace6RllbsKJoiX4 +K8CLqcjynMN5LXfjBidSBqjcphTArmbGkFQ3XEyhY18jbArcEm0UAvA8 GSMouTu34LVPAWIn3ZS7WtmQeLWJ2AbN4PFd5MW4GGhuc8EstkXQ2jJGW A==; IronPort-SDR: jph4Yg4CrAZksgeWyB0HQsXeQJkp2D9VD5Lo1Z3AShbGuOccMRCHSMshhX4OSOG4Bnk0ZIOje5 LfKdoMAL+OCr4eh4deig82Gs27cy0KRIMTyUJVTQJkeFMh6hxDMJOxDNW15ZIQD6SqCeEDxPDy BvXmRihvHh6gGfIZ1QaScE6iCb/vI7ljo3GPA/KAbYrSoI1MCXEoZe4NCezwO577NedsqTTowb kMYJ/HmJTR094K1qKhY3kiv4kGYtsDuKzMpY+aOZXb1y0B/StXup0eSQsJNDSnb3WwOFR5qY30 mq0= X-IronPort-AV: E=Sophos;i="5.64,327,1559491200"; d="scan'208";a="221001698" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 31 Jul 2019 07:38:37 +0800 IronPort-SDR: /zWBL13yKuIYKTbiMDN+s2SovuFzAJzWVy3jRkYUGG1FbXUjcAn2rX9MQzYDS3G/x3aNnjOg1C ne30CcVSqlJ8I9INUqTHRcq73IQezbiQZO7NPrddInh3djbXpDdBBwYDnTopJ3vaGjw63mP57Z dTUCeDza1G+FZbsV1K7N2I1DUlUR98DqBisiVqZBUpM+RHpAEei6sSDvboVsno/5rc6X0IYISV XJZk74WasrxbtReM/2hY/3Vyp3sTrThW4a968Jdj/hxIZhCVfQSm5El6Tg+iLpDqkK/SFWkue+ 7sO9wm4uUn1gXuk99bFMkEXb Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 30 Jul 2019 16:36:39 -0700 IronPort-SDR: OzXitxnBWjdCOwP+EqWVtQPHRyzpEiqnlN6eeLleh35Mxf+Mm9Wfs+LabT9DofhU0Bx3Q1ETuc dMHeaK1EOw1i6rnw26NdShSobSrUbWNGicWkxXXEJ6fweKGcPfwVStXJMbCwQZA9Aq0JhdrwgD pu9vtTA68qt5NRosOLMQfqXFmtzv46fEbYAO6TTmWYzJjayqCacBEN3ObJByxAQX1zJ4RsLCW5 jW/K2Y+xMGFKRrevoRAYlcns9m+jXT9Hk3ycu9pernOVs/7eBwiDEoWp/4FaP+ADWCGtIIbdTy +A8= Received: from risc6-mainframe.sdcorp.global.sandisk.com (HELO risc6-mainframe.int.fusionio.com) ([10.196.157.58]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Jul 2019 16:38:37 -0700 From: Alistair Francis To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Date: Tue, 30 Jul 2019 16:35:24 -0700 Message-Id: X-Mailer: git-send-email 2.22.0 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 68.232.141.245 Subject: [Qemu-devel] [PATCH-4.2 v2 3/5] target/riscv: Create function to test if FP is enabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair23@gmail.com, palmer@sifive.com, alistair.francis@wdc.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Let's create a function that tests if floating point support is enabled. We can then protect all floating point operations based on if they are enabled. This patch so far doesn't change anything, it's just preparing for the Hypervisor support for floating point operations. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Christophe de Dinechin --- target/riscv/cpu.h | 6 +++++- target/riscv/cpu_helper.c | 10 ++++++++++ target/riscv/csr.c | 20 +++++++++++--------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 0adb307f32..2dc9b17678 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -255,6 +255,7 @@ void riscv_cpu_do_interrupt(CPUState *cpu); int riscv_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg); int riscv_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); bool riscv_cpu_exec_interrupt(CPUState *cs, int interrupt_request); +bool riscv_cpu_fp_enabled(CPURISCVState *env); int riscv_cpu_mmu_index(CPURISCVState *env, bool ifetch); hwaddr riscv_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); void riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr, @@ -298,7 +299,10 @@ static inline void cpu_get_tb_cpu_state(CPURISCVState *env, target_ulong *pc, #ifdef CONFIG_USER_ONLY *flags = TB_FLAGS_MSTATUS_FS; #else - *flags = cpu_mmu_index(env, 0) | (env->mstatus & MSTATUS_FS); + *flags = cpu_mmu_index(env, 0); + if (riscv_cpu_fp_enabled(env)) { + *flags |= env->mstatus & MSTATUS_FS; + } #endif } diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index f027be7f16..225e407cff 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -71,6 +71,16 @@ bool riscv_cpu_exec_interrupt(CPUState *cs, int interrupt_request) #if !defined(CONFIG_USER_ONLY) +/* Return true is floating point support is currently enabled */ +bool riscv_cpu_fp_enabled(CPURISCVState *env) +{ + if (env->mstatus & MSTATUS_FS) { + return true; + } + + return false; +} + int riscv_cpu_claim_interrupts(RISCVCPU *cpu, uint32_t interrupts) { CPURISCVState *env = &cpu->env; diff --git a/target/riscv/csr.c b/target/riscv/csr.c index e0d4586760..2789215b5e 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -46,7 +46,7 @@ void riscv_set_csr_ops(int csrno, riscv_csr_operations *ops) static int fs(CPURISCVState *env, int csrno) { #if !defined(CONFIG_USER_ONLY) - if (!env->debugger && !(env->mstatus & MSTATUS_FS)) { + if (!env->debugger && !riscv_cpu_fp_enabled(env)) { return -1; } #endif @@ -108,7 +108,7 @@ static int pmp(CPURISCVState *env, int csrno) static int read_fflags(CPURISCVState *env, int csrno, target_ulong *val) { #if !defined(CONFIG_USER_ONLY) - if (!env->debugger && !(env->mstatus & MSTATUS_FS)) { + if (!env->debugger && !riscv_cpu_fp_enabled(env)) { return -1; } #endif @@ -119,7 +119,7 @@ static int read_fflags(CPURISCVState *env, int csrno, target_ulong *val) static int write_fflags(CPURISCVState *env, int csrno, target_ulong val) { #if !defined(CONFIG_USER_ONLY) - if (!env->debugger && !(env->mstatus & MSTATUS_FS)) { + if (!env->debugger && !riscv_cpu_fp_enabled(env)) { return -1; } env->mstatus |= MSTATUS_FS; @@ -131,7 +131,7 @@ static int write_fflags(CPURISCVState *env, int csrno, target_ulong val) static int read_frm(CPURISCVState *env, int csrno, target_ulong *val) { #if !defined(CONFIG_USER_ONLY) - if (!env->debugger && !(env->mstatus & MSTATUS_FS)) { + if (!env->debugger && !riscv_cpu_fp_enabled(env)) { return -1; } #endif @@ -142,7 +142,7 @@ static int read_frm(CPURISCVState *env, int csrno, target_ulong *val) static int write_frm(CPURISCVState *env, int csrno, target_ulong val) { #if !defined(CONFIG_USER_ONLY) - if (!env->debugger && !(env->mstatus & MSTATUS_FS)) { + if (!env->debugger && !riscv_cpu_fp_enabled(env)) { return -1; } env->mstatus |= MSTATUS_FS; @@ -154,7 +154,7 @@ static int write_frm(CPURISCVState *env, int csrno, target_ulong val) static int read_fcsr(CPURISCVState *env, int csrno, target_ulong *val) { #if !defined(CONFIG_USER_ONLY) - if (!env->debugger && !(env->mstatus & MSTATUS_FS)) { + if (!env->debugger && !riscv_cpu_fp_enabled(env)) { return -1; } #endif @@ -166,7 +166,7 @@ static int read_fcsr(CPURISCVState *env, int csrno, target_ulong *val) static int write_fcsr(CPURISCVState *env, int csrno, target_ulong val) { #if !defined(CONFIG_USER_ONLY) - if (!env->debugger && !(env->mstatus & MSTATUS_FS)) { + if (!env->debugger && !riscv_cpu_fp_enabled(env)) { return -1; } env->mstatus |= MSTATUS_FS; @@ -307,6 +307,7 @@ static int write_mstatus(CPURISCVState *env, int csrno, target_ulong val) { target_ulong mstatus = env->mstatus; target_ulong mask = 0; + int dirty; /* flush tlb on mstatus fields that affect VM */ if (env->priv_ver <= PRIV_VERSION_1_09_1) { @@ -340,8 +341,9 @@ static int write_mstatus(CPURISCVState *env, int csrno, target_ulong val) mstatus = (mstatus & ~mask) | (val & mask); - int dirty = ((mstatus & MSTATUS_FS) == MSTATUS_FS) | - ((mstatus & MSTATUS_XS) == MSTATUS_XS); + dirty = (riscv_cpu_fp_enabled(env) && + ((mstatus & MSTATUS_FS) == MSTATUS_FS)) | + ((mstatus & MSTATUS_XS) == MSTATUS_XS); mstatus = set_field(mstatus, MSTATUS_SD, dirty); env->mstatus = mstatus; From patchwork Tue Jul 30 23:35:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 11066909 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A9205746 for ; Tue, 30 Jul 2019 23:41:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95EC32883A for ; Tue, 30 Jul 2019 23:41:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A309288B3; Tue, 30 Jul 2019 23:41:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3995F2883A for ; Tue, 30 Jul 2019 23:41:25 +0000 (UTC) Received: from localhost ([::1]:36830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsbkC-0000l1-Gu for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Jul 2019 19:41:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58806) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsbhf-0005ga-Ov for qemu-devel@nongnu.org; Tue, 30 Jul 2019 19:38:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsbhe-0002EB-Nv for qemu-devel@nongnu.org; Tue, 30 Jul 2019 19:38:47 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:19364) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hsbhc-00025U-CU; Tue, 30 Jul 2019 19:38:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1564529924; x=1596065924; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QZpfN+9MLyliw63TCQlK8Hfjlr2GhFEuBVQNAdzVumM=; b=SWM/25lYdALfCoADTdbVyHfXXhbFz4KTCGR7GF8+3VHaQZDE6fj8cPeJ u3C08wRVvu4FKkznxjAQYro0u58kf3BI5NhHe7H1fs5EA+HdajGe8+qOr I84KhriWdhLTNO7kjSl9+GRpTl9BQptAb5evK7gjO2OLvIuUxnukxEB7H 6UpiWHkk1uiDPB1BSVCG/A2Sj6xvcIw9JzAqzxpUgOo80plZB5xC32Znq v2bm6/Wj63hSzkw9Ba+QXehVzZ6t8y5BDiVtJpPfWbDu8BilqSyUYmiAi QtA+usUxNzTFPCPqdSw3qU6MKb8lTi/UG6bHzWI4j1aYYMadGRzZS/qcz Q==; IronPort-SDR: Hd1EhEaHb2BChgED1CtCZmxz2D6Q25pb5BvoGZ58vdovQFmqx5y66GFYiFGK5UnB5iefiXxZoV tFM0WStZuKT7Vp9HctKjmweigmqhEzFsx6ToC3sGSvW86pf0Hiy0sZL/e2/TcXUSTyLYRLgNNr 36T1vA/KcnTrN6xpnL3y9XmHpEQQ0aOpFd7ieV1KX8AeD5Y1P88+uVutDSnFsAsd2RwM7GNN+C PdD1zp8A6JHmGfzMRW+UaNjF2Yd0VOOkW7Z1XZbjUA8tpQ51Pt6XRJMNdfOEdghh51SlmHDCDY QZg= X-IronPort-AV: E=Sophos;i="5.64,327,1559491200"; d="scan'208";a="221001699" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 31 Jul 2019 07:38:40 +0800 IronPort-SDR: T2f4+Wh4QL5VAJVQndHzLgbg5tqOjcUF/0q649LA+k0Eo0HzDazrZr5rBRwmKu4MyUuXtgEBtH OHNC/6wHdqGngLPuFhofkLBcezOQ0rYELHQCxt46FmQ0PuHEg6qBve5sT+CbyVR+QdNuZJwZ5G +ErmvKhVTLxY4cLL9+4uBPXMJoRVOtsLbramd5BGOPqd0btnpwJuE4lvb3+tXlMmVzuUSGm/D2 K+OqkcN/88kao6RUvvgLqwAerLBkh9HW6nCKR2MDQAlq+Ww2gH7adErbpaub+jl2ZYfoxZPCp6 z6HA0jDGimZN4PA3DsLrPPwd Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 30 Jul 2019 16:36:41 -0700 IronPort-SDR: KlqEXsXsswSxrqLF5MB8YuJB7fNQUmkXGCEw7y+bcG3OiiveXWyDUciae6ywRbY3pWv5doyreS SUMhkinB5a+wWlMgKfcjyb6DsUHL3TIgCfwIYSJFf6+Mj5CPsbuv8wDIVZHoYdAeGjZVtJl+gV zP9SS773Y58zAi1NiLrxKEd6D18+0i3uWz4vSJFMlLsGzvHWU65mNLwycmfrV2UTTYsgIItwk/ 41Oahi7dTOb45m7LlwStyva+meaY/p65xsZc6DYOPq5IJlfCFAOXtWSG5iHBa3vTEwvzl3U86N SQ4= Received: from risc6-mainframe.sdcorp.global.sandisk.com (HELO risc6-mainframe.int.fusionio.com) ([10.196.157.58]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Jul 2019 16:38:40 -0700 From: Alistair Francis To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Date: Tue, 30 Jul 2019 16:35:32 -0700 Message-Id: X-Mailer: git-send-email 2.22.0 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 68.232.141.245 Subject: [Qemu-devel] [PATCH-4.2 v2 4/5] target/riscv: Update the Hypervisor CSRs to v0.4 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair23@gmail.com, palmer@sifive.com, alistair.francis@wdc.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Update the Hypervisor CSR addresses to match the v0.4 spec. Signed-off-by: Alistair Francis --- target/riscv/cpu_bits.h | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/target/riscv/cpu_bits.h b/target/riscv/cpu_bits.h index 11f971ad5d..e99834856c 100644 --- a/target/riscv/cpu_bits.h +++ b/target/riscv/cpu_bits.h @@ -173,6 +173,24 @@ #define CSR_SPTBR 0x180 #define CSR_SATP 0x180 +/* Hpervisor CSRs */ +#define CSR_HSTATUS 0x600 +#define CSR_HEDELEG 0x602 +#define CSR_HIDELEG 0x603 +#define CSR_HCOUNTERNEN 0x606 +#define CSR_HGATP 0x680 + +#if defined(TARGET_RISCV32) +#define HGATP_MODE SATP32_MODE +#define HGATP_VMID SATP32_ASID +#define HGATP_PPN SATP32_PPN +#endif +#if defined(TARGET_RISCV64) +#define HGATP_MODE SATP64_MODE +#define HGATP_VMID SATP64_ASID +#define HGATP_PPN SATP64_PPN +#endif + /* Physical Memory Protection */ #define CSR_PMPCFG0 0x3a0 #define CSR_PMPCFG1 0x3a1 @@ -206,23 +224,6 @@ #define CSR_DPC 0x7b1 #define CSR_DSCRATCH 0x7b2 -/* Hpervisor CSRs */ -#define CSR_HSTATUS 0xa00 -#define CSR_HEDELEG 0xa02 -#define CSR_HIDELEG 0xa03 -#define CSR_HGATP 0xa80 - -#if defined(TARGET_RISCV32) -#define HGATP_MODE SATP32_MODE -#define HGATP_ASID SATP32_ASID -#define HGATP_PPN SATP32_PPN -#endif -#if defined(TARGET_RISCV64) -#define HGATP_MODE SATP64_MODE -#define HGATP_ASID SATP64_ASID -#define HGATP_PPN SATP64_PPN -#endif - /* Performance Counters */ #define CSR_MHPMCOUNTER3 0xb03 #define CSR_MHPMCOUNTER4 0xb04 From patchwork Tue Jul 30 23:35:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 11066913 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FB09746 for ; Tue, 30 Jul 2019 23:43:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C3C02883A for ; Tue, 30 Jul 2019 23:43:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40931288B3; Tue, 30 Jul 2019 23:43:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E351E2883A for ; Tue, 30 Jul 2019 23:43:25 +0000 (UTC) Received: from localhost ([::1]:36854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsbm9-0002q8-7p for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Jul 2019 19:43:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58857) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsbhg-0005hr-80 for qemu-devel@nongnu.org; Tue, 30 Jul 2019 19:38:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsbhf-0002Fi-6T for qemu-devel@nongnu.org; Tue, 30 Jul 2019 19:38:48 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:64657) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hsbhe-0002B2-Ra; Tue, 30 Jul 2019 19:38:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1564529945; x=1596065945; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XNjBwmh1LFBChEJ+quD7Z2691WqYMlE30zxPXnx8bn8=; b=CyAbk/axey1QbaIOldH46SVWARgCLC20Xt1V2BSgZRR32q47ri7q9Vy7 Aq+7LGOLo8tl3ExLKcLOqOie5o8e03HdBqsrNl9zeR7d3ecYC5OqpOYnJ y44sb80m9djyjHkPPeMLvdwNIlaFQo1Rk6vHliy3YQdxWIFUYIHQqRMDd UPBQ1eoEnL3c+6Ei3VnkZIOSFtDeJ5vSYyOOFkT3e4OeFeNnxp6Y5owvS D6ZeYE/qpd0qgMtuxTqmALXEseebnKuuolGvi46Fk7n4YuxsAZaHZXOQA wfZ0mkakXlBFq1nvaMTDnts71ZDniyJ3+K9dLGubP+pweBz9sewIzkXFq A==; IronPort-SDR: Q13MU3nhyexKrVTtwcvZPj4z7VuNPVQVN3j/P3JT0V4qZj8wUDpjtf0SeEyRsJ/bfRnRLxroP2 /Xv1UGTty6m1gv89OsQX7NVPwq6OIkAL0n8nDZXm9aGglR750bjZMvekMsRysH/DQ+rjTzBo6q LazEOqKpYUkGrb6XADiNa6y8JMgeEJPAhtGFu9YKHqelUl6U/slv/gX90Z0L5w7pC3S+uMBrPh KmySrqGoioo8NvFmtYA4ZK8ItX9Nnw7tAKLF1r2dpGOpxFYD0ujLdMP4ATn4LjvWexjfee+Amc C6Q= X-IronPort-AV: E=Sophos;i="5.64,327,1559491200"; d="scan'208";a="214723427" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 31 Jul 2019 07:38:59 +0800 IronPort-SDR: VI4HQYTTcvSUUL94Y4jRXLB8epwRlyS+NUbTUamkGz7Wf79sfZPWsHmr0WWlcNQcJGI9yxKwB6 oURqNdk1/gDx2lxxaL0zZR09G3JRmlnVtDmfCvfXtLbK73hsFcGmanoV9UKha6bF6tBl7wQZxC q5gvEe/rWdgmu3bFcpUqgGeOW70xVL1GctT8uKbmkvGkI+xyo13ZNAVo16sERicYu01fIAAbD6 q68oOIayMaBX96td5QesVagayZ+rrCaUEtqqDL7VXGqoELnsfO425tsPLzT8gjvuaqsCXZWbtx iOJLv+vvXlnVk7TrfBg4r1Bj Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 30 Jul 2019 16:36:44 -0700 IronPort-SDR: NNOTdrK/BhUqnANVC2MqXAOr/9tzAEDbHAgTFwo5R7+5+xP2ZGPlib/e7JTUffn4t+OCN7pYwt GRP0KLt9kUbytvvfhPXYqZAB+SI+ssu84JG0kxm7nVqoOSKUtMqfWPFOqGBjZ0zK0gmFKRKLLr QIPO3QX8rdTZCN4iEUJHmyPfqXkKk0Z1yiudZJgKX8lQvPL7CAzEANmHCqgl4NJOxmrtbmsaaK jHn7vzijPKjkBTOttGFTuYE+HcUSh03Q2fj7Wm2tjafdLTuCsZAFRjD5rIjdUu8Huafma6NK9R Eg4= Received: from risc6-mainframe.sdcorp.global.sandisk.com (HELO risc6-mainframe.int.fusionio.com) ([10.196.157.58]) by uls-op-cesaip02.wdc.com with ESMTP; 30 Jul 2019 16:38:42 -0700 From: Alistair Francis To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Date: Tue, 30 Jul 2019 16:35:34 -0700 Message-Id: <4dad98dcc3b6a3f3a5097922494b0521c60570c7.1564529681.git.alistair.francis@wdc.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 68.232.143.124 Subject: [Qemu-devel] [PATCH-4.2 v2 5/5] target/riscv: Fix Floating Point register names X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair23@gmail.com, palmer@sifive.com, alistair.francis@wdc.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Atish Patra As per the RISC-V spec, Floating Point registers are named as f0..f31 so lets fix the register names accordingly. Signed-off-by: Atish Patra Signed-off-by: Alistair Francis --- target/riscv/cpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index f8d07bd20a..af1e9b7690 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -40,10 +40,10 @@ const char * const riscv_int_regnames[] = { }; const char * const riscv_fpr_regnames[] = { - "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7", - "fs0", "fs1", "fa0", "fa1", "fa2", "fa3", "fa4", "fa5", - "fa6", "fa7", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7", - "fs8", "fs9", "fs10", "fs11", "ft8", "ft9", "ft10", "ft11" + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31" }; const char * const riscv_excp_names[] = {