From nobody Sun May 19 16:31:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1615456279; cv=none; d=zohomail.com; s=zohoarc; b=PlIpDB8xx9XM6Rbhqe4KuJSt3xy3s/oRPPqPKUK/gtI0QMQiGq2fa8NIUIzilSCRdJw9RoUgRIHVB04EQCqdUKonVvSnXjZN6fsFTzvM1c0WX6lad29VCW8KVlJ8yBddRr8/ITFJx7ovEgPFODjScWi94+IVgz+XmgfCsKxaU9Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615456279; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=4VG237Hr4XvO1sodZsFhC60OsMQiKRY9U3++xWvI9/w=; b=Lx5vqg1gGIUnNc4dzR+8WDxDL0F96nv0GHieZ3qZaH9+6Y1cBk20fYTCx2y3CouFyKU7t5cznVZqRllro1ncf0PzVaQduNPbFuV5jkwYIAmmrTWSKa8JvxBe2UDBDEhJoTL+QQhLnw+vMW9MvUjz5i9XwvAzYo/TRV+qpxyKgmY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615456279431705.6302537464459; Thu, 11 Mar 2021 01:51:19 -0800 (PST) Received: from localhost ([::1]:54018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKHyQ-00056V-90 for importer@patchew.org; Thu, 11 Mar 2021 04:51:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKHwT-000406-BM; Thu, 11 Mar 2021 04:49:17 -0500 Received: from serv1.kernkonzept.com ([2a01:4f8:1c1c:b490::2]:54101 helo=mx.kernkonzept.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKHwS-0002XM-0k; Thu, 11 Mar 2021 04:49:17 -0500 Received: from [86.56.46.35] (helo=broc.lan) by mx.kernkonzept.com with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) id 1lKHwQ-0005Uj-Ce; Thu, 11 Mar 2021 10:49:14 +0100 From: Georg Kotheimer To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH] target/riscv: Make VSTIP and VSEIP read-only in hip Date: Thu, 11 Mar 2021 10:49:02 +0100 Message-Id: <20210311094902.1377593-1-georg.kotheimer@kernkonzept.com> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: softfail client-ip=2a01:4f8:1c1c:b490::2; envelope-from=georg.kotheimer@kernkonzept.com; helo=mx.kernkonzept.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.02, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action 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: Alistair Francis , Georg Kotheimer Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Georg Kotheimer Reviewed-by: Alistair Francis --- target/riscv/csr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index fd2e6363f3..00a3ab72af 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -420,7 +420,8 @@ static const target_ulong sstatus_v1_10_mask =3D SSTATU= S_SIE | SSTATUS_SPIE | SSTATUS_UIE | SSTATUS_UPIE | SSTATUS_SPP | SSTATUS_FS | SSTATUS_XS | SSTATUS_SUM | SSTATUS_MXR | SSTATUS_SD; static const target_ulong sip_writable_mask =3D SIP_SSIP | MIP_USIP | MIP_= UEIP; -static const target_ulong hip_writable_mask =3D MIP_VSSIP | MIP_VSTIP | MI= P_VSEIP; +static const target_ulong hip_writable_mask =3D MIP_VSSIP; +static const target_ulong hvip_writable_mask =3D MIP_VSSIP | MIP_VSTIP | M= IP_VSEIP; static const target_ulong vsip_writable_mask =3D MIP_VSSIP; =20 static const char valid_vm_1_10_32[16] =3D { @@ -962,9 +963,9 @@ static int rmw_hvip(CPURISCVState *env, int csrno, targ= et_ulong *ret_value, target_ulong new_value, target_ulong write_mask) { int ret =3D rmw_mip(env, 0, ret_value, new_value, - write_mask & hip_writable_mask); + write_mask & hvip_writable_mask); =20 - *ret_value &=3D hip_writable_mask; + *ret_value &=3D hvip_writable_mask; =20 return ret; } --=20 2.30.1