Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2368996ioo; Mon, 23 May 2022 17:17:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1BlsNvN/8XSo/zPId8Za7kmi48O7rGE2qDGolShIEVvgTkkaJpQUxFVGARGaC4UEnhnRC X-Received: by 2002:a17:902:9887:b0:151:6e1c:7082 with SMTP id s7-20020a170902988700b001516e1c7082mr24719835plp.162.1653351470412; Mon, 23 May 2022 17:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653351470; cv=none; d=google.com; s=arc-20160816; b=agEMKEwFTbzGkmd44yG1SJtTmOaA+hIBIBbdG1/tIpru5KH+HvY+2q6stzLbvmn5ct FIFEz2fcwZbRWN8vvU95GHLU8eSyEbFQgkDF/lK82056ibqb6WVMNSphGNrNUm+aUNGy SLpuoRQuOmiRYvciRqbJK3FQ7D6TRPT7O5P31gUFuus2MQOJqYRSS9Cgim5srCse5JhZ lVVUjvWBHX1kIxkGXT6d1qrG9elgS1EUavEm/WUTn5bsazyB921riEoa3ktyu4CZkQFQ zI2fOEkeUWFVDl6LpzLxO1izn1K2jZfy14cMrDeKwZZCCa+TIIN5Wk71p0+gEmNyBexW Rcig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uYLWZ0AYEvI9FBKwXnehy1Q/hHHMEHlwZRLdtpEy/kg=; b=t6fhj8/DuNXYZTQsTQ2na2Hvs+Glx3PWsei3TCULDOphyocEZ5QbQjDjs71uyG5foo 7kQMvPx/uMlTFjYVFNWnVw1MhsjLmqHYbgT2ubFd+9PCdAyNO91cHFzFDnoDJTVtB8C+ hjBErLUGkGlk1eyErg+h8U9xLymyjcna2hCle3W+kHRbWs5NQ+rGfqMBLGEiIa8WZMm/ 7SphTKwoAebtBA03uNpXYtAChilp5Cn4lG2PouGFmL3lmH9BvVgj/oyi4b+f6TnTnY7z KNk8RwMeV7NI36oOQBElVfJR91nwwFHsy+d2t20GMS8DBXFBwT3ZYcsRaPY4c/XGTFUi LPoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=sItjCSHm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 188-20020a6303c5000000b003c626c711a4si12172098pgd.861.2022.05.23.17.17.38; Mon, 23 May 2022 17:17:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=sItjCSHm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231338AbiEWXvv (ORCPT + 99 others); Mon, 23 May 2022 19:51:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231215AbiEWXvc (ORCPT ); Mon, 23 May 2022 19:51:32 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8901CDF35 for ; Mon, 23 May 2022 16:51:30 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id z7-20020a17090abd8700b001df78c7c209so615006pjr.1 for ; Mon, 23 May 2022 16:51:30 -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=uYLWZ0AYEvI9FBKwXnehy1Q/hHHMEHlwZRLdtpEy/kg=; b=sItjCSHmuTcjv0HZtuTy4cynqcrDMdVZMPhGfhT7V7FPPBevqwLQ2cTIj17sNPKpWN wBGVKdYUr8OPJt5OFY0U6AXwHi8BwzLPwGoFCkC+BMTogcLnwZs3AgKFG6eSNfxegisY 8Nx/rYnkzrpYb5R+paEIxsvVKynl36SIUlXWQLBZ4/Oa+usmvIv7O3+oopf7ufiJaMe6 AHqtbLmbsdk9ZQclHM3fFZiWS16RpuNIsCDWljEx4BvtX3PASyI1jqjr2hHMXYVxV6aG ejygkovdgN2BHs1Put/5hWW+XtyCwtn1hJ5+eDtCT5x1HORXHDMSg5urkdydXYWIhhT4 ybKA== 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=uYLWZ0AYEvI9FBKwXnehy1Q/hHHMEHlwZRLdtpEy/kg=; b=XlPNPQC97O5pkaeY6ODZSVxqmk+XH60z73xdw+U1SXq1jNFSeOAImPUaO89s1+kOGW Pnw6Fzx7UXURllcUkcz8SP0gkbhy9844er6PX+CCvYyVcBBIqkxEAG6rTJUugpQp5Kr4 5FwuNkk7gnE2EH158PIiXfi/QT9VGvEZkqgIZJ7zjzf0C9VG7hdsPaDJrNVq50OheCsH mqWIo67NZMRQ/p+Jm97JwJBm12vBiHQMUfywcmHZIBnczNHL2eLWPlBw+vPo4KVmWkWC X5nPucvjcA4Q26ufSFvlxzxE4paJcU6JfGH5idHzaDkaVOdzZVSxVpeNLKCL6daB71gV sLYw== X-Gm-Message-State: AOAM532fS+uQv7hbh5ht1WCFTcTkw8uOHCQbVaI8YfIPFMyyxM3uXbGz Ry+UNmPDZxbc6eT6jfxnS0OV9Qi+CRP6DQ== X-Received: by 2002:a17:902:ccc5:b0:15e:f75e:6ce with SMTP id z5-20020a170902ccc500b0015ef75e06cemr24775678ple.104.1653349889755; Mon, 23 May 2022 16:51:29 -0700 (PDT) Received: from atishp.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id pl15-20020a17090b268f00b001df4b919937sm257084pjb.16.2022.05.23.16.51.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 16:51:29 -0700 (PDT) From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Bin Meng , Alistair Francis , Atish Patra , Bin Meng , Palmer Dabbelt , qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH v9 03/12] target/riscv: pmu: Rename the counters extension to pmu Date: Mon, 23 May 2022 16:50:48 -0700 Message-Id: <20220523235057.123882-4-atishp@rivosinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220523235057.123882-1-atishp@rivosinc.com> References: <20220523235057.123882-1-atishp@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Atish Patra The PMU counters are supported via cpu config "Counters" which doesn't indicate the correct purpose of those counters. Rename the config property to pmu to indicate that these counters are performance monitoring counters. This aligns with cpu options for ARM architecture as well. Reviewed-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Atish Patra Signed-off-by: Atish Patra --- target/riscv/cpu.c | 2 +- target/riscv/cpu.h | 2 +- target/riscv/csr.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index ccacdee21575..5ad17b40189f 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -822,7 +822,7 @@ static Property riscv_cpu_properties[] = { DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true), DEFINE_PROP_BOOL("v", RISCVCPU, cfg.ext_v, false), DEFINE_PROP_BOOL("h", RISCVCPU, cfg.ext_h, true), - DEFINE_PROP_BOOL("Counters", RISCVCPU, cfg.ext_counters, true), + DEFINE_PROP_BOOL("pmu", RISCVCPU, cfg.ext_pmu, true), DEFINE_PROP_BOOL("Zifencei", RISCVCPU, cfg.ext_ifencei, true), DEFINE_PROP_BOOL("Zicsr", RISCVCPU, cfg.ext_icsr, true), DEFINE_PROP_BOOL("Zfh", RISCVCPU, cfg.ext_zfh, false), diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index fe6c9a2c9238..09a0c71093c5 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -391,7 +391,7 @@ struct RISCVCPUConfig { bool ext_zksed; bool ext_zksh; bool ext_zkt; - bool ext_counters; + bool ext_pmu; bool ext_ifencei; bool ext_icsr; bool ext_svinval; diff --git a/target/riscv/csr.c b/target/riscv/csr.c index d175fe3f1af3..c625b17dd58e 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -74,8 +74,8 @@ static RISCVException ctr(CPURISCVState *env, int csrno) RISCVCPU *cpu = RISCV_CPU(cs); int ctr_index; - if (!cpu->cfg.ext_counters) { - /* The Counters extensions is not enabled */ + if (!cpu->cfg.ext_pmu) { + /* The PMU extension is not enabled */ return RISCV_EXCP_ILLEGAL_INST; } -- 2.25.1