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: 74351 Delivered-To: patches@linaro.org Received: by 10.140.29.52 with SMTP id a49csp627185qga; Fri, 19 Aug 2016 22:51:42 -0700 (PDT) X-Received: by 10.157.19.9 with SMTP id f9mr7249254ote.174.1471672302914; Fri, 19 Aug 2016 22:51:42 -0700 (PDT) Return-Path: Received: from mail-oi0-x236.google.com (mail-oi0-x236.google.com. [2607:f8b0:4003:c06::236]) by mx.google.com with ESMTPS id p14si5744737otb.198.2016.08.19.22.51.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Aug 2016 22:51:42 -0700 (PDT) Received-SPF: pass (google.com: domain of andy.gross@linaro.org designates 2607:f8b0:4003:c06::236 as permitted sender) client-ip=2607:f8b0:4003:c06::236; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of andy.gross@linaro.org designates 2607:f8b0:4003:c06::236 as permitted sender) smtp.mailfrom=andy.gross@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-oi0-x236.google.com with SMTP id l203so90434721oib.1 for ; Fri, 19 Aug 2016 22:51:42 -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=mG/JRR9AysUlRTjdI41lgUWztFCLKHZtxEX9+eMbmfsyesfwRK1KK5u7SK7NOSix+a euKj4Op+cqv0PzbTzvnYUsdqvO/TwEmTmatfkqJlPvay6GKVZdFUdZvZAXmiMTx3GQ/W q7Xfw2kigRIPxMeGWtSw9OJldAtSjRgiuYfjlK/okjsB6QmsGHw0GgUwU33ntkofAyII 6g9pdmfEXuNF/EJtCY0pnp30p7h0wWOEQi5bjVQrqxCJbB8SWnwx+btZj0I+5GLzYUFh B2fvnf8a4rvPjq1vBHpgqNYwm4w/lUp4RAATQfz10hFP2R43KXh4F75fB8w3SnDTOMS8 FAgw== X-Gm-Message-State: AEkoousO7TlzoveBhv4xUe/isVDFqziTbV0/F/0l2Q38kjL7uolUW5aR2F8mwFDTntNsMjf6U/4= X-Received: by 10.157.57.134 with SMTP id y6mr7131311otb.94.1471672302682; Fri, 19 Aug 2016 22:51:42 -0700 (PDT) Return-Path: 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> 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 --- 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(-) -- 1.9.1 Tested-by: Bjorn Andersson 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