From patchwork Thu Oct 1 12:04:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars Persson X-Patchwork-Id: 7308391 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 128F79F302 for ; Thu, 1 Oct 2015 12:10:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2B0AA2060A for ; Thu, 1 Oct 2015 12:10:22 +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 421AE20603 for ; Thu, 1 Oct 2015 12:10: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 1ZhcfL-00069J-Sr; Thu, 01 Oct 2015 12:08:51 +0000 Received: from bastet.se.axis.com ([195.60.68.11]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZhcbQ-00007t-VR for linux-arm-kernel@lists.infradead.org; Thu, 01 Oct 2015 12:04:50 +0000 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id 9B1E91819C; Thu, 1 Oct 2015 14:04:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bastet.se.axis.com Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id 24MtJCk61eRg; Thu, 1 Oct 2015 14:04:22 +0200 (CEST) Received: from boulder.se.axis.com (boulder.se.axis.com [10.0.2.104]) by bastet.se.axis.com (Postfix) with ESMTP id 0517718186; Thu, 1 Oct 2015 14:04:21 +0200 (CEST) Received: from boulder.se.axis.com (localhost [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id D621811A0; Thu, 1 Oct 2015 14:04:21 +0200 (CEST) Received: from thoth.se.axis.com (thoth.se.axis.com [10.0.2.173]) by boulder.se.axis.com (Postfix) with ESMTP id C7616108D; Thu, 1 Oct 2015 14:04:21 +0200 (CEST) Received: from lnxlarper1.se.axis.com (lnxlarper1.se.axis.com [10.88.41.2]) by thoth.se.axis.com (Postfix) with ESMTP id C4E6E34009; Thu, 1 Oct 2015 14:04:21 +0200 (CEST) Received: by lnxlarper1.se.axis.com (Postfix, from userid 20456) id C077F800E9; Thu, 1 Oct 2015 14:04:21 +0200 (CEST) From: Lars Persson To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC] arm: Add generic smc wrapper Date: Thu, 1 Oct 2015 14:04:07 +0200 Message-Id: <1443701047-10101-1-git-send-email-larper@axis.com> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151001_050449_251956_2137CF7B X-CRM114-Status: GOOD ( 12.84 ) X-Spam-Score: -2.6 (--) 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: Lars Persson 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 This adds an smc wrapper according to the ARM standard for secure monitor calling conventions (ARM DEN 0028A). Signed-off-by: Lars Persson --- arch/arm/include/asm/smc-call.h | 12 ++++++++++++ arch/arm/kernel/Makefile | 2 ++ arch/arm/kernel/smc-call.S | 22 ++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 arch/arm/include/asm/smc-call.h create mode 100644 arch/arm/kernel/smc-call.S diff --git a/arch/arm/include/asm/smc-call.h b/arch/arm/include/asm/smc-call.h new file mode 100644 index 0000000..88a83d4 --- /dev/null +++ b/arch/arm/include/asm/smc-call.h @@ -0,0 +1,12 @@ +/* + * Wrapper for secure monitor calls using the ARM SMC calling + * convention. + */ +#ifndef __ASM_SMC_CALL_H +#define __ASM_SMC_CALL_H + +#include + +extern int invoke_smc(u32 function_id, u32 arg0, u32 arg1, u32 arg2); + +#endif diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index af9e59b..f09d2d6 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -92,4 +92,6 @@ obj-y += psci-call.o obj-$(CONFIG_SMP) += psci_smp.o endif +obj-y += smc-call.o + extra-y := $(head-y) vmlinux.lds diff --git a/arch/arm/kernel/smc-call.S b/arch/arm/kernel/smc-call.S new file mode 100644 index 0000000..a07ebf9 --- /dev/null +++ b/arch/arm/kernel/smc-call.S @@ -0,0 +1,22 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Copied from: psci-call.S. + */ + +#include + +#include + +/* int invoke_smc(u32 function_id, u32 arg0, u32 arg1, u32 arg2) */ +ENTRY(invoke_smc) + __SMC(0) + bx lr +ENDPROC(invoke_smc)