[PATCH 20/21] arm: Get rid of asm/head.h

3 views
Skip to first unread message

Jan Kiszka

unread,
Sep 29, 2016, 4:22:49 PM9/29/16
to jailho...@googlegroups.com
Activate virt extension via sysregs.h, because only C modules the use
the sysreg macros will actually need that tweak. On the assembly side,
its much simpler to activate the extension explicitly. This allows us to
remove asm/head.h completely.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---
hypervisor/arch/arm/caches.S | 1 -
hypervisor/arch/arm/entry.S | 1 -
hypervisor/arch/arm/exception.S | 3 ++-
hypervisor/arch/arm/include/asm/head.h | 24 ------------------------
hypervisor/arch/arm/include/asm/setup.h | 1 -
hypervisor/arch/arm/include/asm/sysregs.h | 1 +
hypervisor/arch/arm/include/asm/traps.h | 1 -
7 files changed, 3 insertions(+), 29 deletions(-)
delete mode 100644 hypervisor/arch/arm/include/asm/head.h

diff --git a/hypervisor/arch/arm/caches.S b/hypervisor/arch/arm/caches.S
index 6d6c6fd..2bff521 100644
--- a/hypervisor/arch/arm/caches.S
+++ b/hypervisor/arch/arm/caches.S
@@ -11,7 +11,6 @@
*/

#include <asm/control.h>
-#include <asm/head.h>
#include <asm/sysregs.h>

/*
diff --git a/hypervisor/arch/arm/entry.S b/hypervisor/arch/arm/entry.S
index 8c53edc..53469e8 100644
--- a/hypervisor/arch/arm/entry.S
+++ b/hypervisor/arch/arm/entry.S
@@ -11,7 +11,6 @@
*/

#include <asm/asm-defines.h>
-#include <asm/head.h>
#include <asm/percpu.h>
#include <asm/processor.h>

diff --git a/hypervisor/arch/arm/exception.S b/hypervisor/arch/arm/exception.S
index 90c580f..3348cec 100644
--- a/hypervisor/arch/arm/exception.S
+++ b/hypervisor/arch/arm/exception.S
@@ -10,10 +10,11 @@
* the COPYING file in the top-level directory.
*/

-#include <asm/head.h>
#include <asm/processor.h>
#include <asm/sysregs.h>

+ .arch_extension virt
+
.text
.globl hyp_vectors
.align 5
diff --git a/hypervisor/arch/arm/include/asm/head.h b/hypervisor/arch/arm/include/asm/head.h
deleted file mode 100644
index aee1ade..0000000
--- a/hypervisor/arch/arm/include/asm/head.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Jailhouse, a Linux-based partitioning hypervisor
- *
- * Copyright (c) ARM Limited, 2014
- *
- * Authors:
- * Jean-Philippe Brucker <jean-phili...@arm.com>
- *
- * This work is licensed under the terms of the GNU GPL, version 2. See
- * the COPYING file in the top-level directory.
- */
-
-#ifndef _JAILHOUSE_ASM_HEAD_H
-#define _JAILHOUSE_ASM_HEAD_H_
-
-#ifdef __ASSEMBLY__
- .arch_extension virt
- .arm
- .syntax unified
-#else
- asm(".arch_extension virt\n");
-#endif
-
-#endif /* !_JAILHOUSE_ASM_HEAD_H */
diff --git a/hypervisor/arch/arm/include/asm/setup.h b/hypervisor/arch/arm/include/asm/setup.h
index 4f8ab36..f8d3aea 100644
--- a/hypervisor/arch/arm/include/asm/setup.h
+++ b/hypervisor/arch/arm/include/asm/setup.h
@@ -13,7 +13,6 @@
#ifndef _JAILHOUSE_ASM_SETUP_H
#define _JAILHOUSE_ASM_SETUP_H

-#include <asm/head.h>
#include <asm/percpu.h>

#ifndef __ASSEMBLY__
diff --git a/hypervisor/arch/arm/include/asm/sysregs.h b/hypervisor/arch/arm/include/asm/sysregs.h
index c503dd6..7b66545 100644
--- a/hypervisor/arch/arm/include/asm/sysregs.h
+++ b/hypervisor/arch/arm/include/asm/sysregs.h
@@ -145,6 +145,7 @@
#define arm_read_sysreg(...) _arm_read_sysreg(__VA_ARGS__)

#ifndef __ASSEMBLY__
+asm(".arch_extension virt\n");

#define arm_write_sysreg_32(op1, crn, crm, op2, val) \
asm volatile ("mcr p15, "#op1", %0, "#crn", "#crm", "#op2"\n" \
diff --git a/hypervisor/arch/arm/include/asm/traps.h b/hypervisor/arch/arm/include/asm/traps.h
index 7b46725..437e08f 100644
--- a/hypervisor/arch/arm/include/asm/traps.h
+++ b/hypervisor/arch/arm/include/asm/traps.h
@@ -14,7 +14,6 @@
#define _JAILHOUSE_ASM_TRAPS_H

#include <jailhouse/types.h>
-#include <asm/head.h>

#ifndef __ASSEMBLY__

--
2.1.4

Reply all
Reply to author
Forward
0 new messages