From nobody Tue Feb 10 10:03:44 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=1658905308; cv=none; d=zohomail.com; s=zohoarc; b=JGxPvX/FM725eyA9Cgs/Eo2jtWArPvuwL0Ib9xRAvtBcLMOVVM2vxY8TxLHbepw3l15jAH62TnnbEKqMub6VRrj6OJnUpbPn1wpenk0O1vMFZ3W7Y/ZyPuDKf5mNHOOoGqwbqEmSH3R0mSu0IvMzQ4wMtpRcV9v6EC3e0lNZ5vY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658905308; 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; bh=ThpLPET2Eini7rQ0D0JXvPWeNVDY+aGeRs+Dr2K+CnQ=; b=ZMbnEFm93W+7v+hh15h/4bdX+PE8bBoxhftKFmN+SCwyPEzsuRcc2cDLAI3UCiws9B5pbNWQOFCGvPIjOB/fyeJTbxZj6wczYPn59oBGovQJ/L4WofuIbHYtoRy/Ahzm/7Y3PQUKNu/mOtOXgn41xfk1AKJ47Ijxov1j9sGZqkw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1658905308231217.48527677535287; Wed, 27 Jul 2022 00:01:48 -0700 (PDT) Received: from localhost ([::1]:44534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGb3C-0004Dm-V5 for importer@patchew.org; Wed, 27 Jul 2022 03:01:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGarG-0002rF-AS for qemu-devel@nongnu.org; Wed, 27 Jul 2022 02:49:26 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:42893) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGarE-0003E7-93 for qemu-devel@nongnu.org; Wed, 27 Jul 2022 02:49:26 -0400 Received: by mail-pg1-x529.google.com with SMTP id q22so9997052pgt.9 for ; Tue, 26 Jul 2022 23:49:23 -0700 (PDT) Received: from atishp.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id f16-20020a170902ab9000b0016d2d2c7df1sm12764851plr.188.2022.07.26.23.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 23:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ThpLPET2Eini7rQ0D0JXvPWeNVDY+aGeRs+Dr2K+CnQ=; b=jwU+pAdFs8r0KYc+UP1g6a+QZdTrnBFHQbT4NlYZ1guCTB60I6TeR4LdtTCsXjeNUz BrIFBEAc/El8tKFy30dTzjymhtamoqa67Srajh/jqZVgfZ0pJ35+BOQQGcwoAacVfPTK LohTN5HLXU12ewZVP7jaxrk7F72cQUK6J7N4mSB0xVUCV4LFpog54vySNNrIj263PiCj MEwWDnJiF65xmRiYtuTyVkIMiokUWV14f96guIN9McffnDYoRgIaJzDJUnXurElQHT3I 6PcSdoQ9KXss7rJZnpunCvgiRi82kEIci6ur6PD1Fr1/kMe8JSkTGKrK0yX6fEzSa53M oTUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ThpLPET2Eini7rQ0D0JXvPWeNVDY+aGeRs+Dr2K+CnQ=; b=62dloLyA54dSY+o30We0gbbPRP7rz3JVTjtCxx1qAez8dLyiL8UVja2Pl2F0+abw7Q dMt31cLBS+uUQ8L8iFpp7smzoEB+IPnitfBaYL2bffn03l69mjptzd1obSbVjPK8GY5/ VPRIVnWUp37wpjVBJgTQC0pyUpneAFmHLDvVZh+wZPkgUfaHTC8oH0opzIj/sequosiW 88FRONNkn4XeIlSBFXSxtXOBfGSvRdiKTHnQQ2qLHEG5NXN5OnjFLDYdHX+TLl4sZFPn 8AaCBzwMi+aCLEY2y3AOiUuLC5ZzzYQFgXgMwGayafCFb68BHWCfHkyasUjlnYnHazsz TwQA== X-Gm-Message-State: AJIora8YobIkDd7OhTw5RQsfS+kmWUi7K9THHTQkzlA2+9h7IypBe9aY cIXj5t+x8w/QkSJ8Rz9NUgFl/gJDu7BpFw== X-Google-Smtp-Source: AGRyM1tmRmR4H1JSay0RMgvUN0/v4t8D4E4gn3CAYSGYMnlLYYewq4Tbq01hWG6pq8JSWAEVn27IaA== X-Received: by 2002:a65:5789:0:b0:41a:4a7c:635d with SMTP id b9-20020a655789000000b0041a4a7c635dmr17184257pgr.60.1658904562899; Tue, 26 Jul 2022 23:49:22 -0700 (PDT) From: Atish Patra To: qemu-devel@nongnu.org Cc: Atish Patra , Heiko Stuebner , Alistair Francis , Bin Meng , Palmer Dabbelt , qemu-riscv@nongnu.org Subject: [PATCH v11 6/6] target/riscv: Remove additional priv version check for mcountinhibit Date: Tue, 26 Jul 2022 23:49:13 -0700 Message-Id: <20220727064913.1041427-7-atishp@rivosinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220727064913.1041427-1-atishp@rivosinc.com> References: <20220727064913.1041427-1-atishp@rivosinc.com> 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: pass client-ip=2607:f8b0:4864:20::529; envelope-from=atishp@rivosinc.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @rivosinc-com.20210112.gappssmtp.com) X-ZM-MESSAGEID: 1658905311252100001 Content-Type: text/plain; charset="utf-8" With .min_priv_version, additiona priv version check is uncessary for mcountinhibit read/write functions. Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Signed-off-by: Atish Patra Reviewed-by: Weiwei Li --- target/riscv/csr.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index ec6d7f022ad5..eac003d6b950 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -1484,10 +1484,6 @@ static RISCVException write_mtvec(CPURISCVState *env= , int csrno, static RISCVException read_mcountinhibit(CPURISCVState *env, int csrno, target_ulong *val) { - if (env->priv_ver < PRIV_VERSION_1_11_0) { - return RISCV_EXCP_ILLEGAL_INST; - } - *val =3D env->mcountinhibit; return RISCV_EXCP_NONE; } @@ -1498,10 +1494,6 @@ static RISCVException write_mcountinhibit(CPURISCVSt= ate *env, int csrno, int cidx; PMUCTRState *counter; =20 - if (env->priv_ver < PRIV_VERSION_1_11_0) { - return RISCV_EXCP_ILLEGAL_INST; - } - env->mcountinhibit =3D val; =20 /* Check if any other counter is also monitoring cycles/instructions */ --=20 2.25.1