From: geoff@infradead.org (Geoff Levand)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v16 03/20] arm64: kvm: Move the do_el2_call macro to a header file
Date: Thu, 14 Apr 2016 21:21:36 +0000 [thread overview]
Message-ID: <af6f3f4788a3d2bbda935ea02c6b08fbc305af40.1460668521.git.geoff@infradead.org> (raw)
In-Reply-To: <cover.1460668521.git.geoff@infradead.org>
From: James Morse <james.morse@arm.com>
The hyp-stub could make use of the do_el2_call(), move it to a header file.
Signed-off-by: James Morse <james.morse@arm.com>
---
arch/arm64/include/asm/virt.h | 18 +++++++++++++++++-
arch/arm64/kvm/hyp/hyp-entry.S | 17 +----------------
2 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h
index 9f22dd6..b8fddde 100644
--- a/arch/arm64/include/asm/virt.h
+++ b/arch/arm64/include/asm/virt.h
@@ -21,7 +21,23 @@
#define BOOT_CPU_MODE_EL1 (0xe11)
#define BOOT_CPU_MODE_EL2 (0xe12)
-#ifndef __ASSEMBLY__
+#ifdef __ASSEMBLY__
+.macro do_el2_call
+ /*
+ * Shuffle the parameters before calling the function
+ * pointed to in x0. Assumes parameters in x[1,2,3].
+ */
+ sub sp, sp, #16
+ str lr, [sp]
+ mov lr, x0
+ mov x0, x1
+ mov x1, x2
+ mov x2, x3
+ blr lr
+ ldr lr, [sp]
+ add sp, sp, #16
+.endm
+#else
#include <asm/ptrace.h>
diff --git a/arch/arm64/kvm/hyp/hyp-entry.S b/arch/arm64/kvm/hyp/hyp-entry.S
index 3488894..358f27a 100644
--- a/arch/arm64/kvm/hyp/hyp-entry.S
+++ b/arch/arm64/kvm/hyp/hyp-entry.S
@@ -23,6 +23,7 @@
#include <asm/kvm_arm.h>
#include <asm/kvm_asm.h>
#include <asm/kvm_mmu.h>
+#include <asm/virt.h>
.text
.pushsection .hyp.text, "ax"
@@ -37,22 +38,6 @@
ldp x0, x1, [sp], #16
.endm
-.macro do_el2_call
- /*
- * Shuffle the parameters before calling the function
- * pointed to in x0. Assumes parameters in x[1,2,3].
- */
- sub sp, sp, #16
- str lr, [sp]
- mov lr, x0
- mov x0, x1
- mov x1, x2
- mov x2, x3
- blr lr
- ldr lr, [sp]
- add sp, sp, #16
-.endm
-
ENTRY(__vhe_hyp_call)
do_el2_call
/*
--
2.5.0
next prev parent reply other threads:[~2016-04-14 21:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 21:21 [PATCH v16 00/20] arm64 kexec kernel patches v16 Geoff Levand
2016-04-14 21:21 ` [PATCH v16 02/20] arm64: Cleanup SCTLR flags Geoff Levand
2016-04-14 21:21 ` [PATCH v16 01/20] arm64: Fold proc-macros.S into assembler.h Geoff Levand
2016-04-14 21:21 ` [PATCH v16 04/20] arm64: kvm: Move lr save/restore from do_el2_call into EL1 Geoff Levand
2016-04-14 21:21 ` [PATCH v16 05/20] arm64: hyp/kvm: Extend hyp-stub API to allow function calls at EL2 Geoff Levand
2016-04-14 21:21 ` Geoff Levand [this message]
2016-04-14 21:21 ` [PATCH v16 18/20] arm64: kdump: add kdump support Geoff Levand
2016-04-14 21:21 ` [PATCH v16 07/20] arm64: kernel: Include _AC definition in page.h Geoff Levand
2016-04-14 21:21 ` [PATCH v16 10/20] arm64: head.S: el2_setup() to accept sctlr_el1 as an argument Geoff Levand
2016-04-14 21:21 ` [PATCH v16 15/20] arm64: kdump: reserve memory for crash dump kernel Geoff Levand
2016-04-14 21:21 ` [PATCH v16 06/20] arm64: kvm: allows kvm cpu hotplug Geoff Levand
2016-04-14 21:21 ` [PATCH v16 17/20] arm64: kdump: implement machine_crash_shutdown() Geoff Levand
2016-04-14 21:21 ` [PATCH v16 13/20] arm64/kexec: Enable kexec in the arm64 defconfig Geoff Levand
2016-04-14 21:21 ` [PATCH v16 09/20] arm64: Add new asm macro copy_page Geoff Levand
2016-04-14 21:21 ` [PATCH v16 16/20] arm64: limit memory regions based on DT property, usable-memory Geoff Levand
2016-04-14 21:21 ` [PATCH v16 14/20] arm64/kexec: Add pr_debug output Geoff Levand
2016-04-14 21:21 ` [PATCH v16 08/20] arm64: Promote KERNEL_START/KERNEL_END definitions to a header file Geoff Levand
2016-04-14 21:21 ` [PATCH v16 11/20] arm64: Add back cpu_reset routines Geoff Levand
2016-04-14 21:21 ` [PATCH v16 12/20] arm64/kexec: Add core kexec support Geoff Levand
2016-04-14 21:21 ` [PATCH v16 19/20] arm64: kdump: enable kdump in the arm64 defconfig Geoff Levand
2016-04-14 21:21 ` [PATCH v16 20/20] arm64: kdump: update a kernel doc Geoff Levand
2016-05-12 18:24 ` [PATCH v16 00/20] arm64 kexec kernel patches v16 Julien Grall
2016-05-13 4:55 ` AKASHI Takahiro
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=af6f3f4788a3d2bbda935ea02c6b08fbc305af40.1460668521.git.geoff@infradead.org \
--to=geoff@infradead.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).