Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2143205rwp; Fri, 14 Jul 2023 01:09:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlHlCWthFjgF0gfK+FWFHhzB9rKNJTr0FCkZaLyljK/5+uS33P04Z7EZLbfkp17O2s/LtdyH X-Received: by 2002:a17:907:98af:b0:98d:f4a7:71cf with SMTP id ju15-20020a17090798af00b0098df4a771cfmr3373413ejc.62.1689322179808; Fri, 14 Jul 2023 01:09:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689322179; cv=none; d=google.com; s=arc-20160816; b=JKUZB0U6lUYbqT+2daN60p3lCrsDIJbdwHmMfQtQrOBAVY6YtIZIXRhKGomiwa7iNT Q8BUe0iAbDzj7MHWL3a3dtpEUlDZ52CXgbI+fNP+L3B3JY1Bs+LWIRmGbtUBGgXHkRyY ipQIVDTPJmWYgj5SGCsG/em15JSWBy7fUf9APgzkliUQniztMoAYsC/HMflOPtWvPL5l 2v5El6JSBFq4RO0YfSwonja6PQGlzWbxJjpSBKSf2ip/4ZDyucf0k/GZXFNCp27qOzuX ddEkHr055supzKQMZ5ZhxnsBawfhlpRf7LH8+Uf0XXTtpGzb5uJK4Hpvx+TuHDvg2uJT X5Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=1EP8QirGSf2eyBcIi4yRsMFtzBd2RQ70krFjONUiThU=; fh=y2M5v1gYeu0HYmN0hofCIqVy6M5fV8gJXE/fccYEzwc=; b=Djghtnm+8JCk3+Gff7VeVKiDpfzzF8s5UylxhM1AmEoChRHjG3ZpFzXLBPa9cUFU4O tbPbEWztSuUSw6ouOklzJ2BdmBnjT14gxHbE1Ds4Csx6NqIdCRrMEZKujKG5nyelxlAj oaz+LSM3poBjopY3Jk83yImQ/XfzL6pjg3zfLdO3RgrIxWwLaUejqXCycH2akJWNtYF2 KIT+1BaIUbZebMLBYGiCX+S7C9AsL67zfHIVZzBQ8EyHQkV1LUWtBUcixeyNlHTaSAd4 IaYW5Y4KleqPU/IRH3/UUhGvZHQ/jxwWc6Rck7y1hzQgbO3s8c8h7dH9RjiRhgVgBwkd b+wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=qrgkw6OL; 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 u21-20020a170906951500b00991f4e7f49asi8158297ejx.215.2023.07.14.01.09.15; Fri, 14 Jul 2023 01:09:39 -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=@atishpatra.org header.s=google header.b=qrgkw6OL; 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 S235168AbjGNIEB (ORCPT + 99 others); Fri, 14 Jul 2023 04:04:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235160AbjGNIDg (ORCPT ); Fri, 14 Jul 2023 04:03:36 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA2A34C00 for ; Fri, 14 Jul 2023 01:01:14 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b6fbf0c0e2so24237691fa.2 for ; Fri, 14 Jul 2023 01:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; t=1689321673; x=1691913673; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1EP8QirGSf2eyBcIi4yRsMFtzBd2RQ70krFjONUiThU=; b=qrgkw6OLa/u09k4e8aJM4RCLYCSGJL2Ws3SFmAj0tiB0tCpyZoQo61oYAsI8sU9BB8 H+gQWv8vCeKgKgyoeSKS4C4Sc0C4IPiwmVfTHUNpOFsAZRTsMpO+0/j6Wnd+QMliJQf8 i4x/3jU9uKTH2hS4SI8A4xrNpqD/H+x2vIEBo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689321673; x=1691913673; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1EP8QirGSf2eyBcIi4yRsMFtzBd2RQ70krFjONUiThU=; b=kL8nmjK5pP8ZGThzftx9546dN8zMyVNAuKWZ7BZQfA6Y5FbxlyYl+HK+VEmX1+TeKU 08yYjd4LwXMfukFR5xX9aMoKvQPKEt/I9oKmhs7cVnGpSiKSYybYRcW9Qz1NAZuz4DBR 76kHhA3IeVi3jy15wX2wz8X0tedJoeUJrrZWNNabCP65OEdOAtVyrpw3PepDwvKdgcKS kxxPbRvvxhKpdmFNBxvT6CXM6SHu+IkjMgT25LvKhV67Aqat83mO5FCd2FQ4feEsQ/cB eoy0NzFLgs+C3eVWurQFA0agKTYwY69CgmcZwCc5kXEFKlusQMDrLMr96wxUXAkB3Wuq Y/9Q== X-Gm-Message-State: ABy/qLbEcoWneig3m0zBVW5vwaie3BJl0VW7Lg7hBr50w1G1ARduFPU9 vRmZiSbPIeZ5OgMBXfJlh3mLKPVycFm2ipLIvqQ8 X-Received: by 2002:a2e:8611:0:b0:2b6:ee1c:216a with SMTP id a17-20020a2e8611000000b002b6ee1c216amr3346497lji.34.1689321672902; Fri, 14 Jul 2023 01:01:12 -0700 (PDT) MIME-Version: 1.0 References: <20230703124647.215952-1-alexghiti@rivosinc.com> <20230703124647.215952-4-alexghiti@rivosinc.com> In-Reply-To: <20230703124647.215952-4-alexghiti@rivosinc.com> From: Atish Patra Date: Fri, 14 Jul 2023 01:01:01 -0700 Message-ID: Subject: Re: [PATCH v4 03/10] riscv: Make legacy counter enum match the HW numbering To: Alexandre Ghiti Cc: Jonathan Corbet , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Will Deacon , Rob Herring , Andrew Jones , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Mon, Jul 3, 2023 at 5:49=E2=80=AFAM Alexandre Ghiti wrote: > > RISCV_PMU_LEGACY_INSTRET used to be set to 1 whereas the offset of this > hardware counter from CSR_CYCLE is actually 2: make this offset match the > real hw offset so that we can directly expose those values to userspace. > > Signed-off-by: Alexandre Ghiti > Reviewed-by: Andrew Jones > --- > drivers/perf/riscv_pmu_legacy.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/perf/riscv_pmu_legacy.c b/drivers/perf/riscv_pmu_leg= acy.c > index ca9e20bfc7ac..6a000abc28bb 100644 > --- a/drivers/perf/riscv_pmu_legacy.c > +++ b/drivers/perf/riscv_pmu_legacy.c > @@ -13,7 +13,7 @@ > #include > > #define RISCV_PMU_LEGACY_CYCLE 0 > -#define RISCV_PMU_LEGACY_INSTRET 1 > +#define RISCV_PMU_LEGACY_INSTRET 2 > > static bool pmu_init_done; > > -- > 2.39.2 > Reviewed-by: Atish Patra --=20 Regards, Atish