Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp159632rdb; Tue, 5 Dec 2023 01:27:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrzb6oCrQmh5IKtfLsRQ4408TyUBPH76pM2cPplAetK6DU+n1Dm+9hVO588LwQU+Lj6/56 X-Received: by 2002:a05:6a20:8416:b0:18f:97c:5b72 with SMTP id c22-20020a056a20841600b0018f097c5b72mr2573500pzd.64.1701768427006; Tue, 05 Dec 2023 01:27:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701768426; cv=none; d=google.com; s=arc-20160816; b=Y6O0urokiSzgE3HKED1KzEgrJEXJLhRQOnp/FHyfG46uP+ApNLs1aUSHeEo3HxZ8J4 6R0AQh7FCXwi9uWa+P4Q28j/z8KGcnLLhWMDty7/U+gXVIpA0coSjUXqtm8yC8EdvPsk /jKRsakKyyqOyn5ze6CXv+VKIXd5fBNGFRwAiB6A/s0kE1MG6PL1rzGLo+JKq83xJ/Yz yYB1Q/Nl0Om3BFc10spLMt2WmXzNXB1aJ6s5gJhk8d5XZX+tvvV2Lqq0DrDHb2HmYP5z nX+UOUx6nBgjm/PqXleLWGlJ4jNpVW919h+LwZXaHQFnU115cBF4pgWk2Dtk2DGkiOEk +fXw== 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:dkim-signature:dkim-filter; bh=KfrrOaxwH0SW4+l9ufl40h36vnN/7a6MQbhAMTM4iK0=; fh=ZJYsNduMG8UAwH0Qq0QxhUxILqY66Z4QSQbOj/RiE6E=; b=LWLQ/0gCaBySHInHgbML1r9TRqa9buEZ89BwjeHWhkI3LyWVja/oVeX6PNAsTDmj9l gHPd6y39wbFZ0FDTXESplIn0m4wWipj3WY4fLMsPUFJ9jFAHUR4At/2gyoHbSzSIcAzi Zzv8lb3WmtIzbR2xHTcnurfZNx0cHrYoA9B83TIpG9wcRa9Tgu47r89FHcdhqLNdlAw/ n3wk9+/FSEFi3p0PU3qtsGeVaue2sRn+n55XwbjBW3licbUz9+0KN3hPrjnikoaAVA6Z fE57hMmpQumncO8NvJ135LO6JxRnrI5aGusPzPsOuSga/aWnJhv9qrM8sm9lxvUVKxLZ LJew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@syntacore.com header.s=mta-04 header.b=Nzyn95L0; dkim=pass header.i=@syntacore.com header.s=mta-03 header.b=PJfYgTgf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=syntacore.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id g6-20020a1709026b4600b001d002eeb4a1si5106358plt.15.2023.12.05.01.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 01:27:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@syntacore.com header.s=mta-04 header.b=Nzyn95L0; dkim=pass header.i=@syntacore.com header.s=mta-03 header.b=PJfYgTgf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=syntacore.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7113080B26F2; Tue, 5 Dec 2023 01:27:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231834AbjLEJ0q (ORCPT + 99 others); Tue, 5 Dec 2023 04:26:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbjLEJ0n (ORCPT ); Tue, 5 Dec 2023 04:26:43 -0500 Received: from mta-04.yadro.com (mta-04.yadro.com [89.207.88.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 566DC98 for ; Tue, 5 Dec 2023 01:26:49 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mta-04.yadro.com F310FC0012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=syntacore.com; s=mta-04; t=1701768407; bh=KfrrOaxwH0SW4+l9ufl40h36vnN/7a6MQbhAMTM4iK0=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=Nzyn95L01DWqMe66VD4dfGJiBUbIvWFv7soLnpcOVJfOYV0OASs5taow3dJ+QbY8T hAWKRDA1uKueBZt59xqREHO9ejuaeU5JKMvbB8Xub2dyCaiL7ZCkRHuVPfeKcKZiz3 MSTkvZFuH/6g/fnH/X92FfQDQcVlPcK94c4JJwqbtFSmUSWJ/TejYwdk5lYepj4x/l Xq1NZnTkFjB1w4uIR7xuOzDNE4q81yVY7S3WvTUpsnS7BRQ9q8u8+pzMIn7Hs5j0TX s+1eY4MDnAxgjQ2blv7KCBBdH15fkPSIhnq8ZKdju31KncokSCFcwmCoC1MCcHJnlQ Ey5tiESAnu8NA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=syntacore.com; s=mta-03; t=1701768407; bh=KfrrOaxwH0SW4+l9ufl40h36vnN/7a6MQbhAMTM4iK0=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=PJfYgTgfmnYJvj9cmQlFOQkV/k5cGatNDFRqynyCqu6Cq+BzbGiKVUe+Npbsxkp6a zEauUV7gsIOZZgQAlLkRr2X+eMfO4bgaukqbNVfkSeRK/NslMgjCU5mWOvJ+oqBPhJ qn9J1A8YIrGs2ndCOG7Hlrz1dA1t7oFqizsGEbLyN5UZUCp5oRm1jnCh6rX4lO81Bl 7kCqzh+copb+ggT96UxKVOxcYbegEHYn8K3Z9rfft54zaCQwH835SUOiTMrDoPmnaT JRPnn4fzr6Jw0AnBgVcwxLRy0QzSlSY1jeDz1hQSxcBMaZKaaPKLUHqLVxu0Wqrsi9 GNxAwFkQjL+Jg== From: Vadim Shakirov To: Atish Patra CC: Vadim Shakirov , Anup Patel , Will Deacon , Mark Rutland , Paul Walmsley , "Palmer Dabbelt" , Albert Ou , "Alexandre Ghiti" , Andrew Jones , , Subject: [PATCH 2/2] drivers: perf: added capabilities for legacy PMU Date: Tue, 5 Dec 2023 12:25:55 +0300 Message-ID: <20231205092555.35617-2-vadim.shakirov@syntacore.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231205092555.35617-1-vadim.shakirov@syntacore.com> References: <20231205092555.35617-1-vadim.shakirov@syntacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: T-EXCH-07.corp.yadro.com (172.17.11.57) To S-Exch-02.corp.yadro.com (10.78.5.239) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 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]); Tue, 05 Dec 2023 01:27:04 -0800 (PST) Added the PERF_PMU_CAP_NO_INTERRUPT flag because the legacy pmu driver does not provide sampling capabilities Added the PERF_PMU_CAP_NO_EXCLUDE flag because the legacy pmu driver does not provide the ability to disable counter incrementation in different privilege modes Suggested-by: Atish Patra Signed-off-by: Vadim Shakirov --- drivers/perf/riscv_pmu_legacy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/perf/riscv_pmu_legacy.c b/drivers/perf/riscv_pmu_legacy.c index a179ed6ac980..fa0bccf4edf2 100644 --- a/drivers/perf/riscv_pmu_legacy.c +++ b/drivers/perf/riscv_pmu_legacy.c @@ -123,6 +123,8 @@ static void pmu_legacy_init(struct riscv_pmu *pmu) pmu->event_mapped = pmu_legacy_event_mapped; pmu->event_unmapped = pmu_legacy_event_unmapped; pmu->csr_index = pmu_legacy_csr_index; + pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT; + pmu->pmu.capabilities |= PERF_PMU_CAP_NO_EXCLUDE; perf_pmu_register(&pmu->pmu, "cpu", PERF_TYPE_RAW); } -- 2.34.1