Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5890109rwl; Mon, 9 Jan 2023 00:57:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXuwwb5nRE0fsC9GM6Ije7VyoVHVF5mdzUwWAKZLsUrr1mqgEemA9N+Na1BEVcU1cPF8Oyt+ X-Received: by 2002:a17:90a:d916:b0:226:f79e:7907 with SMTP id c22-20020a17090ad91600b00226f79e7907mr6515610pjv.11.1673254647527; Mon, 09 Jan 2023 00:57:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673254647; cv=none; d=google.com; s=arc-20160816; b=f1sJk7hn2JHA0fNICswxtXdbMNh39C9cda13KcINLnjA8W2oX/NQYny8BzCG/UMlA4 L0jGEaAakfB0IE+0VLXyIXb730APm+CuGlj9kt3sVWWdafNFl9OSMbn7A2+dfvboE0x2 91GijZHfIrnkxMeZBOlyrzXx/vsi4CTotQxkq2/bfqeJblPv9dXhi+81f9wrr2bSflgq tDa1zIMkqzRZvsYIcaLxq6UKtGJCGM3KTNJXXXU6GkGeI3mNxKYHgqh9tz5Fmk0sximF 66PWsV/FYDJwpt6WiLs62KARh1VvWBGk8RnuYkmtF6Ah/vLY9ZikE3HAEayy8264Ox1o NM+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gzWfkg4ZC7kc3QEtk+OYVwq1uaceASK3hTBpAc94uQ0=; b=SAhqX2MWimzdTEHhQFCGR0Beie+knAFr+FyLt5IGmrh4q0DTjfdjbpZXXpMjWidmXL 9R1Z/Qj5/cr5JJBzY81x1W0qnumDEKaN+wJ3Wnl35K4GerWv43e48n1nj6LZ0DAvQR6C EIukwTcRLTn8CEiEPb8r/hJkciJmDQ52ZCb5+y4MzqqhwP92/sg2ShUlh+tigxRHQRsG nYHB4R4aDB9suhH6NJ3WxygPj72XOc5XjC0PNx2BUeYmLXVNq7Y8Qpkd77G2l0LqjL14 d5jLZYNogd0/DFpVf80IhWpojqOI8oQQL+ol74z3zxGHeo3kUp8notzNGRDCTglj8dJJ RjHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=dTXSsdMc; 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 199-20020a6300d0000000b0048c4f23869dsi8791175pga.796.2023.01.09.00.57.20; Mon, 09 Jan 2023 00:57:27 -0800 (PST) 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=dTXSsdMc; 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 S233682AbjAIICc (ORCPT + 54 others); Mon, 9 Jan 2023 03:02:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233406AbjAIIC2 (ORCPT ); Mon, 9 Jan 2023 03:02:28 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC294FCDA for ; Mon, 9 Jan 2023 00:02:27 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso12013532pjt.0 for ; Mon, 09 Jan 2023 00:02:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=gzWfkg4ZC7kc3QEtk+OYVwq1uaceASK3hTBpAc94uQ0=; b=dTXSsdMcCi67LNWErLwMapGj/WTi4uejeFaA7SJH2fnn1vCcR8dZdoMFteHa0nR/F8 kh+oCK+ztYw5Rf4gKv4TV5Gdah2TQm8k+XL62wM3ueN5p/GVMw+ZxiAACMfUSzIVYbOS Xs/nMno96/ZqDQeh4Ni75wvFBhmTroKQxcbhm4q51cwo2RV7y5bjDGNUrbcVui5pdBIO maly1bWQ5ih++hsQEb8M2G7xGXr3oBPVCCk3T43pqAWK62Nn+VOQIWNnXhpyxUBBHkNU nfmOSpXVUGQYU4xxVcOQgeMSNx1UD0P+L7qHDevVACiS1B0xvaGy9HU6baIVxrjTdUnG 7qqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=gzWfkg4ZC7kc3QEtk+OYVwq1uaceASK3hTBpAc94uQ0=; b=1Gl28ePr7eV4hQlNlb017nE33fuukEkl+IqZmCtkGKJrzLcpva9eUdJ/b8c5QwO48y /UCQ+7SYLE4TkdBV66kLIWhHj5WkNmb08T4rMc6xAmZIOV2ordLKcePGHub2QNVfMUc4 C40ebDTqv+1HFBx2hIl+xvto46beebKVeoXc4TTJSl8qmk+U+IUNbOYfN3sVtBc2NOF5 GMyUsc8j+DysWiriTP5OsnZmRgesYxbK3CyC7KOgTmuM2n2kVRo6EuvBHRwHsNax1HE8 htWMDpRAJP16irdhDYKhI9OTKX/h00UGXOPE2LnVfs2+7iFkfachdnnOuIxGBgHEIyux 43tA== X-Gm-Message-State: AFqh2kp20niPBVTE/g2aNr7LL835HAkgP6hjFhsqrJhLN7TATuvyJRZ9 GY1vdXBx0Wqa/fYkkE1T2X1Yn4JLuOO4aDi5GFLU8g== X-Received: by 2002:a17:90a:db53:b0:227:208f:65f with SMTP id u19-20020a17090adb5300b00227208f065fmr119951pjx.32.1673251347239; Mon, 09 Jan 2023 00:02:27 -0800 (PST) MIME-Version: 1.0 References: <20230102165551.1564960-1-conor@kernel.org> <20230103092816.w6hknvd4caeahdo4@orel> In-Reply-To: From: Atish Kumar Patra Date: Mon, 9 Jan 2023 00:02:16 -0800 Message-ID: Subject: Re: [PATCH v3] dt-bindings: riscv: add SBI PMU event mappings To: Conor Dooley Cc: Andrew Jones , robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, palmer@dabbelt.com, Conor Dooley , devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, apatel@ventanamicro.com, will@kernel.org, mark.rutland@arm.com, opensbi@lists.infradead.org, samuel@sholland.org Content-Type: text/plain; charset="UTF-8" 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 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 Sun, Jan 8, 2023 at 1:34 PM Conor Dooley wrote: > > Drew, Atish, > > Mainly just a question about the OpenSBI doc at the end. Gonna fix up > the rest of the wording and resend in a few. > > On Tue, Jan 03, 2023 at 10:28:16AM +0100, Andrew Jones wrote: > > On Mon, Jan 02, 2023 at 04:55:51PM +0000, Conor Dooley wrote: > > > From: Conor Dooley > > > > > > The SBI PMU extension requires a firmware to be aware of the event to > > > counter/mhpmevent mappings supported by the hardware. OpenSBI may use > > > DeviceTree to describe the PMU mappings. This binding is currently > > > described in markdown in OpenSBI (since v1.0 in Dec 2021) & used by QEMU > > > since v7.2.0. > > > > > > Import the binding for use while validating dtb dumps from QEMU and > > > upcoming hardware (eg JH7110 SoC) that will make use of the event > > > mapping. > > > > > > Link: https://github.com/riscv-software-src/opensbi/blob/master/docs/pmu_support.md > > > Link: https://github.com/riscv-non-isa/riscv-sbi-doc/blob/master/riscv-sbi.adoc # Performance Monitoring Unit Extension > > > Co-developed-by: Atish Patra > > > Signed-off-by: Atish Patra > > > Signed-off-by: Conor Dooley > > > > + riscv,event-to-mhpmevent: > > > + $ref: /schemas/types.yaml#/definitions/uint32-matrix > > > + description: > > > + Represents an ONE-to-ONE mapping between a PMU event and the event > > > + selector value that platform expects to be written to the MHPMEVENTx CSR > > ^ the > > I think this one is arguable, it makes sense both ways IMO. I don't care > since it's not my prose though ;) > > > > + for that event. > > > + The mapping is encoded in an matrix format where each element represents > > > + an event. > > > + This property shouldn't encode any raw hardware event. > > > + items: > > > + items: > > > + - description: event_idx, a 20-bit wide encoding of the event type and > > > + code. Refer to the SBI specification for a complete description of > > > + the event types and codes. > > > + - description: upper 32 bits of the event selector value for MHPMEVENTx > > > + - description: lower 32 bits of the event selector value for MHPMEVENTx > > > > > + * codes, U74 uses a bitfield for events encoding, so several U74 events > > > + * can be bound to single perf id. > > ^ a ID > > > > > + * See SBI PMU hardware id's in OpenSBI's include/sbi/sbi_ecall_interface.h > > > > IDs > > Most of this stuff comes directly from the doc in OpenSBI that I > copy-pasted. Atish, what do you wanna do once the binding is upstream > about the original doc? > I will fixup the doc based on the final version of the binding once it is upstream. > Thanks, > Conor. >