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: 9291597 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 D9132607FF for ; Sat, 20 Aug 2016 05:55:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6A5029287 for ; Sat, 20 Aug 2016 05:55:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB17A293C6; Sat, 20 Aug 2016 05:55:26 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 7BC1F29287 for ; Sat, 20 Aug 2016 05:55:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bazCo-0003XK-L6; Sat, 20 Aug 2016 05:52:30 +0000 Received: from mail-oi0-x22a.google.com ([2607:f8b0:4003:c06::22a]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bazCN-0003U3-OD for linux-arm-kernel@lists.infradead.org; Sat, 20 Aug 2016 05:52:04 +0000 Received: by mail-oi0-x22a.google.com with SMTP id f189so90243257oig.3 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=VUovqbZ8LFIsnVRDaEp3dP3qucEB4DW46iaCH+Kc/sHDJPqWtVnIBNKcaLEFDs1q1A 5Nn+9DGsXKxyjh0iBky/ZpPL8kREUQYHONNS2ae5YqoUUsRowVOKoOjgfGNHUyuDrz/J 7neyxbun4M4l3zEYF7o+b3aw5BiAk6sXrrfqiV0pGKtRngGjjPeu8Cm7s+VqD+yOLXWf eie2cNtWS63IoiGxKKemnaaNo0sfskSRs5/yBuRd9iQKO4o9VxsZ1vbi3FbhNq9oV0dS Jy/nhqvmmJYAVKtM1rNyeNZrXwpPgmKA3El138BIvACWJRPyCrTtBu1twJR7bEG9bClZ cKOA== X-Gm-Message-State: AEkoouvn4Q7NsyxL2rlq+2NQWJ1R3t/e5hCHB6sKluoS09vBSIobMKVN3hE0c3LD5ftL1/1g 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160819_225203_868267_3D25A98F X-CRM114-Status: GOOD ( 12.54 ) 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: patches@linaro.org, linux-arm-msm@vger.kernel.org, Will Deacon , stanimir.varbanov@linaro.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla , Catalin Marinas , Andy Gross , Bjorn Andersson , Stephen Boyd MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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