public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: ardb@kernel.org, bertrand.marquis@arm.com,
	boris.ostrovsky@oracle.com, broonie@kernel.org,
	catalin.marinas@arm.com, daniel.lezcano@linaro.org,
	james.morse@arm.com, jgross@suse.com, kristina.martsenko@arm.com,
	maz@kernel.org, oliver.upton@linux.dev, pcc@google.com,
	sstabellini@kernel.org, suzuki.poulose@arm.com,
	tglx@linutronix.de, vladimir.murzin@arm.com, will@kernel.org
Subject: Re: [PATCH v2 03/38] arm64: Factor out cpucap definitions
Date: Thu, 5 Oct 2023 13:29:30 +0100	[thread overview]
Message-ID: <ZR6sKkHAJu-CdCUx@FVFF77S0Q05N> (raw)
In-Reply-To: <20231005095025.1872048-4-mark.rutland@arm.com>

On Thu, Oct 05, 2023 at 10:49:49AM +0100, Mark Rutland wrote:
> For clarity it would be nice to factor cpucap manipulation out of
> <asm/cpufeature.h>, and the obvious place would be <asm/cpucap.h>, but
> this will clash somewhat with <generated/asm/cpucaps.h>.
> 
> Rename <generated/asm/cpucaps.h> to <generated/asm/cpucap-defs.h>,
> matching what we do for <generated/asm/sysreg-defs.h>, and introduce a
> new <asm/cpucaps.h> which includes the generated header.
> 
> Subsequent patches will fill out <asm/cpucaps.h>.
> 
> There should be no functional change as a result of this patch.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
> Cc: Will Deacon <will@kernel.org>
> ---
>  arch/arm64/include/asm/cpucaps.h | 8 ++++++++
>  arch/arm64/tools/Makefile        | 4 ++--
>  arch/arm64/tools/gen-cpucaps.awk | 6 +++---
>  3 files changed, 13 insertions(+), 5 deletions(-)
>  create mode 100644 arch/arm64/include/asm/cpucaps.h

I've just realised that I forgot to update arch/arm64/include/asm/Kbuild, and
as-is this will cause cpucap-defs.h to be removed and regenerated on every
subsequent build, which isn't desirable.

I'll fold in the below for v3 to fix that:

| diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild
| index 5c8ee5a541d20..4b6d2d52053e4 100644
| --- a/arch/arm64/include/asm/Kbuild
| +++ b/arch/arm64/include/asm/Kbuild
| @@ -6,5 +6,5 @@ generic-y += qspinlock.h
|  generic-y += parport.h
|  generic-y += user.h
|  
| -generated-y += cpucaps.h
| +generated-y += cpucap-defs.h
|  generated-y += sysreg-defs.h

Mark.

> 
> diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
> new file mode 100644
> index 0000000000000..7333b5bbf4488
> --- /dev/null
> +++ b/arch/arm64/include/asm/cpucaps.h
> @@ -0,0 +1,8 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef __ASM_CPUCAPS_H
> +#define __ASM_CPUCAPS_H
> +
> +#include <asm/cpucap-defs.h>
> +
> +#endif /* __ASM_CPUCAPS_H */
> diff --git a/arch/arm64/tools/Makefile b/arch/arm64/tools/Makefile
> index 07a93ab21a62b..fa2251d9762d9 100644
> --- a/arch/arm64/tools/Makefile
> +++ b/arch/arm64/tools/Makefile
> @@ -3,7 +3,7 @@
>  gen := arch/$(ARCH)/include/generated
>  kapi := $(gen)/asm
>  
> -kapi-hdrs-y := $(kapi)/cpucaps.h $(kapi)/sysreg-defs.h
> +kapi-hdrs-y := $(kapi)/cpucap-defs.h $(kapi)/sysreg-defs.h
>  
>  targets += $(addprefix ../../../, $(kapi-hdrs-y))
>  
> @@ -17,7 +17,7 @@ quiet_cmd_gen_cpucaps = GEN     $@
>  quiet_cmd_gen_sysreg = GEN     $@
>        cmd_gen_sysreg = mkdir -p $(dir $@); $(AWK) -f $(real-prereqs) > $@
>  
> -$(kapi)/cpucaps.h: $(src)/gen-cpucaps.awk $(src)/cpucaps FORCE
> +$(kapi)/cpucap-defs.h: $(src)/gen-cpucaps.awk $(src)/cpucaps FORCE
>  	$(call if_changed,gen_cpucaps)
>  
>  $(kapi)/sysreg-defs.h: $(src)/gen-sysreg.awk $(src)/sysreg FORCE
> diff --git a/arch/arm64/tools/gen-cpucaps.awk b/arch/arm64/tools/gen-cpucaps.awk
> index 8525980379d71..2f4f61a0af17e 100755
> --- a/arch/arm64/tools/gen-cpucaps.awk
> +++ b/arch/arm64/tools/gen-cpucaps.awk
> @@ -15,8 +15,8 @@ function fatal(msg) {
>  /^#/ { next }
>  
>  BEGIN {
> -	print "#ifndef __ASM_CPUCAPS_H"
> -	print "#define __ASM_CPUCAPS_H"
> +	print "#ifndef __ASM_CPUCAP_DEFS_H"
> +	print "#define __ASM_CPUCAP_DEFS_H"
>  	print ""
>  	print "/* Generated file - do not edit */"
>  	cap_num = 0
> @@ -31,7 +31,7 @@ BEGIN {
>  END {
>  	printf("#define ARM64_NCAPS\t\t\t\t\t%d\n", cap_num)
>  	print ""
> -	print "#endif /* __ASM_CPUCAPS_H */"
> +	print "#endif /* __ASM_CPUCAP_DEFS_H */"
>  }
>  
>  # Any lines not handled by previous rules are unexpected
> -- 
> 2.30.2
> 

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

  reply	other threads:[~2023-10-05 12:30 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05  9:49 [PATCH v2 00/38] arm64: Remove cpus_have_const_cap() Mark Rutland
2023-10-05  9:49 ` [PATCH v2 01/38] clocksource/drivers/arm_arch_timer: Initialize evtstrm after finalizing cpucaps Mark Rutland
2023-10-05  9:49 ` [PATCH v2 02/38] arm64/arm: xen: enlighten: Fix KPTI checks Mark Rutland
2023-10-05  9:49 ` [PATCH v2 03/38] arm64: Factor out cpucap definitions Mark Rutland
2023-10-05 12:29   ` Mark Rutland [this message]
2023-10-05  9:49 ` [PATCH v2 04/38] arm64: Add cpucap_is_possible() Mark Rutland
2023-10-05  9:49 ` [PATCH v2 05/38] arm64: Add cpus_have_final_boot_cap() Mark Rutland
2023-10-05  9:49 ` [PATCH v2 06/38] arm64: Rework setup_cpu_features() Mark Rutland
2023-10-05  9:49 ` [PATCH v2 07/38] arm64: Fixup user features at boot time Mark Rutland
2023-10-05  9:49 ` [PATCH v2 08/38] arm64: Split kpti_install_ng_mappings() Mark Rutland
2023-10-05  9:49 ` [PATCH v2 09/38] arm64: kvm: Use cpus_have_final_cap() explicitly Mark Rutland
2023-10-05  9:49 ` [PATCH v2 10/38] arm64: Explicitly save/restore CPACR when probing SVE and SME Mark Rutland
2023-10-05  9:49 ` [PATCH v2 11/38] arm64: use build-time assertions for cpucap ordering Mark Rutland
2023-10-05  9:49 ` [PATCH v2 11/38] arm64: Use " Mark Rutland
2023-10-05  9:49 ` [PATCH v2 12/38] arm64: Rename SVE/SME cpu_enable functions Mark Rutland
2023-10-05  9:50 ` [PATCH v2 13/38] arm64: Use a positive cpucap for FP/SIMD Mark Rutland
2023-10-05  9:50 ` [PATCH v2 14/38] arm64: Avoid cpus_have_const_cap() for ARM64_HAS_{ADDRESS,GENERIC}_AUTH Mark Rutland
2023-10-05  9:50 ` [PATCH v2 15/38] arm64: Avoid cpus_have_const_cap() for ARM64_HAS_ARMv8_4_TTL Mark Rutland
2023-10-05  9:50 ` [PATCH v2 16/38] arm64: Avoid cpus_have_const_cap() for ARM64_HAS_BTI Mark Rutland
2023-10-05  9:50 ` [PATCH v2 17/38] arm64: Avoid cpus_have_const_cap() for ARM64_HAS_CACHE_DIC Mark Rutland
2023-10-05  9:50 ` [PATCH v2 18/38] arm64: Avoid cpus_have_const_cap() for ARM64_HAS_CNP Mark Rutland
2023-10-05  9:50 ` [PATCH v2 19/38] arm64: Avoid cpus_have_const_cap() for ARM64_HAS_DIT Mark Rutland
2023-10-05  9:50 ` [PATCH v2 20/38] arm64: Avoid cpus_have_const_cap() for ARM64_HAS_GIC_PRIO_MASKING Mark Rutland
2023-10-05  9:50 ` [PATCH v2 21/38] arm64: Avoid cpus_have_const_cap() for ARM64_HAS_PAN Mark Rutland
2023-10-05  9:50 ` [PATCH v2 22/38] arm64: Avoid cpus_have_const_cap() for ARM64_HAS_EPAN Mark Rutland
2023-10-05  9:50 ` [PATCH v2 23/38] arm64: Avoid cpus_have_const_cap() for ARM64_HAS_RNG Mark Rutland
2023-10-05  9:50 ` [PATCH v2 24/38] arm64: Avoid cpus_have_const_cap() for ARM64_HAS_WFXT Mark Rutland
2023-10-05  9:50 ` [PATCH v2 25/38] arm64: Avoid cpus_have_const_cap() for ARM64_HAS_TLB_RANGE Mark Rutland
2023-10-05  9:50 ` [PATCH v2 26/38] arm64: Avoid cpus_have_const_cap() for ARM64_MTE Mark Rutland
2023-10-05  9:50 ` [PATCH v2 27/38] arm64: Avoid cpus_have_const_cap() for ARM64_SSBS Mark Rutland
2023-10-05  9:50 ` [PATCH v2 28/38] arm64: Avoid cpus_have_const_cap() for ARM64_SPECTRE_V2 Mark Rutland
2023-10-05  9:50 ` [PATCH v2 29/38] arm64: Avoid cpus_have_const_cap() for ARM64_{SVE,SME,SME2,FA64} Mark Rutland
2023-10-05  9:50 ` [PATCH v2 30/38] arm64: Avoid cpus_have_const_cap() for ARM64_UNMAP_KERNEL_AT_EL0 Mark Rutland
2023-10-05  9:50 ` [PATCH v2 31/38] arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_843419 Mark Rutland
2023-10-05  9:50 ` [PATCH v2 32/38] arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_1542419 Mark Rutland
2023-10-05  9:50 ` [PATCH v2 33/38] arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_1742098 Mark Rutland
2023-10-05  9:50 ` [PATCH v2 34/38] arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_2645198 Mark Rutland
2023-10-05  9:50 ` [PATCH v2 35/38] arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_CAVIUM_23154 Mark Rutland
2023-10-05  9:50 ` [PATCH v2 36/38] arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_NVIDIA_CARMEL_CNP Mark Rutland
2023-10-05  9:50 ` [PATCH v2 37/38] arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_REPEAT_TLBI Mark Rutland
2023-10-05  9:50 ` [PATCH v2 38/38] arm64: Remove cpus_have_const_cap() Mark Rutland

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=ZR6sKkHAJu-CdCUx@FVFF77S0Q05N \
    --to=mark.rutland@arm.com \
    --cc=ardb@kernel.org \
    --cc=bertrand.marquis@arm.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=james.morse@arm.com \
    --cc=jgross@suse.com \
    --cc=kristina.martsenko@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pcc@google.com \
    --cc=sstabellini@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=tglx@linutronix.de \
    --cc=vladimir.murzin@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