From nobody Tue Nov 11 03:22:40 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=1560822272; cv=none; d=zoho.com; s=zohoarc; b=Sm1Uji57SIeLPS3PIg6t56npHtBUOz21VmmJ3nhKqqE0KpLTXjvXdBm3HmNItlFPIy1KbxDCEhsEnXi9RY+4aijAC7HdCjwzFaw8FcR9USbtoiym5btKAXYiY8wZPoKnmociec+g8SU13jIVoB3pzHUHDgwZZI7ZrpaYGSzkYrY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560822272; 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=Rixquz0f2Gz+rh35g6jQvQ03k6uEFOmYFNQ2QmY5aSo=; b=oQ47TpfUfgG/Z1NbibO+ld3eU90rGB7D/nUcnJT/iFrXKQZ2p8tznvaZr6n9Ty6uS0LDlBT36ihcza88LypYuqSFnhzqoQRk/3JmO6sYjvWiu+ZGO7liCoNMcsq/CNPyAojKW2+aUuBOLTxPrfZ0uAz3Bq3BsyChBL/234XL9us= 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 1560822272766938.5066636947531; Mon, 17 Jun 2019 18:44:32 -0700 (PDT) Received: from localhost ([::1]:53012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hd3Ai-00082S-Mh for importer@patchew.org; Mon, 17 Jun 2019 21:44:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41024) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hd30I-0006vf-JL for qemu-devel@nongnu.org; Mon, 17 Jun 2019 21:33:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hd30H-0000CR-6s for qemu-devel@nongnu.org; Mon, 17 Jun 2019 21:33:42 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:24430) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hd30G-0000A1-Rj; Mon, 17 Jun 2019 21:33:41 -0400 Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2019 09:33:41 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 17 Jun 2019 18:33:10 -0700 Received: from risc6-mainframe.sdcorp.global.sandisk.com (HELO risc6-mainframe.int.fusionio.com) ([10.196.157.140]) by uls-op-cesaip01.wdc.com with ESMTP; 17 Jun 2019 18:33:40 -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=1560821621; x=1592357621; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PhCUtrqF7yEAsHBc4uhl3pPi0G+raSB/DW34xH+qBXU=; b=MuT29wwKEB0DJ2WSba9/q82ueFBrzuCbsEWlN73X0FiHq12/0Tt+mehG 3JnDC5Kta7f4AGa62mqgp6Se1W1BwP6ROSTdRU4RzlEH4s6QAiS8/6bW+ CY132+rzQ304LOtDT6TxUmUzVjj9d+yNSs01JEXn3LDrWYzDTPuNjaOcf HKGevQA+nxlwQFKURI68LtqO7TPrlggEz00IDxbxe82jRqiWJMgcxeICr n4E6Dooo6Dtu4zDWHzlDoJZxioTTXmO4YVgugwlZl95vdvm/pJVJJtFs1 FJyIhN6QUO5nzhaBO7SbAjR9Wmc+6mZ4vbu2T4Y+kccJK9fDkKO24+cSh w==; X-IronPort-AV: E=Sophos;i="5.63,386,1557158400"; d="scan'208";a="112055104" IronPort-SDR: N3ufcin+DTbSh1gHE2mMW7bXW0Ec0nS9zLBWz+57eh40y0HX6n3QWac8fcWiqdo1eVStqBEP+P I0yE8QgRNduGNP7xkzzyORfhbmX1LwB4m0dLCDKdggCZ6+b9rTm3etVl0MnVEX3XYepvRMHsQe q3oGA6b7QpvNA7qWT/CpuFTP9QBVIQf9+5veS1qzBDblZ+wkyrPFg0fSfqy6+M7giCyA4DghnL 37sytLWbKL3qQeDPcoHik75h8TwpDjekbv7+WpnwpN6TfZVvydN9BkVx9zTvtf/iszAQkvNHkc cELOZyKHuhXQw8kytCHHOrtb IronPort-SDR: pw5EqYkyx4rgnErmzenbDgD0AWqTrOYnrhyoZIBsPUSuW/X7Ar7gwOBPZm8IYE8+GNMTv6LZVq 81MNybvCnNxkhz9FoQabOTJGmT8A0DBhIfoAvwDiyhPVgFsG5270ZwgAxq1fCLAlBZA4jL10Nv OdWQ7xk0WDLXAkgq8SQowq97+oCaRqyO/dDKZ3lUNlS1oCdH/mDDbIdSE7RfnJNfyn3z7rke09 gwn/o2uD+SxzLkYKARLBdgLeGFS3HsN64JS0rfdQ+z9z2Lb/dL1Lph+PsY+/O6vy76iTPkhx7z 2bY= From: Alistair Francis To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Date: Mon, 17 Jun 2019 18:31:19 -0700 Message-Id: <8d6536823ee1969cd5effbf58b2041ce44f08eec.1560821342.git.alistair.francis@wdc.com> 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.144 Subject: [Qemu-devel] [PATCH v1 7/9] target/riscv: Remove user version information 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" Remove the user version information. This was never used and never publically exposed in a release of QEMU, so let's just remove it. In future to manage versions we can extend the extension properties to specify version. Signed-off-by: Alistair Francis --- target/riscv/cpu.c | 32 +++++++++----------------------- target/riscv/cpu.h | 2 -- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 21bfaa9722..ddbe922958 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -89,9 +89,8 @@ static void set_misa(CPURISCVState *env, target_ulong mis= a) env->misa_mask =3D env->misa =3D misa; } =20 -static void set_versions(CPURISCVState *env, int user_ver, int priv_ver) +static void set_priv_version(CPURISCVState *env, int priv_ver) { - env->user_ver =3D user_ver; env->priv_ver =3D priv_ver; } =20 @@ -111,7 +110,7 @@ static void riscv_any_cpu_init(Object *obj) { CPURISCVState *env =3D &RISCV_CPU(obj)->env; set_misa(env, RVXLEN | RVI | RVM | RVA | RVF | RVD | RVC | RVU); - set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_11_0); + set_priv_version(env, PRIV_VERSION_1_11_0); set_resetvec(env, DEFAULT_RSTVEC); } =20 @@ -128,7 +127,7 @@ static void rv32gcsu_priv1_09_1_cpu_init(Object *obj) { CPURISCVState *env =3D &RISCV_CPU(obj)->env; set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU); - set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_09_1); + set_priv_version(env, PRIV_VERSION_1_09_1); set_resetvec(env, DEFAULT_RSTVEC); set_feature(env, RISCV_FEATURE_MMU); set_feature(env, RISCV_FEATURE_PMP); @@ -138,7 +137,7 @@ static void rv32gcsu_priv1_10_0_cpu_init(Object *obj) { CPURISCVState *env =3D &RISCV_CPU(obj)->env; set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU); - set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0); + set_priv_version(env, PRIV_VERSION_1_10_0); set_resetvec(env, DEFAULT_RSTVEC); set_feature(env, RISCV_FEATURE_MMU); set_feature(env, RISCV_FEATURE_PMP); @@ -148,7 +147,7 @@ static void rv32imacu_nommu_cpu_init(Object *obj) { CPURISCVState *env =3D &RISCV_CPU(obj)->env; set_misa(env, RV32 | RVI | RVM | RVA | RVC | RVU); - set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0); + set_priv_version(env, PRIV_VERSION_1_10_0); set_resetvec(env, DEFAULT_RSTVEC); set_feature(env, RISCV_FEATURE_PMP); } @@ -166,7 +165,7 @@ static void rv64gcsu_priv1_09_1_cpu_init(Object *obj) { CPURISCVState *env =3D &RISCV_CPU(obj)->env; set_misa(env, RV64 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU); - set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_09_1); + set_priv_version(env, PRIV_VERSION_1_09_1); set_resetvec(env, DEFAULT_RSTVEC); set_feature(env, RISCV_FEATURE_MMU); set_feature(env, RISCV_FEATURE_PMP); @@ -176,7 +175,7 @@ static void rv64gcsu_priv1_10_0_cpu_init(Object *obj) { CPURISCVState *env =3D &RISCV_CPU(obj)->env; set_misa(env, RV64 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU); - set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0); + set_priv_version(env, PRIV_VERSION_1_10_0); set_resetvec(env, DEFAULT_RSTVEC); set_feature(env, RISCV_FEATURE_MMU); set_feature(env, RISCV_FEATURE_PMP); @@ -186,7 +185,7 @@ static void rv64imacu_nommu_cpu_init(Object *obj) { CPURISCVState *env =3D &RISCV_CPU(obj)->env; set_misa(env, RV64 | RVI | RVM | RVA | RVC | RVU); - set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0); + set_priv_version(env, PRIV_VERSION_1_10_0); set_resetvec(env, DEFAULT_RSTVEC); set_feature(env, RISCV_FEATURE_PMP); } @@ -317,7 +316,6 @@ static void riscv_cpu_realize(DeviceState *dev, Error *= *errp) CPURISCVState *env =3D &cpu->env; RISCVCPUClass *mcc =3D RISCV_CPU_GET_CLASS(dev); int priv_version =3D PRIV_VERSION_1_11_0; - int user_version =3D USER_VERSION_2_02_0; target_ulong target_misa =3D 0; Error *local_err =3D NULL; =20 @@ -342,18 +340,7 @@ static void riscv_cpu_realize(DeviceState *dev, Error = **errp) } } =20 - if (cpu->cfg.user_spec) { - if (!g_strcmp0(cpu->cfg.user_spec, "v2.02.0")) { - user_version =3D USER_VERSION_2_02_0; - } else { - error_setg(errp, - "Unsupported user spec version '%s'", - cpu->cfg.user_spec); - return; - } - } - - set_versions(env, user_version, priv_version); + set_priv_version(env, priv_version); set_resetvec(env, DEFAULT_RSTVEC); =20 if (cpu->cfg.mmu) { @@ -454,7 +441,6 @@ static Property riscv_cpu_properties[] =3D { DEFINE_PROP_BOOL("s", RISCVCPU, cfg.ext_s, true), DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true), DEFINE_PROP_STRING("priv_spec", RISCVCPU, cfg.priv_spec), - DEFINE_PROP_STRING("user_spec", RISCVCPU, cfg.user_spec), DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true), DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true), DEFINE_PROP_END_OF_LIST(), diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 4e58c3b856..a558c353f0 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -78,7 +78,6 @@ enum { RISCV_FEATURE_MISA }; =20 -#define USER_VERSION_2_02_0 0x00020200 #define PRIV_VERSION_1_09_1 0x00010901 #define PRIV_VERSION_1_10_0 0x00011000 #define PRIV_VERSION_1_11_0 0x00011100 @@ -104,7 +103,6 @@ struct CPURISCVState { =20 target_ulong badaddr; =20 - target_ulong user_ver; target_ulong priv_ver; target_ulong misa; target_ulong misa_mask; --=20 2.22.0