All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Upton <oliver.upton@linux.dev>
To: Mark Brown <broonie@kernel.org>
Cc: kvmarm@lists.linux.dev, kvm@vger.kernel.org,
	Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Jing Zhang <jingzhangos@google.com>
Subject: Re: [PATCH 1/2] tools: arm64: Add a copy of sysreg-defs.h generated from the kernel
Date: Fri, 6 Oct 2023 09:23:59 +0000	[thread overview]
Message-ID: <ZR_SLyTfkhmdZoXI@linux.dev> (raw)
In-Reply-To: <66914631-c2fe-4a20-bfd6-561657cfe8e8@sirena.org.uk>

On Fri, Oct 06, 2023 at 01:23:08AM +0100, Mark Brown wrote:
> On Thu, Oct 05, 2023 at 06:03:23PM +0000, Oliver Upton wrote:
> 
> > Wiring up the build infrastructure necessary to generate the sysreg
> > definitions for dependent targets (e.g. perf, KVM selftests) is a bit of
> > an undertaking with near zero benefit. Just take what the kernel
> > generated instead.
> > 
> > Cc: Mark Brown <broonie@kernel.org>
> > Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
> > ---
> >  tools/arch/arm64/include/asm/sysreg-defs.h | 6806 ++++++++++++++++++++
> >  1 file changed, 6806 insertions(+)
> >  create mode 100644 tools/arch/arm64/include/asm/sysreg-defs.h
> 
> If we're going to go with this approach we should probably script the
> syncing of the generated file and ideally have something that detects if
> there is a generated copy in the main kernel build with differences to
> what's here.  There are regular syncs which I'm guessing are automated
> somehow, and I see that perf has some tooling to notice differences in
> the checked in files alraedy.

Yeah, I see no reason why this can't plug in to the check-headers script
to look at the output from the kernel side of the show.

> That said I'm not 100% clear why this isn't being added to "make
> headers" and/or the perf build stuff?

Isn't 'make headers' just for UAPI headers though? Also, perf is just an
incidental user of this via cputype.h, KVM selftests is what's taking
the direct dependency.

> Surely if perf is happy to peer into the main kernel source it could
> just as well do the generation as part of the build?  There's no great
> obstacle to having a target which runs the generation script that I
> can see.

That'd be less than ideal, IMO. tools maintaining a separate set of kernel
headers from the authoritative source avoids the need to coordinate
changes across kernel and tools. To keep things that way we either need
to copy the script+encoding or the header output. The latter isn't that
bothersome if/when we need an update.

-- 
Thanks,
Oliver

  reply	other threads:[~2023-10-06  9:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 18:03 [PATCH 0/2] tools: arm64: Sync sysreg.h with the kernel Oliver Upton
2023-10-05 18:03 ` [PATCH 1/2] tools: arm64: Add a copy of sysreg-defs.h generated from " Oliver Upton
2023-10-06  0:23   ` Mark Brown
2023-10-06  9:23     ` Oliver Upton [this message]
2023-10-06 11:33       ` Mark Brown
2023-10-06 19:41         ` Oliver Upton
2023-10-06 20:52           ` Mark Brown
2023-10-05 18:03 ` [PATCH 2/2] tools: arm64: Sync sysreg.h with the kernel source Oliver Upton
2023-10-05 18:25 ` [PATCH 0/2] tools: arm64: Sync sysreg.h with the kernel Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZR_SLyTfkhmdZoXI@linux.dev \
    --to=oliver.upton@linux.dev \
    --cc=broonie@kernel.org \
    --cc=james.morse@arm.com \
    --cc=jingzhangos@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.