[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <gsntpljw1apl.fsf@coltonlewis-kvm.c.googlers.com>
Date: Wed, 05 Feb 2025 18:57:10 +0000
From: Colton Lewis <coltonlewis@...gle.com>
To: Oliver Upton <oliver.upton@...ux.dev>
Cc: kvm@...r.kernel.org, linux@...linux.org.uk, catalin.marinas@....com,
will@...nel.org, maz@...nel.org, joey.gouly@....com, suzuki.poulose@....com,
yuzenghui@...wei.com, mark.rutland@....com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
kvmarm@...ts.linux.dev
Subject: Re: [PATCH 2/2] perf: arm_pmuv3: Uninvert dependency between {asm,perf}/arm_pmuv3.h
Oliver Upton <oliver.upton@...ux.dev> writes:
> On Tue, Feb 04, 2025 at 07:57:08PM +0000, Colton Lewis wrote:
>> perf/arm_pmuv3.h includes asm/arm_pmuv3.h at the bottom of the
>> file. This counterintiutive decision was presumably made so
>> asm/arm_pmuv3.h would be included everywhere perf/arm_pmuv3.h was even
>> though the actual dependency relationship goes the other way because
>> asm/arm_pmuv3.h depends on the PMEVN_SWITCH macro that was presumably
>> put there to avoid duplicating it in the asm files for arm and arm64.
>> Extract the relevant macro to its own file to avoid this unusual
>> structure so it may be included in the asm headers without worrying
>> about ordering issues.
>> Signed-off-by: Colton Lewis <coltonlewis@...gle.com>
> Is the intention of this change to allow asm/arm_pmuv3.h to be directly
> included? If yes, what's the issue with using perf/arm_pmuv3.h?
That isn't the primary intent, but it's a good side effect. Headers that
can't be directly included violate people's expectations.
> We already use definitions from the non-arch header in KVM anyway...
My intention here was just reorganizing a counterintuitive use of
headers. The arch header depends on definitions in the non-arch header
even though the inclusion relationship is the other way around.
But this patch doesn't matter as much as fixing the cyclical dependency.
Powered by blists - more mailing lists