From nobody Tue Nov 11 03:22:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=wdc.com ARC-Seal: i=1; a=rsa-sha256; t=1560822033; cv=none; d=zoho.com; s=zohoarc; b=ck+jHmM2hD/nnJOdu3FOduHxIhivvGXcOLA68vIQdb5tjCJt9x1AbzJNd7Ihi78IXIbXlNpO7NMnejnyA4U8YBCxY/yGfAOg31zS3m7cSjf/Q0IGjSDuU3FfIVRxTuvpuavApwA6wICjxFOtulzQf1h7JrYI2H5A5flBXrOqFBc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560822033; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=5wxuEunmgUyoZa/APSPzJdWGeLH2PZIAgt9FXsoCQCk=; b=J4ba7+Q0XiRF7mkWQ9iacNwsoS7eKovmt/cadL05xLMw/6CAUVqjY9OmxZ0ZVl3M3Qw5SusNLLjmOwPEpnD8/RietWlo2SfahcSE9TUMand38+bqfg6iHXOgwe7cMFerKRTWrk9RkIXI66rtnWzpBRj6UP+qzMq17uru9Uh4Epw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail header.i=@wdc.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560822033737842.359512068151; Mon, 17 Jun 2019 18:40:33 -0700 (PDT) Received: from localhost ([::1]:52974 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hd36u-0003lw-QC for importer@patchew.org; Mon, 17 Jun 2019 21:40:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40880) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hd307-0006cG-Py for qemu-devel@nongnu.org; Mon, 17 Jun 2019 21:33:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hd306-0008SK-OU for qemu-devel@nongnu.org; Mon, 17 Jun 2019 21:33:31 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:60680) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hd306-0008QF-Bs; Mon, 17 Jun 2019 21:33:30 -0400 Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2019 09:33:29 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 17 Jun 2019 18:33:01 -0700 Received: from risc6-mainframe.sdcorp.global.sandisk.com (HELO risc6-mainframe.int.fusionio.com) ([10.196.157.140]) by uls-op-cesaip02.wdc.com with ESMTP; 17 Jun 2019 18:33:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560821610; x=1592357610; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=M1eC63nLbKo5deTZERedixlrYYiXU7yvY+1DteOQC7U=; b=ASPNVYy6lMfsDq8k6wCpWFo0QGPoOvbr1Bsu3mjzWk/DcjubxvoH5RXR bZrYr+yip2vn8aR2xtXiSxXd/i/wmVQRo+hpjL7NfcCTYrNkH3wpxPIkR j+LhCeHK531arcyVayM8Z6J120E16HMNQyLaDHZwbuEvm/4pAmO31a2+a clKBfEUI2xeNnkuD2qPYlcwM/T1E351qVH8DO9KsTW/SngI0NdZbsEIla 3uokkyjmn716ML9RwPjtE6y6d19WhSAxnRLMCml36PRQntyz1TsgNGIax ivfJwo31R0Yb3ZQ1sm2mwnLgg9QnEBccuJrawTgHTGFtWAOksKWPryHuq Q==; X-IronPort-AV: E=Sophos;i="5.63,386,1557158400"; d="scan'208";a="115717022" IronPort-SDR: Ofxj6kIPdmhmNMpf2yZrgoiWwwj/W/JIsJVdv/jUEbHIB573cWbIztjHB2sZbFk660MkSmFvem 2W0w0YI51ZPyxbor8QPjJ9bysAEpea0pzTU+imcJKV50XNpTxPXTMsK/8KyQDUw6tNF7ny2BOK jfy4pI3LfCHsTHHROQqRexGUpB8t8sM+JnB5l4BqJgI9OsWf6D+iaKlzcXoOzjPl3yuejv9wKl p0Jb4ZyAEz0yMWNZPR9olslRPaWw85xC9HMK/z3e1qczqXdM7Eo83DmSIzvH1ndAx/kFQwNIfQ ltlQ9EgKAWh1ZVXYWRSskN1n IronPort-SDR: 6uJu5WczK5Mj6IXKS8b+FVfSFKlHedeA+FruTcYD+I1m3OiY6xBoM2gwJYp0NrGqSSzkc6ICjc 17/iDvAEdIBCf01S6Z41iJArsRsshnYFh0f6iHQGktjSYqJuicR1DhcvzUCtG36iEU0tq1hYP9 XuXfbwJeHLjnOEiAl2xticJwQZhB+oYK5b6Tk1YPTrxIBQ3jiLUP4mU/rb4/+tty0eqPpSyV8W IBfcU1QrbwHj2mnuklsxcbXR0APcCPdR30InCa0MJGa/wqDweUoyjh1QUEKbTpQO+j86/GgnAD A+Q= From: Alistair Francis To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Date: Mon, 17 Jun 2019 18:31:08 -0700 Message-Id: X-Mailer: git-send-email 2.22.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 216.71.153.141 Subject: [Qemu-devel] [PATCH v1 3/9] target/riscv: Comment in the mcountinhibit CSR 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Add a comment for the new mcountinhibit which conflicts with the CSR_MUCOUNTEREN from version 1.09.1. This can be updated when we remove 1.09.1. Signed-off-by: Alistair Francis --- target/riscv/cpu_bits.h | 1 + target/riscv/csr.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/target/riscv/cpu_bits.h b/target/riscv/cpu_bits.h index 47450a3cdb..11f971ad5d 100644 --- a/target/riscv/cpu_bits.h +++ b/target/riscv/cpu_bits.h @@ -136,6 +136,7 @@ #define CSR_MCOUNTEREN 0x306 =20 /* Legacy Counter Setup (priv v1.9.1) */ +/* Update to #define CSR_MCOUNTINHIBIT 0x320 for 1.11.0 */ #define CSR_MUCOUNTEREN 0x320 #define CSR_MSCOUNTEREN 0x321 #define CSR_MHCOUNTEREN 0x322 diff --git a/target/riscv/csr.c b/target/riscv/csr.c index c67d29e206..437387fd28 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -461,18 +461,20 @@ static int write_mcounteren(CPURISCVState *env, int c= srno, target_ulong val) return 0; } =20 +/* This regiser is replaced with CSR_MCOUNTINHIBIT in 1.11.0 */ static int read_mscounteren(CPURISCVState *env, int csrno, target_ulong *v= al) { - if (env->priv_ver > PRIV_VERSION_1_09_1) { + if (env->priv_ver > PRIV_VERSION_1_09_1 && env->priv_ver < PRIV_VERSIO= N_1_11_0) { return -1; } *val =3D env->mcounteren; return 0; } =20 +/* This regiser is replaced with CSR_MCOUNTINHIBIT in 1.11.0 */ static int write_mscounteren(CPURISCVState *env, int csrno, target_ulong v= al) { - if (env->priv_ver > PRIV_VERSION_1_09_1) { + if (env->priv_ver > PRIV_VERSION_1_09_1 && env->priv_ver < PRIV_VERSIO= N_1_11_0) { return -1; } env->mcounteren =3D val; --=20 2.22.0