From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35739C636D3 for ; Wed, 8 Feb 2023 19:27:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231783AbjBHT1H (ORCPT ); Wed, 8 Feb 2023 14:27:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbjBHT1E (ORCPT ); Wed, 8 Feb 2023 14:27:04 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E1B795279 for ; Wed, 8 Feb 2023 11:27:02 -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 1CE181477; Wed, 8 Feb 2023 11:27:45 -0800 (PST) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.30.155]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DF7063F703; Wed, 8 Feb 2023 11:27:01 -0800 (PST) Date: Wed, 8 Feb 2023 19:26:59 +0000 From: Mark Rutland To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon Subject: Re: [PATCH V7 3/6] arm64/perf: Add branch stack support in struct arm_pmu Message-ID: References: <20230105031039.207972-1-anshuman.khandual@arm.com> <20230105031039.207972-4-anshuman.khandual@arm.com> <0351f0bc-d94b-957f-8e03-6525e47d63a4@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0351f0bc-d94b-957f-8e03-6525e47d63a4@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 13, 2023 at 09:45:22AM +0530, Anshuman Khandual wrote: > > On 1/12/23 19:24, Mark Rutland wrote: > > On Thu, Jan 05, 2023 at 08:40:36AM +0530, Anshuman Khandual wrote: > >> struct arm_pmu { > >> struct pmu pmu; > >> cpumask_t supported_cpus; > >> char *name; > >> int pmuver; > >> + int features; > >> irqreturn_t (*handle_irq)(struct arm_pmu *pmu); > >> void (*enable)(struct perf_event *event); > >> void (*disable)(struct perf_event *event); > > > > Hmm, we already have the secure_access field separately. How about we fold that > > in and go with: > > > > unsigned int secure_access : 1, > > has_branch_stack : 1; > > Something like this would work, but should we use __u32 instead of unsigned int > to ensure 32 bit width ? I don't think that's necessary; the exact size doesn't really matter, and unsigned int is 32-bits on all targets suppropted by Linux, not just arm and arm64. I do agree that if this were a userspace ABI detail, it might be preferable to use __u32. However, I think using it here gives the misleading impression that there is an ABI concern when there is not, and as above it's not necessary, so I'd prefer unsigned int here. Thanks, Mark.