From patchwork Thu Apr 14 21:21:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 8843171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BE72B9F3A0 for ; Thu, 14 Apr 2016 21:25:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC47E20377 for ; Thu, 14 Apr 2016 21:25:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0102420374 for ; Thu, 14 Apr 2016 21:25:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aqojo-00087N-KX; Thu, 14 Apr 2016 21:23:44 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aqoho-0006WT-G0; Thu, 14 Apr 2016 21:21:40 +0000 Received: from geoff by merlin.infradead.org with local (Exim 4.85_2 #1 (Red Hat Linux)) id 1aqohk-0003Vn-PM; Thu, 14 Apr 2016 21:21:36 +0000 Message-Id: In-Reply-To: References: From: Geoff Levand Patch-Date: Fri, 1 Apr 2016 16:39:47 +0100 Subject: [PATCH v16 03/20] arm64: kvm: Move the do_el2_call macro to a header file To: Catalin Marinas , Will Deacon Date: Thu, 14 Apr 2016 21:21:36 +0000 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , marc.zyngier@arm.com, kexec@lists.infradead.org, AKASHI Takahiro , James Morse , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: James Morse The hyp-stub could make use of the do_el2_call(), move it to a header file. Signed-off-by: James Morse --- 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 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 #include #include +#include .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 /*