Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2465595rwb; Thu, 27 Jul 2023 07:37:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlFAIQKn5aOssD5k9X68VSTDQ2SFUO3lpKEZReZAuX0CA7nDC0spEid9cd7+OVdQr48QJWDi X-Received: by 2002:a19:6d1d:0:b0:4f8:bfb4:e4c4 with SMTP id i29-20020a196d1d000000b004f8bfb4e4c4mr1566256lfc.19.1690468630427; Thu, 27 Jul 2023 07:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690468630; cv=none; d=google.com; s=arc-20160816; b=UpSsQhiHwJdWAgNthVnP9/jNRfdg1d24o9EGp91C+5hwFxjJrQDLKM/h+gIjNFm71C opoRy0YHtG91lAVNCfO1AUoZAgKhdw5fo8eOMjNk59B6Z9zeXrjDt6t9k9B7iMeUKN8n Ux2sEcIasBHXgvC+7BtHaS5iwlwinHOVBphQOuAq+x0oO4MlwURoLGQeyo4LlfPtti80 ZboUZ5PhiYfny+jk0cxhgtFF8DXF7wUA30YrxXiW2qKEcYhHR11vfKUuzn1WoYKsYZoA K/abE4lmSL9TE8HwMGmj/u07jdGtFnnK09cn3KXZehFsj9LwBDCEB7Vn5Rlgl3pLXP/u QuGA== 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=5NmnsqQcLcAcVyns3syLHoHVHQj0n5HXKDOsH4jqkjI=; fh=JaxZGKf0NGxFruMBNweFeRrHWrRBBIwkQ5sLyfk9jAY=; b=myyJ50dqibaUBBFgvudrU8E2Y4OnkCqzq9xA566f1kwNxgeIe9NMaNhJhAAtj0vRmC jOOjcOi5UzQA/MbYUoLyqjkt7KgI+LNsV7mZDKQg4klEkfN8Az8FRlEnq7iDhTVkO8Gk 96lEkiVll+qSKwhBrkomKJ9ONjU+W+zCgdPWqAVY1HfglpUz28hflP65xI/4//6s6zr4 3qDxZznBnPL9ofbvUvvbrJyA5AqhgiRvjfElWsxFZa87iArvh0l+VXcuDR7yrWcnQ5n4 t23ZhBA1M0wsWsTvbXLF3q5h4mv9C/xpNUUyRgZdCw1CBcG/SMot9p/uY64x1go+cyZi /mBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=cw4QPNr+; 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 n14-20020a056402060e00b0051e3c92a20bsi1006863edv.318.2023.07.27.07.35.52; Thu, 27 Jul 2023 07:37:10 -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.20221208.gappssmtp.com header.s=20221208 header.b=cw4QPNr+; 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 S233414AbjG0OSS (ORCPT + 99 others); Thu, 27 Jul 2023 10:18:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233360AbjG0OSQ (ORCPT ); Thu, 27 Jul 2023 10:18:16 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F7A3122 for ; Thu, 27 Jul 2023 07:18:15 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3fbc5d5746cso11014025e9.2 for ; Thu, 27 Jul 2023 07:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1690467494; x=1691072294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5NmnsqQcLcAcVyns3syLHoHVHQj0n5HXKDOsH4jqkjI=; b=cw4QPNr+KRTkqBfUl09eVKywkJyVBIIbls5qU6tgjai2Q+mltKyEq6s+YNGOkL0v50 zHgxupgjLcJvEwDqGUK+MpEiGLmjBDydlZdLLFqczKUC/vcJ6p8i4ou2mVIKt8N/K4Cz PQRh0B4EkaM8AJyraBjtd2/Vy6YqPfIAZLXPu9wJ/pcjhMLAiclOGIcH3funcREbZrSk ZDnOY8Jyd6MiUcgKQpBlLJ2R+FVSSi0/WzE7qRm7KQJGUMEVvhTOpX/QQxOv+3Lj2jaK qze77T5yV1Q7OZ2ygxybUCkHJIPHoWcZuwVE+aLzBe/oDFyXUo2dvMc7A0Sdnbi1HnuJ MtIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690467494; x=1691072294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5NmnsqQcLcAcVyns3syLHoHVHQj0n5HXKDOsH4jqkjI=; b=i/KAKdjDlB7FwIUiihZWcyPlhqMG69NRVfDrfsiNfFh7o/By8X3fx36cBE5LL+erfU Xrncyh0Y066cv5zIVcyNaBOEI4PFg7obUCz25xVlnj468x+JpBsJF21u28aItMlsKCWr UySJS49rEMVFaxQoCPpSEA6gE/dZxsTfB4Feb45/ScPKnG5yz3a1Tsi9i0eOHB73wCYr WXHkjGNfbcrgKrKEhZejmX9nb6cCQVpWtKl5c/GCAmpBUCJtEvTTJ+rtUOSn6cTWQ3fK AdQjdoFm5Ndi0tSbEzwltxiEDj202G5iy4EzyUf/hMK6RnJt8ikhF9etqg64my2PlMoH BEYA== X-Gm-Message-State: ABy/qLaDothDGVFKmW4oDYOSQ9yQ7azMfbeSpew6fNorQKqHnJvPkrbB UyH8izEvB9GS2cGz9FhqtsunZQ== X-Received: by 2002:a1c:f704:0:b0:3fa:934c:8356 with SMTP id v4-20020a1cf704000000b003fa934c8356mr1710900wmh.10.1690467493682; Thu, 27 Jul 2023 07:18:13 -0700 (PDT) Received: from alex-rivos.home (amontpellier-656-1-456-62.w92-145.abo.wanadoo.fr. [92.145.124.62]) by smtp.gmail.com with ESMTPSA id m22-20020a7bcb96000000b003f91e32b1ebsm4841104wmi.17.2023.07.27.07.17.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 07:18:13 -0700 (PDT) From: Alexandre Ghiti To: 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 , Atish Patra , Anup Patel , Will Deacon , Rob Herring , Andrew Jones , =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= , 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 Cc: Alexandre Ghiti , Atish Patra Subject: [PATCH v4 03/10] riscv: Make legacy counter enum match the HW numbering Date: Thu, 27 Jul 2023 16:14:21 +0200 Message-Id: <20230727141428.962286-4-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727141428.962286-1-alexghiti@rivosinc.com> References: <20230727141428.962286-1-alexghiti@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=unavailable 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 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 Reviewed-by: Atish Patra --- 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_legacy.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