linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, will@kernel.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	clang-built-linux@googlegroups.com
Subject: Re: [PATCH 2/2] arm64: insn: move AARCH64_INSN_SIZE into <asm/insn.h>
Date: Thu, 17 Jun 2021 18:25:27 -0700	[thread overview]
Message-ID: <YMv2B6HCnDReOFIr@archlinux-ax161> (raw)
In-Reply-To: <20210609102301.17332-3-mark.rutland@arm.com>

Hi Mark,

On Wed, Jun 09, 2021 at 11:23:01AM +0100, Mark Rutland wrote:
> For histroical reasons, we define AARCH64_INSN_SIZE in
> <asm/alternative-macros.h>, but it would make more sense to do so in
> <asm/insn.h>. Let's move it into <asm/insn.h>, and add the necessary
> include directives for this.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> ---
>  arch/arm64/include/asm/alternative-macros.h | 4 +---
>  arch/arm64/include/asm/insn.h               | 3 +++
>  arch/arm64/include/asm/kvm_asm.h            | 1 +
>  arch/arm64/kernel/cpufeature.c              | 1 +
>  arch/arm64/kernel/patching.c                | 1 +
>  arch/arm64/kernel/traps.c                   | 1 +
>  arch/arm64/net/bpf_jit_comp.c               | 1 +
>  7 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/alternative-macros.h b/arch/arm64/include/asm/alternative-macros.h
> index 8a078fc662ac..703fbf310b79 100644
> --- a/arch/arm64/include/asm/alternative-macros.h
> +++ b/arch/arm64/include/asm/alternative-macros.h
> @@ -3,12 +3,10 @@
>  #define __ASM_ALTERNATIVE_MACROS_H
>  
>  #include <asm/cpucaps.h>
> +#include <asm/insn.h>
>  
>  #define ARM64_CB_PATCH ARM64_NCAPS
>  
> -/* A64 instructions are always 32 bits. */
> -#define	AARCH64_INSN_SIZE		4
> -
>  #ifndef __ASSEMBLY__
>  
>  #include <linux/stringify.h>
> diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h
> index a6f3f45fc46f..1430b4973039 100644
> --- a/arch/arm64/include/asm/insn.h
> +++ b/arch/arm64/include/asm/insn.h
> @@ -12,6 +12,9 @@
>  
>  #include <asm/alternative.h>
>  
> +/* A64 instructions are always 32 bits. */
> +#define	AARCH64_INSN_SIZE		4
> +
>  #ifndef __ASSEMBLY__
>  /*
>   * ARM Architecture Reference Manual for ARMv8 Profile-A, Issue A.a
> diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h
> index cf8df032b9c3..894edda8cc85 100644
> --- a/arch/arm64/include/asm/kvm_asm.h
> +++ b/arch/arm64/include/asm/kvm_asm.h
> @@ -8,6 +8,7 @@
>  #define __ARM_KVM_ASM_H__
>  
>  #include <asm/hyp_image.h>
> +#include <asm/insn.h>
>  #include <asm/virt.h>
>  
>  #define ARM_EXIT_WITH_SERROR_BIT  31
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index efed2830d141..16d35cfffcea 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -76,6 +76,7 @@
>  #include <asm/cpufeature.h>
>  #include <asm/cpu_ops.h>
>  #include <asm/fpsimd.h>
> +#include <asm/insn.h>
>  #include <asm/kvm_host.h>
>  #include <asm/mmu_context.h>
>  #include <asm/mte.h>
> diff --git a/arch/arm64/kernel/patching.c b/arch/arm64/kernel/patching.c
> index 7aa55b33c8c7..9a6edb9c48c7 100644
> --- a/arch/arm64/kernel/patching.c
> +++ b/arch/arm64/kernel/patching.c
> @@ -8,6 +8,7 @@
>  
>  #include <asm/cacheflush.h>
>  #include <asm/fixmap.h>
> +#include <asm/insn.h>
>  #include <asm/kprobes.h>
>  #include <asm/patching.h>
>  #include <asm/sections.h>
> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> index 48ff6fb888e0..8f66072fa5cb 100644
> --- a/arch/arm64/kernel/traps.c
> +++ b/arch/arm64/kernel/traps.c
> @@ -36,6 +36,7 @@
>  #include <asm/esr.h>
>  #include <asm/exception.h>
>  #include <asm/extable.h>
> +#include <asm/insn.h>
>  #include <asm/kprobes.h>
>  #include <asm/patching.h>
>  #include <asm/traps.h>
> diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
> index f7b194878a99..dd5000da18b8 100644
> --- a/arch/arm64/net/bpf_jit_comp.c
> +++ b/arch/arm64/net/bpf_jit_comp.c
> @@ -16,6 +16,7 @@
>  #include <asm/byteorder.h>
>  #include <asm/cacheflush.h>
>  #include <asm/debug-monitors.h>
> +#include <asm/insn.h>
>  #include <asm/set_memory.h>
>  
>  #include "bpf_jit.h"
> -- 
> 2.11.0
> 

I bisected a CONFIG_LTO_CLANG_THIN=y build failure that our CI reported
to this patch:

https://builds.tuxbuild.com/1u4Fpx2FQkkgkyPxWtq0Ke4YFCQ/build.log

I have not had a whole ton of time to look into this (dealing with a
million fires it seems :^) but it is not immediately obvious to me why
this fails because include/linux/build_bug.h is included within
arch/arm64/include/asm/insn.h. It seems only CONFIG_LTO_CLANG_THIN=y (or
FULL) is enough to trigger this, a regular defconfig build is fine:

https://builds.tuxbuild.com/1u4Fpt5M8quEVUd4kNSMrdzobC2/build.log

I will try to look into this tomorrow but I figured I would let you know
in case something obviously stuck out.

Cheers,
Nathan

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

  reply	other threads:[~2021-06-18  1:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 10:22 [PATCH 0/2] arm64: insn: cleanups Mark Rutland
2021-06-09 10:23 ` [PATCH 1/2] arm64: insn: decouple patching from insn code Mark Rutland
2021-06-09 10:23 ` [PATCH 2/2] arm64: insn: move AARCH64_INSN_SIZE into <asm/insn.h> Mark Rutland
2021-06-18  1:25   ` Nathan Chancellor [this message]
2021-06-18 15:18     ` Mark Rutland
2021-06-18 16:53       ` Nathan Chancellor
2021-06-21  8:08         ` Mark Rutland
2021-06-21 10:59           ` Will Deacon
2021-06-21 16:12           ` Nathan Chancellor
2021-06-11 16:15 ` [PATCH 0/2] arm64: insn: cleanups Will Deacon

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=YMv2B6HCnDReOFIr@archlinux-ax161 \
    --to=nathan@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@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).