Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp868531rdb; Fri, 20 Oct 2023 01:31:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHW/uPFL9fU+YTcF9zwqlM0J3NVDocpRKXI29ofGEmRpffKUc9gg9JhtQ59DbCVOVAvQyVC X-Received: by 2002:a17:902:7441:b0:1c7:615a:8dea with SMTP id e1-20020a170902744100b001c7615a8deamr1208221plt.66.1697790670117; Fri, 20 Oct 2023 01:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697790670; cv=none; d=google.com; s=arc-20160816; b=QOWMuOclNSxSWkXKMSOOi/QFW1s/F/KTy+EHIuhIwLZYcFw5EHXQwfVB752okqlMt1 dTf+DnvAtOLU6WarkdHIK14m2lJtRdjJvzumHcOWgq0DLPNUkltCoxZyiaMhz/ae1YNu YaKf1pbAiUidk8pitOx3HgVAMGpe+PNusTWz4XwID8oi/m9h7I5g/kTfnd/GnRj+ZdcD Fb3YddX33qt7nexMyZAkxRJzMnt7pAqisimmcyahrK/qnGg8AP0/qWtfJJ+ad/t8veR1 HGp2c24yrxdoKF0YC+AaocAbqueymKTXp3D8zrSMxL3lvGTuS4gonlToCM0ql30RKKid eO6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=opp3/2eGXbTqNSQnfWDWHWZjhr1alfwf1WuRdLdwOM4=; fh=pQfWspk8A1NwftGxnHM2juEsWgEl7HE7mo5o+RIQx2c=; b=H0kbS59ciX2nl1QGdKc+LEbYMEOILL6pPplhYxNo9b52HlwKUXlXxw7g8NBB3YVpu1 pDK1YTROMGGSCG6NmA1RUlr5J8fCqtRy6r81j2WGvHo6NOGf/4deRMn71/kgpFCEpNmQ kS0AyRVOy2x/xAA+QZIqfaCIvRacvQLvpPirFEqiWjlkFGck4tf6d6CWi/x0nOwt9zfj ikWO5Ldh2UhsS4mafV0UZKgh2zmttVQ+sayHdgBwhTdNPtXQjZ2+z2tRQB//Z3vK9TJN uwvLqo0kOPgFwXIE60HJLZBQM2uGOuiHKdw954p62RGdRYHqtukNjNOX/Kid9b8OkIAN 08UA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=andestech.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id y1-20020a170902700100b001bdca6456c3si1256947plk.46.2023.10.20.01.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 01:31:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=andestech.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 5270A829B897; Fri, 20 Oct 2023 01:31:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376433AbjJTIbB (ORCPT + 99 others); Fri, 20 Oct 2023 04:31:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235651AbjJTIa7 (ORCPT ); Fri, 20 Oct 2023 04:30:59 -0400 Received: from Atcsqr.andestech.com (60-248-80-70.hinet-ip.hinet.net [60.248.80.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A684112 for ; Fri, 20 Oct 2023 01:30:56 -0700 (PDT) Received: from mail.andestech.com (ATCPCS16.andestech.com [10.0.1.222]) by Atcsqr.andestech.com with ESMTP id 39K8UpJf015318; Fri, 20 Oct 2023 16:30:51 +0800 (+08) (envelope-from peterlin@andestech.com) Received: from APC323 (10.0.12.98) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Fri, 20 Oct 2023 16:30:49 +0800 Date: Fri, 20 Oct 2023 16:30:46 +0800 From: Yu-Chien Peter Lin To: Conor Dooley CC: , , , , , , , , , , , , , , , , , , , , , "Leo Yu-Chi Liang" Subject: Re: [RFC PATCH v2 08/10] perf: RISC-V: Introduce Andes PMU for perf event sampling Message-ID: References: <20231019140156.3660000-1-peterlin@andestech.com> <20231019-daybed-preschool-8663d5a86798@spud> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20231019-daybed-preschool-8663d5a86798@spud> User-Agent: Mutt/2.2.10 (2023-03-25) X-Originating-IP: [10.0.12.98] X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL: Atcsqr.andestech.com 39K8UpJf015318 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 20 Oct 2023 01:31:07 -0700 (PDT) Hi Conor, On Thu, Oct 19, 2023 at 05:02:18PM +0100, Conor Dooley wrote: > On Thu, Oct 19, 2023 at 10:01:56PM +0800, Yu Chien Peter Lin wrote: > > The Andes PMU extension provides the same mechanism as Sscofpmf, > > allowing us to reuse the SBI PMU driver to support event sampling > > and mode filtering. > > > > To make use of this custom PMU extension, "xandespmu" needs > > to be appended to the riscv,isa-extensions for each cpu node > > in device-tree, and enable CONFIG_ANDES_CUSTOM_PMU. > > > > Signed-off-by: Yu Chien Peter Lin > > Reviewed-by: Charles Ci-Jyun Wu > > Reviewed-by: Leo Yu-Chi Liang > > Co-developed-by: Locus Wei-Han Chen > > Signed-off-by: Locus Wei-Han Chen > > --- > > Changes v1 -> v2: > > - New patch > > --- > > arch/riscv/include/asm/hwcap.h | 1 + > > arch/riscv/kernel/cpufeature.c | 1 + > > drivers/perf/Kconfig | 14 ++++++++++++++ > > drivers/perf/riscv_pmu_sbi.c | 35 +++++++++++++++++++++++++++++----- > > 4 files changed, 46 insertions(+), 5 deletions(-) > > > > diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h > > index d3082391c901..eecfe95d5050 100644 > > --- a/arch/riscv/include/asm/hwcap.h > > +++ b/arch/riscv/include/asm/hwcap.h > > @@ -59,6 +59,7 @@ > > #define RISCV_ISA_EXT_ZIFENCEI 41 > > #define RISCV_ISA_EXT_ZIHPM 42 > > #define RISCV_ISA_EXT_XTHEADPMU 43 > > +#define RISCV_ISA_EXT_XANDESPMU 44 > > > > #define RISCV_ISA_EXT_MAX 64 > > > > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c > > index 4a3fb017026c..a8e71c6dfb3e 100644 > > --- a/arch/riscv/kernel/cpufeature.c > > +++ b/arch/riscv/kernel/cpufeature.c > > @@ -182,6 +182,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { > > __RISCV_ISA_EXT_DATA(svnapot, RISCV_ISA_EXT_SVNAPOT), > > __RISCV_ISA_EXT_DATA(svpbmt, RISCV_ISA_EXT_SVPBMT), > > __RISCV_ISA_EXT_DATA(xtheadpmu, RISCV_ISA_EXT_XTHEADPMU), > > + __RISCV_ISA_EXT_DATA(xandespmu, RISCV_ISA_EXT_XANDESPMU), > > This does not following the ordering convention (see the comment above > this datastructure) and is not documented in the dt-binding AFAICT. OK, will insert the xandespmu here. Thanks, Peter Lin > Cheers, > Conor.