linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6sub1 03/11] arm64: prevent potential circular header dependencies in asm/bug.h
Date: Tue, 16 Feb 2016 13:52:34 +0100	[thread overview]
Message-ID: <1455627162-31600-4-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1455627162-31600-1-git-send-email-ard.biesheuvel@linaro.org>

Currently, using BUG_ON() in header files is cumbersome, due to the fact
that asm/bug.h transitively includes a lot of other header files, resulting
in the actual BUG_ON() invocation appearing before its definition in the
preprocessor input. So let's reverse the #include dependency between
asm/bug.h and asm/debug-monitors.h, by moving the definition of BUG_BRK_IMM
from the latter to the former. Also fix up one user of asm/debug-monitors.h
which relied on a transitive include.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/arm64/include/asm/bug.h            | 2 +-
 arch/arm64/include/asm/debug-monitors.h | 2 +-
 arch/arm64/kvm/hyp/debug-sr.c           | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/include/asm/bug.h b/arch/arm64/include/asm/bug.h
index 4a748ce9ba1a..679d49221998 100644
--- a/arch/arm64/include/asm/bug.h
+++ b/arch/arm64/include/asm/bug.h
@@ -18,7 +18,7 @@
 #ifndef _ARCH_ARM64_ASM_BUG_H
 #define _ARCH_ARM64_ASM_BUG_H
 
-#include <asm/debug-monitors.h>
+#define BUG_BRK_IMM			0x800
 
 #ifdef CONFIG_GENERIC_BUG
 #define HAVE_ARCH_BUG
diff --git a/arch/arm64/include/asm/debug-monitors.h b/arch/arm64/include/asm/debug-monitors.h
index 279c85b5ec09..e893a1fca9c2 100644
--- a/arch/arm64/include/asm/debug-monitors.h
+++ b/arch/arm64/include/asm/debug-monitors.h
@@ -20,6 +20,7 @@
 
 #include <linux/errno.h>
 #include <linux/types.h>
+#include <asm/bug.h>
 #include <asm/esr.h>
 #include <asm/insn.h>
 #include <asm/ptrace.h>
@@ -57,7 +58,6 @@
 #define FAULT_BRK_IMM			0x100
 #define KGDB_DYN_DBG_BRK_IMM		0x400
 #define KGDB_COMPILED_DBG_BRK_IMM	0x401
-#define BUG_BRK_IMM			0x800
 
 /*
  * BRK instruction encoding
diff --git a/arch/arm64/kvm/hyp/debug-sr.c b/arch/arm64/kvm/hyp/debug-sr.c
index c9c1e97501a9..2f8bca8af295 100644
--- a/arch/arm64/kvm/hyp/debug-sr.c
+++ b/arch/arm64/kvm/hyp/debug-sr.c
@@ -18,6 +18,7 @@
 #include <linux/compiler.h>
 #include <linux/kvm_host.h>
 
+#include <asm/debug-monitors.h>
 #include <asm/kvm_asm.h>
 #include <asm/kvm_mmu.h>
 
-- 
2.5.0

  parent reply	other threads:[~2016-02-16 12:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 12:52 [PATCH v6sub1 00/11] arm64: split linear and kernel mappings Ard Biesheuvel
2016-02-16 12:52 ` [PATCH v6sub1 01/11] of/fdt: make memblock minimum physical address arch configurable Ard Biesheuvel
2016-02-16 12:52 ` [PATCH v6sub1 02/11] of/fdt: factor out assignment of initrd_start/initrd_end Ard Biesheuvel
2016-02-16 17:28   ` Rob Herring
2016-02-16 12:52 ` Ard Biesheuvel [this message]
2016-02-16 12:52 ` [PATCH v6sub1 04/11] arm64: add support for ioremap() block mappings Ard Biesheuvel
2016-02-16 12:52 ` [PATCH v6sub1 05/11] arm64: introduce KIMAGE_VADDR as the virtual base of the kernel region Ard Biesheuvel
2016-02-16 12:52 ` [PATCH v6sub1 06/11] arm64: pgtable: implement static [pte|pmd|pud]_offset variants Ard Biesheuvel
2016-02-16 12:52 ` [PATCH v6sub1 07/11] arm64: decouple early fixmap init from linear mapping Ard Biesheuvel
2016-02-16 12:52 ` [PATCH v6sub1 08/11] arm64: kvm: deal with kernel symbols outside of " Ard Biesheuvel
2016-02-16 12:52 ` [PATCH v6sub1 09/11] arm64: move kernel image to base of vmalloc area Ard Biesheuvel
2016-02-16 12:52 ` [PATCH v6sub1 10/11] arm64: defer __va translation of initrd_start and initrd_end Ard Biesheuvel
2016-02-16 12:52 ` [PATCH v6sub1 11/11] arm64: allow kernel Image to be loaded anywhere in physical memory Ard Biesheuvel
2016-02-18 18:25 ` [PATCH v6sub1 00/11] arm64: split linear and kernel mappings Catalin Marinas
2016-02-18 18:27   ` Ard Biesheuvel
2016-02-18 19:38     ` Ard Biesheuvel
2016-02-19  8:05       ` Ard Biesheuvel
2016-02-19 14:25         ` Catalin Marinas
2016-02-19 14:27           ` Ard Biesheuvel
2016-02-19 14:29             ` Ard Biesheuvel
2016-02-19 14:37               ` Catalin Marinas
2016-02-19 14:40                 ` Ard Biesheuvel
2016-02-19 14:57                   ` Catalin Marinas
2016-02-19 17:34                   ` Catalin Marinas
2016-02-19 17:38                     ` Ard Biesheuvel
2016-02-19 17:43                       ` Catalin Marinas

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=1455627162-31600-4-git-send-email-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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).