Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7725858rwb; Tue, 6 Dec 2022 09:06:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf7JmzHhHmE0155Rd/FoOJWQmyCGuycEvgrygquc10vPabriYkm4W01j7YALPN2AQRQHrjc4 X-Received: by 2002:a05:6402:388e:b0:468:fb0d:2d8b with SMTP id fd14-20020a056402388e00b00468fb0d2d8bmr46912901edb.124.1670346393091; Tue, 06 Dec 2022 09:06:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670346393; cv=none; d=google.com; s=arc-20160816; b=oQa94gMo16WQlMc1vy5H2W/o1ZCOLkuz50NkO0k2Bt806d1eZXIqdXqgEOmDeeoTY6 KDwqDgsVjk8qINZ4Wh0uGBzqAlfQD4G4C46jHjRsfPXzluwWDWL5EFlcSkYVG84Fgg9p NMXF5QLbgYQpZ9ZjigJm2g5yasO2d5VeDp2wrQfd2UL2+KDX9QDcE86zyl9UAKHPOtuw 2n/ZvDPFSM/sc9/SLMnH43Po/0zNEkYVBbSlZKfinxdRR+JLW5OUGPzWglXHl7Aqwh3r TqJPow2a7leUeJAvKMTunODYYREmdlNVq8diNgH4+7JeB78NLsmva0fcCoJQ0QxWyWPW 4Aig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=wAo/FdSs2WtU24outSC8wxJSMGma7NJC/9jK1m+PsOU=; b=V0pF5XyUePPwChOKPU90/gzuBhXTUJ5StYsG/95b4QcAaxAQy/uJOQfbiShOsJk2VI xSBRf+71Hot7DaLuZ3sbg1hC87T7T82alY8sr2/DRsLOuQ02Uz5NQk7Kxp4bk2MRtKQw /0xfX7qRLE0em0YetQ3M3tvCHqgAiBUz33ykJP4lqT30d1Rcy+ruCEqMwxRQo0YMhq0V LbZyYbsNmxTEsO8ylDOZQWpnlkaNOifbSSbGituW9kyb/bnu7pqCUE3l0TvaF+sSPJsY aGWRX75CJo3EHXmmyrNtdc02mNaf79lMXpIfcrJJQsAm846fIEBwUh1csZEkllwTmeDm gNGA== 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=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a056402520700b0046c036a0800si2835243edd.383.2022.12.06.09.06.14; Tue, 06 Dec 2022 09:06:33 -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; 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=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234609AbiLFQ2u (ORCPT + 78 others); Tue, 6 Dec 2022 11:28:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232324AbiLFQ2t (ORCPT ); Tue, 6 Dec 2022 11:28:49 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1D17C9FCF; Tue, 6 Dec 2022 08:28:47 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 34C3723A; Tue, 6 Dec 2022 08:28:53 -0800 (PST) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.39.172]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C787A3F73B; Tue, 6 Dec 2022 08:28:43 -0800 (PST) Date: Tue, 6 Dec 2022 16:28:38 +0000 From: Mark Rutland To: Rob Herring , Peter Zijlstra Cc: Alexander Shishkin , Will Deacon , Arnaldo Carvalho de Melo , Ingo Molnar , Namhyung Kim , Jiri Olsa , Catalin Marinas , Marc Zyngier , Oliver Upton , Suzuki K Poulose , James Morse , Alexandru Elisei , kvmarm@lists.linux.dev, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, James Clark , Mark Brown , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: Re: [PATCH v3 7/8] perf: Add perf_event_attr::config3 Message-ID: References: <20220825-arm-spe-v8-7-v3-0-87682f78caac@kernel.org> <20220825-arm-spe-v8-7-v3-7-87682f78caac@kernel.org> <20221118164943.GA4872@willie-the-truck> <877czfujdj.fsf@ubik.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 Peter, it looks like this series is blocked on the below now; what would you prefer out of: (a) Take this as is, and look add adding additional validation on top. (b) Add some flag to indicate a PMU driver supports config3, and have the core code check that, but leave the existing fields as-is for now (and hopefully follow up with further validation later for the existing fields). (c) Go audit all the existing drivers, add flags to indicate support for existing fields, and have the core code check that. Atop that, add support for config3 with the same sort of flag check. I suspect that'd end up needing to go check more than config1/config2 given all the filter controls and so on that drivers aren't great at checking, and that might being fairly invasive. (d) Something else? I think we want to get to a point where drivers indicate what they actually support and the core code rejects stuff drivers don't support or recognise, but I think it'd be a little unreasonable to delay this series on cleaning up all the existing issues. I'm tempted to say (b) as that shouldn't introduce any regressions, should be a relatively simple change to this series, and doesn't precluse making the rest stricter as a follow-up. I'm happy to take a look at that (and IIUC Rob is too). What's your preference? Thanks, Mark. On Mon, Nov 28, 2022 at 11:15:21AM -0600, Rob Herring wrote: > On Mon, Nov 28, 2022 at 10:36 AM Alexander Shishkin > wrote: > > > > Rob Herring writes: > > > > > On Fri, Nov 18, 2022 at 10:49 AM Will Deacon wrote: > > >> > > >> On Fri, Nov 04, 2022 at 10:55:07AM -0500, Rob Herring wrote: > > >> > @@ -515,6 +516,8 @@ struct perf_event_attr { > > >> > * truncated accordingly on 32 bit architectures. > > >> > */ > > >> > __u64 sig_data; > > >> > + > > >> > + __u64 config3; /* extension of config2 */ > > >> > > >> I need an ack from the perf core maintainers before I can take this. > > > > > > Peter, Arnaldo, Ingo, > > > > > > Can I get an ack on this please. > > > > It appears that PMUs that don't use config{1,2} and now config3 allow > > them to be whatever without any validation, whereas in reality we should > > probably -EINVAL in those cases. Should something be done about that? > > Always the 3rd occurrence that gets to clean-up things. ;) > > I think we'd have to add some capability flags for PMU drivers to set > to enable configN usage and then use those to validate configN is 0. > Wouldn't be too hard to do for config3 as we know there's exactly 1 > user, but for 1,2 there's about 80 PMU drivers to check. > > Rob >