From patchwork Sat Aug 20 05:51:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 9291593 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DCEBC60572 for ; Sat, 20 Aug 2016 05:52:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD778291FB for ; Sat, 20 Aug 2016 05:52:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C23CA293C6; Sat, 20 Aug 2016 05:52:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 469CF291FB for ; Sat, 20 Aug 2016 05:52:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752541AbcHTFvp (ORCPT ); Sat, 20 Aug 2016 01:51:45 -0400 Received: from mail-oi0-f45.google.com ([209.85.218.45]:33538 "EHLO mail-oi0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752456AbcHTFvn (ORCPT ); Sat, 20 Aug 2016 01:51:43 -0400 Received: by mail-oi0-f45.google.com with SMTP id c15so90416415oig.0 for ; Fri, 19 Aug 2016 22:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8yaT4NoSmEiHuj3lXCFbvlnTnKMA768ZtoJBMFxU9WM=; b=C7IhosBHXkA9EgNBrIf1COlewRUhAF+/2bG6mkYLJ6xdd3Pz6dP9p0iJcWd7YO/iQN 7DZJFX2pIzs/XAy11LMBBnqmXLaRJ3MawvdJEf6tqTUulrC2po06GM7OA2Gcfhh4BBIn r9mbivDoFp0YKNAm5TBv2OsHAg7xKEKxH8o7k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8yaT4NoSmEiHuj3lXCFbvlnTnKMA768ZtoJBMFxU9WM=; b=eKf4PE6rZBD/89KhkjJu2JRA/JzWDqjgJC5QvqSfnL/WzpUg11s+cxWjjQfCtpA37b cudOEQuZl7fT2POAnIdFZHsCVFnyfQpN9UBOnrbyumwGiVjqnoyPPbYFKbZGXBitU3/e k1KuK2M86TglK6bQTmLBT/96V6/gUszN1fCVSHDLtULLp37Oa27bx/H+QqUOTjSj1jHC a+bMLWb6OAiiO+TE/PFGQVEAKgoPwAR/wg2Wd4h2d/mrQUinMG31309DGJ84vRs1OhW8 ceFvd6dxPMIJp6t7ivkuKrwxInF6rJYBsMrBfK3ljJ6x57ebyEvn1rOJVlFZWig73dUV WhLw== X-Gm-Message-State: AEkoousqFLLf7L4C2HvWM4y/6uElwCncUXDH58s3TEyHolTaPp58x5+phXUy/BmFyZmL5A7+ X-Received: by 10.157.57.134 with SMTP id y6mr7131311otb.94.1471672302682; Fri, 19 Aug 2016 22:51:42 -0700 (PDT) Received: from localhost ([2602:306:3406:6500:b409:62b0:b7f7:75f0]) by smtp.gmail.com with ESMTPSA id d45sm5863038ote.12.2016.08.19.22.51.41 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 19 Aug 2016 22:51:42 -0700 (PDT) From: Andy Gross To: linux-arm-kernel@lists.infradead.org Cc: linux-arm-msm@vger.kernel.org, Will Deacon , Catalin Marinas , Srinivas Kandagatla , Stephen Boyd , stanimir.varbanov@linaro.org, linux-kernel@vger.kernel.org, patches@linaro.org, Bjorn Andersson , Andy Gross Subject: [PATCH 1/2] arm64: kernel: Add SMC Session ID to results Date: Sat, 20 Aug 2016 00:51:13 -0500 Message-Id: <1471672274-19317-2-git-send-email-andy.gross@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471672274-19317-1-git-send-email-andy.gross@linaro.org> References: <1471672274-19317-1-git-send-email-andy.gross@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds the SMC Session ID to the results passed back from SMC calls. The Qualcomm SMC implementation provides for interrupted SMC functions. When this occurs, the SMC call will return a session ID that is required to be used when resuming the interrupted SMC call. Signed-off-by: Andy Gross Tested-by: Bjorn Andersson --- arch/arm64/kernel/asm-offsets.c | 1 + arch/arm64/kernel/smccc-call.S | 1 + include/linux/arm-smccc.h | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c index 05070b7..ff38c58 100644 --- a/arch/arm64/kernel/asm-offsets.c +++ b/arch/arm64/kernel/asm-offsets.c @@ -141,6 +141,7 @@ int main(void) #endif DEFINE(ARM_SMCCC_RES_X0_OFFS, offsetof(struct arm_smccc_res, a0)); DEFINE(ARM_SMCCC_RES_X2_OFFS, offsetof(struct arm_smccc_res, a2)); + DEFINE(ARM_SMCCC_RES_X6_OFFS, offsetof(struct arm_smccc_res, a6)); BLANK(); DEFINE(HIBERN_PBE_ORIG, offsetof(struct pbe, orig_address)); DEFINE(HIBERN_PBE_ADDR, offsetof(struct pbe, address)); diff --git a/arch/arm64/kernel/smccc-call.S b/arch/arm64/kernel/smccc-call.S index ae0496f..278dc9a 100644 --- a/arch/arm64/kernel/smccc-call.S +++ b/arch/arm64/kernel/smccc-call.S @@ -20,6 +20,7 @@ ldr x4, [sp] stp x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS] stp x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS] + str x6, [x4, #ARM_SMCCC_RES_X6_OFFS] ret .cfi_endproc .endm diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index b5abfda..82d919f 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -63,18 +63,20 @@ /** * struct arm_smccc_res - Result from SMC/HVC call * @a0-a3 result values from registers 0 to 3 + * @a6 Session ID register (optional) */ struct arm_smccc_res { unsigned long a0; unsigned long a1; unsigned long a2; unsigned long a3; + unsigned long a6; }; /** * arm_smccc_smc() - make SMC calls * @a0-a7: arguments passed in registers 0 to 7 - * @res: result values from registers 0 to 3 + * @res: result values from registers 0 to 3 and optional register 6 * * This function is used to make SMC calls following SMC Calling Convention. * The content of the supplied param are copied to registers 0 to 7 prior