Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp505275rdd; Tue, 9 Jan 2024 10:30:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IE7Z5gMh2TY6oG0ty5uTOc93En/kxs6qioDcyqslvVkUxnLpazUATioMMWv0//Xzt4GTdbk X-Received: by 2002:a17:907:2ccf:b0:a23:36f7:4918 with SMTP id hg15-20020a1709072ccf00b00a2336f74918mr772805ejc.72.1704825027546; Tue, 09 Jan 2024 10:30:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704825027; cv=none; d=google.com; s=arc-20160816; b=mlYr/hbG4qpSLRY+URleE9PQAZFzVDvwSrYQ8KkmOKGmaiG5EnMKeK7JEYRQCGRanx fQEUJR3EsuF+k/f7f1yibr9xTVHgehBgfxcDv45RHl1DoV68+oRKMV5jRk7cFuwRCyOo SmdpOKYbw6Havar3c/43SiFSr+3WGN34YinGX8V8fcWkym8WGQzfhwkwDn2QGziRzBWf ydAv8nPlt3XROlPX631heoZYtsLq86iTOVqCnfFp3iPuS48RDCL58/bf0qkIMlEUsqwg OCQoWFgw5d1qcxgD2PBBCxQZBcjvo9Jc+VIxqW+VVgcC8qGtjeqtoYsVPsMR7n+CQ/Gu wvsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mL8OcOiu7GG9Vs5W9/pe1dP6yeuojlfhQA57AeeMhV4=; fh=EMRpahbV373fxyoZc+QryygqMG1pK2nfbAGgdJ4Z6OY=; b=T/TeeEifsWbWdg4umgPM1elWAmqEouBLHNBhpddTRBcWEqV/JJv/3pS+ZlNdT6WzlG RNMrmZQi7/BpTwb5UXgtiv6+SMQCGj1PvJBcYgh42rBmssL9mIl/JTe3mc4WglYNsGzy stoguR+Jy6YbWMbl2hddsHMF0ruFzY6Rraw9Mp5JeTag89xbAUlXYUNeDQEjfdULd9O2 qvTqeBZlB7Ytloi4I8FHhUwo6jg2OgLO7Ddi4cUi6FAXSIveI2aSCGHd0trB+zXU4b5g LkB5dmKj6kt1qCrkvrxehxfv1deABjk2jm6bcWvrP3cIbQV00Q5P20tOaTg7ukSw0fqf AC6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bibRrS8Q; spf=pass (google.com: domain of linux-kernel+bounces-21260-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21260-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ko9-20020a170907986900b00a2b169d998esi1028947ejc.1010.2024.01.09.10.30.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 10:30:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21260-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bibRrS8Q; spf=pass (google.com: domain of linux-kernel+bounces-21260-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21260-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4F0131F29EAE for ; Tue, 9 Jan 2024 18:30:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B35C3C6A4; Tue, 9 Jan 2024 18:30:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bibRrS8Q" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76ECC3A8E1; Tue, 9 Jan 2024 18:30:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 745D2C433F1; Tue, 9 Jan 2024 18:30:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704825017; bh=4e17EVKx9Ynx8QIA0PudyWmEbbNXeGXtvyR8zU7LvlI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bibRrS8QD/wewhZo5L890sUv0otbbRCZc2+2QomQk5/Yhfp8eKzNtnBMc0ZuUlTDX UCj7heIf7PEVTUmKVgV8BrYVzWL4T7iujkSvHIdMZQSYtv9K2W+KJoQofyyX9AxAEV +SfFXCcMGMhA5nyHPWrEQ/id8KVblr1ys1HDeRML0p3zbPyFqW8+ux+4LUu5G3nql6 q+7mYg6kCjZK9OT/OmtFQBvMceb7InhYr6diYboDHMrnmvGMQIlEqaPgG3tnhKux3v SYFHGWGMuqrHYPpO1gUhyX/b64lzkZRhSBSBBbHmbbilG677kaxsbVETkd97yKVC/U zaZXQvnxr++gQ== Date: Tue, 9 Jan 2024 18:30:11 +0000 From: Conor Dooley To: Atish Patra Cc: linux-kernel@vger.kernel.org, Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Andrew Jones , Anup Patel , Atish Patra , Conor Dooley , Guo Ren , Heiko Stuebner , kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-riscv@lists.infradead.org, Mark Rutland , Palmer Dabbelt , Paul Walmsley , Will Deacon Subject: Re: [v2 05/10] drivers/perf: riscv: Implement SBI PMU snapshot function Message-ID: <20240109-vice-trash-89a4e1a171b2@spud> References: <20231229214950.4061381-1-atishp@rivosinc.com> <20231229214950.4061381-6-atishp@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kO73K9XjJLp1tLC+" Content-Disposition: inline In-Reply-To: <20231229214950.4061381-6-atishp@rivosinc.com> --kO73K9XjJLp1tLC+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Dec 29, 2023 at 01:49:45PM -0800, Atish Patra wrote: > +static noinline void pmu_sbi_start_ovf_ctrs_snapshot(struct cpu_hw_events *cpu_hw_evt, > + unsigned long ctr_ovf_mask) > +{ > + int idx = 0; > + struct perf_event *event; > + unsigned long flag = SBI_PMU_START_FLAG_INIT_FROM_SNAPSHOT; > + u64 max_period, init_val = 0; > + struct hw_perf_event *hwc; > + unsigned long ctr_start_mask = 0; > + struct riscv_pmu_snapshot_data *sdata = cpu_hw_evt->snapshot_addr; > + > + for_each_set_bit(idx, cpu_hw_evt->used_hw_ctrs, RISCV_MAX_COUNTERS) { > + if (ctr_ovf_mask & (1 << idx)) { > + event = cpu_hw_evt->events[idx]; > + hwc = &event->hw; > + max_period = riscv_pmu_ctr_get_width_mask(event); > + init_val = local64_read(&hwc->prev_count) & max_period; > + sdata->ctr_values[idx] = init_val; > + } > + /* We donot need to update the non-overflow counters the previous > + * value should have been there already. > + */ One nit for if this is resent, you've got the wrong comment style here. Otherwise, looks like the things we discussed before got addressed: Reviewed-by: Conor Dooley Cheers, Conor. --kO73K9XjJLp1tLC+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZZ2QswAKCRB4tDGHoIJi 0gOyAP9likwaQtMp2ZSARj3vlQ58zp6Y3zWoiDNp0IPqPvRVpgD8D3p4Ng+GSYTf Nk3Ly+1hHDxZAqd9avg+wQchMGHMCgg= =lKYo -----END PGP SIGNATURE----- --kO73K9XjJLp1tLC+--