linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Mark Brown <broonie@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	 Suzuki K Poulose <suzuki.poulose@arm.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] arm64: Generate cpucaps.h
Date: Thu, 13 May 2021 13:30:53 +0200	[thread overview]
Message-ID: <CAMuHMdWyfySPyt=A+pOFq=adF7mhM0T4-4b+6bWX_857s9XT8g@mail.gmail.com> (raw)
In-Reply-To: <20210428121231.11219-1-broonie@kernel.org>

Hi Mark,

On Wed, Apr 28, 2021 at 2:25 PM Mark Brown <broonie@kernel.org> wrote:
> The arm64 code allocates an internal constant to every CPU feature it can
> detect, distinct from the public hwcap numbers we use to expose some
> features to userspace. Currently this is maintained manually which is an
> irritating source of conflicts when working on new features, to avoid this
> replace the header with a simple text file listing the names we've assigned
> and sort it to minimise conflicts.
>
> As part of doing this we also do the Kbuild hookup required to hook up
> an arch tools directory and to generate header files in there.
>
> This will result in a renumbering and reordering of the existing constants,
> since they are all internal only the values should not be important. The
> reordering will impact the order in which some steps in enumeration handle
> features but the algorithm is not intended to depend on this and I haven't
> seen any issues when testing. Due to the UAO cpucap having been removed in
> the past we end up with ARM64_NCAPS being 1 smaller than it was before.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  arch/arm64/Makefile              |  3 ++
>  arch/arm64/include/asm/Kbuild    |  2 +
>  arch/arm64/include/asm/cpucaps.h | 74 --------------------------------
>  arch/arm64/tools/Makefile        | 22 ++++++++++
>  arch/arm64/tools/cpucaps         | 65 ++++++++++++++++++++++++++++
>  arch/arm64/tools/gen-cpucaps.awk | 40 +++++++++++++++++

I guess the reason you're doing it like this, and not using a simple C
enum, is that some of these definitions are used from asm files?
Do we use similar mechanisms in other places?
Would introducing a generic way to generate headers with definitions
from a C enum be worthwhile?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-05-13 11:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 12:12 [PATCH] arm64: Generate cpucaps.h Mark Brown
2021-04-29 12:32 ` Catalin Marinas
2021-05-04 11:43 ` Mark Rutland
2021-05-10 12:55 ` Catalin Marinas
2021-05-13  5:05 ` Anshuman Khandual
2021-05-13 11:51   ` Mark Rutland
2021-05-13 12:45   ` Mark Brown
2021-05-13 11:30 ` Geert Uytterhoeven [this message]
2021-05-13 13:03   ` Mark Brown
2021-09-21 18:08 ` dann frazier
2021-09-21 18:35   ` Mark Brown
2021-09-21 21:09     ` Suzuki K Poulose
2021-09-22 13:45       ` dann frazier

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='CAMuHMdWyfySPyt=A+pOFq=adF7mhM0T4-4b+6bWX_857s9XT8g@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).