Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp641374rwi; Mon, 10 Oct 2022 05:30:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6KFIrMCo9VbasmBX1hIXz3QWZGzJ1i6XNMiHy/R3xX95wtmVDUaf/1zef8+pVkmTMeBd/Q X-Received: by 2002:a17:907:60c7:b0:78c:e54b:9021 with SMTP id hv7-20020a17090760c700b0078ce54b9021mr14677779ejc.101.1665405049404; Mon, 10 Oct 2022 05:30:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665405049; cv=none; d=google.com; s=arc-20160816; b=Wi4TU/vzOTeB2Pe/B6KwaZdohHK1R/D3kN8Y5YQ+1RYjLJwUD1DHH+r601Vf/5yW6y UQvdZeMDe08kNIMsLBfPToEsJwmhhp+qbXuuumEHukYY4IePQA8q9tS1i9uGyZ+WZoBe tn78XpFXjtEBZaovzby0tPXzmUWT9HxUDqu9Ay8WR3X3/YpRk2X/UjFCXoiFsH4lmu4D qMnwbaHULneg8QrfMyiT3pdVFLYoiblyX8DRPCFCbLVZHn3uWAYu+nf1QrI7OWP+S9Ye CpJZD+qqQ8ijOyT/GfqbBUtdrk6i3CVDokySTkI0pXWXtBfG72LzmDcPzt+TLxRF0kwC PMDQ== 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 :message-id:date:subject:cc:to:from; bh=l/CiS8wHjesKIHbwJG2lxwJHb53FOlrorRmnKvifZA0=; b=YpbLpPIG9tH+mJsg/K4ocNZAST8DFEgOeUuzGHnaiq7GZWoxUYB5gBy6TfjgGiM8G9 cJHP0yQGLwWlO6aYYj67CGzlkUifmZsV0dMS024MtoEl7AbT+xHhlL4To2AlFTMu7UAc 4hMm857AN4QkJUCZA0kfldf+qOJRZ9/j1fOoS4bS+SrMrj9zuVvDOJmqnbOjKPO7BIQD hjIRaQHpjSpVzwzRCFnAewX59MzSYT78ij3iphb5+dbpzJIFBISsRAOjfpDODvTKjVch /XQSTCTZ2Q1Wecphbo2SXRvhT55P/vCQhywLAXxTkgZlYnZbF1cOd3cXParwcf32Aw+O 1ymQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s9-20020a056402036900b00459cf784343si7100869edw.176.2022.10.10.05.30.22; Mon, 10 Oct 2022 05:30:49 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231697AbiJJM1p (ORCPT + 99 others); Mon, 10 Oct 2022 08:27:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231646AbiJJM1n (ORCPT ); Mon, 10 Oct 2022 08:27:43 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DB9E65258 for ; Mon, 10 Oct 2022 05:27:40 -0700 (PDT) Received: from p5b1274fa.dip0.t-ipconnect.de ([91.18.116.250] helo=phil.fritz.box) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ohrsW-0001kg-Od; Mon, 10 Oct 2022 14:27:28 +0200 From: Heiko Stuebner To: atishp@atishpatra.org, anup@brainfault.org, will@kernel.org, mark.rutland@arm.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Conor.Dooley@microchip.com, ajones@ventanamicro.com, Heiko Stuebner Subject: [PATCH v5 0/2] riscv_pmu_sbi: add support for PMU variant on T-Head C9xx cores Date: Mon, 10 Oct 2022 14:27:24 +0200 Message-Id: <20221010122726.2405153-1-heiko@sntech.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS, T_SPF_HELO_TEMPERROR 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 The PMU on T-Head C9xx cores is quite similar to the SSCOFPMF extension but not completely identical, so this series changes in v5: - add received Reviews - fix sbi caching wrt. negative values (Drew) - add comment about specific c9xx arch- and imp-ids (Conor) changes in v4: - add new patch to cache sbi mvendor, march and mimp-ids (Atish) - errata dependencies in one line (Conor) - make driver detection conditional on CONFIG_ERRATA_THEAD_PMU too (Atish) changes in v3: - improve commit message (Atish, Conor) - IS_ENABLED and BIT() in errata probe (Conor) The change depends on my cpufeature/t-head errata probe cleanup series [1]. changes in v2: - use alternatives for the CSR access - make the irq num selection a bit nicer There is of course a matching opensbi-part whose most recent implementation can be found on [0]. [0] https://patchwork.ozlabs.org/project/opensbi/cover/20221004164227.1381825-1-heiko@sntech.de [1] https://lore.kernel.org/all/20220905111027.2463297-1-heiko@sntech.de/ Heiko Stuebner (2): RISC-V: Cache SBI vendor values drivers/perf: riscv_pmu_sbi: add support for PMU variant on T-Head C9xx cores arch/riscv/Kconfig.erratas | 13 +++++++++++ arch/riscv/errata/thead/errata.c | 19 ++++++++++++++++ arch/riscv/include/asm/errata_list.h | 16 +++++++++++++- arch/riscv/kernel/sbi.c | 30 ++++++++++++++++++++++--- drivers/perf/riscv_pmu_sbi.c | 33 +++++++++++++++++++--------- 5 files changed, 97 insertions(+), 14 deletions(-) -- 2.35.1