From patchwork Thu May 14 08:21:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 11548229 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1FE8C913 for ; Thu, 14 May 2020 08:22:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F133620767 for ; Thu, 14 May 2020 08:22:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ILxu2Gk9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PFa9LEYz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F133620767 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=cN8lGdw0klK0XSrqOev6ptO3WnFv2Ldoc89nDtOVO7A=; b=ILx u2Gk9cWvdV0L4yKV8kiPA3kxq7D4tiY7BNmbDG64XQ0TKJfU6R+Tm+tUgAXLK10c865ZRSg5mW8eb CeIEEWI5tT4KpY8rf8VDbqUEVZbc0EiKBSMtA8yHBRmlbgad2dZQq1z9DRn2ew/No+b+u6DRbimuG EORVdAjoCJybIKfH4dygp0YOpvqg42U6w3U0gmFaRB1lrlreIwly3bXpKX6n0huran0IhrEkFv+HC K6i5oSLaStuhhBMWRoBU2Zwlc5tmwnp/7svsLGGc/NYpX3kvPfyDwUh3FVkO0MrDaoCnKpqIPjFjh 0j35qlfwqHq/77g2dQYOXQS9ZLqfPog==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZ98C-0005Hp-Go; Thu, 14 May 2020 08:22:16 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZ98A-0005Gm-Az for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2020 08:22:15 +0000 Received: by mail-wr1-x442.google.com with SMTP id v12so2650152wrp.12 for ; Thu, 14 May 2020 01:22:12 -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; bh=qdWmA1Euy8ZG30FI7AUlbvFYtFSjIbnys+8nxgEJbhg=; b=PFa9LEYzjwWMWmcWtxzDu0fdq/K+5YMclCSXA64Rlr9wUvrZBZ/9M0Qb4+G+g+R3x2 funKlEv/81De8p6hoqZ3C3Mp6mO8xxpd5qSRdl5a/M+eRdY21v25CSDE7E9Od/hZRrd8 NBuC3HaS9FIXoFWk4+YW6hfGd8hGWuWGZ25BhmJM9uTsJRmvlYJ0H7q0e9fzq+s1mlq0 ovec4GfMY3KggkqZlGxoVqudk53Il3emE9lMn22vHRRGjaDXDoQPKYiIFY62zuo3YRRz yI+/47qBFaVlJqYfu3PgkPwcgU/ZGxs22UbhoIAV/vN03Hn2EJouCZj8xIzPFSFy5FSe ZhzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qdWmA1Euy8ZG30FI7AUlbvFYtFSjIbnys+8nxgEJbhg=; b=Oa8INZ2yY3WIdF1V3h+t6tXcpfaa9xFsmVtFjCb7MOhtILt6vTAMXBdPTRj31JbxH0 rtfCUnmcfoSjjkVfeuA6NtsoExoisAScetJPjN1Po/aZuxZ1/BYP8zotRX4V6hopPs/3 PL0S1erE88y7qOtjqGAl0KPrq8i57x4fvpsHTJnw9CuhKNvgjK1Orbq7S/h2AIJkI+KU nZkH4jWKLhN+jIICVA3inVQq/1np1XX5WYF8n+6+WnLtzRcDfFpKF5v9hh26HKvPJc8D e9BVLv/EmQ1BOEkqiQ25AmI0xs/6wi7GoUcg5E0gIqJjcDXfSG5Bk+n07Yu7Cxu9/zou Xknw== X-Gm-Message-State: AOAM533BhwFbMKUUiXxSFMJKXfI8S00MUwZQigaAfV1g+8nprO8VDK6f uCdFnE5dO76U8SlgOjUbfUtwd/Q/f3dSCA== X-Google-Smtp-Source: ABdhPJx+f1wrdNofwBzUEfjZS+B2S5ZwBh/K69NL9NfijqNi/OpJXubq5S/Uj8dTwz4ehytw0AUy2g== X-Received: by 2002:a5d:4dc9:: with SMTP id f9mr3974180wru.407.1589444531787; Thu, 14 May 2020 01:22:11 -0700 (PDT) Received: from lmecxl0524.lme.st.com (2a01cb058702ff00bc4b798f4f30d41e.ipv6.abo.wanadoo.fr. [2a01:cb05:8702:ff00:bc4b:798f:4f30:d41e]) by smtp.gmail.com with ESMTPSA id l18sm9170002wmj.22.2020.05.14.01.22.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 May 2020 01:22:11 -0700 (PDT) From: Etienne Carriere To: linux-kernel@vger.kernel.org Subject: [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2 Date: Thu, 14 May 2020 10:21:08 +0200 Message-Id: <20200514082109.27573-1-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_012214_375144_278A15D1 X-CRM114-Status: UNSURE ( 8.80 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, lorenzo.pieralisi@arm.com, maz@kernel.org, steven.price@arm.com, alexios.zavras@intel.com, tglx@linutronix.de, etienne.carriere@linaro.org, will@kernel.org, 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 Define identifier value reported by secure firmware when its supports Arm SMCCC specification v1.2. Signed-off-by: Etienne Carriere --- include/linux/arm-smccc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index 59494df0f55b..1cf221f3f07a 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -56,6 +56,7 @@ #define ARM_SMCCC_VERSION_1_0 0x10000 #define ARM_SMCCC_VERSION_1_1 0x10001 +#define ARM_SMCCC_VERSION_1_2 0x10002 #define ARM_SMCCC_VERSION_FUNC_ID \ ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ From patchwork Thu May 14 08:21:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 11548231 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DECB6912 for ; Thu, 14 May 2020 08:22:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9E8A6206B6 for ; Thu, 14 May 2020 08:22:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZW2YgmI/"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Im8mUJ2e" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E8A6206B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=GnBCrQora9IriRhlHzoNPeGNtje4UxwT9Mpi9wwJbuo=; b=ZW2YgmI/zmV2m+7n/3JIvWck1W Hoqxw9Gp0ChNVon+G3S4W4bFG3sxY0VBW2y0AUDJQYs0YktesPVady98n2rpv6ZD7m/XunmMkhIwq Il+VZ7/SWro2LEd6T0kFhFnfxup7Pf+aW7UtUgPioU8v5ra1ht1vk5nIvpQYqrptqLwUJqkWzLTNq uC6xlUWS/UpIoQR5aR3ix7Nw7I23/djCX6NFVUvhwjMcJFEaZY++y0lNhmvT4rB9bcijRQwlcsKAf mmIQHdLwHubQlgVIIgXNVveqHhFsIJLHlnGhtAFZF04Y+pnG8JWoy0VJOUSPAnWcAQX33SQPIIPBp wLTpIg3A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZ98M-0005R5-B1; Thu, 14 May 2020 08:22:26 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZ98A-0005H1-QJ for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2020 08:22:16 +0000 Received: by mail-wr1-x441.google.com with SMTP id i15so2649449wrx.10 for ; Thu, 14 May 2020 01:22:13 -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=k8mN2LzDGdESlrPmoeh28g5LnWiU2ms8gKIo8DdwscE=; b=Im8mUJ2eggAAkZI/v80HzLPX9qqa36sDqko1J2LXPgGJ01bIFxWXlgiIUUXNItclyq YJlRxzQgOkAf/kpLwuBYUf5dtc+m0h2EEcAuX1bb4AUAkdTlnA29b+TMMrpi1fdeq+ma TxjSHAWmQy1WhQjz7iwmbrnUQL6tqPSO239Q9Abu4vr88QoBJRj1WB0mRCOoy2qFREeh xr2nuf1+hw65YDQL5CYVPpz6MXv+QWERLPpjdItghoMqKAp3d426gVFkWMtd315hgG1R 4W5ayj35Q36DvrMwuQvCWWtefd4e28AsudKQBxPJ/kSU4emTzmR3iLPDU0tJJeuYDjH9 +M9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=k8mN2LzDGdESlrPmoeh28g5LnWiU2ms8gKIo8DdwscE=; b=b7wu26JdhbG6EgDNV7OBfzl5R6avWj1lc+6L5rnMgE+DhLLQKGvkjhZOQ9q/xFzcGQ n7zX6dUZzClMhUMa3nA5qecR2WIYl/jr8VemXaERJQ2mc9TRUYEGwv42Z0o1cZWFPjeW 5xJvfcLFWvu6rWjho30lJ22igwd8MxdDsJv4sXm9JNl0xbzxxdmlocZzVxZkHRsDqUPX 1hpjJFu0rjmQsP+oxGbCZ5nl5E6FG0qDfpzUxbN8MzSGFvyEdrODpLl9jdsuvCI+pcJS sQSjvMOb8qIkc7kiyihAlU/axU63TOimh6j03+rU4H+7UU1PKz84eop4CTSVNz98le3n wh7w== X-Gm-Message-State: AOAM531I9R1gLCOh9cwTw2D9OOGe/okfV55hji6EpkhHvwzVF8d1VNS7 2JC7mmlm4DGeE4r01JaEh5LBaA== X-Google-Smtp-Source: ABdhPJxIKdKece7W45CJ1lsjnCRxxcI5n5xTf/PCcBjsJUpQs1DS6rnRmslbg7l2wJ6hCwF2p0o++w== X-Received: by 2002:a05:6000:85:: with SMTP id m5mr3753246wrx.281.1589444532801; Thu, 14 May 2020 01:22:12 -0700 (PDT) Received: from lmecxl0524.lme.st.com (2a01cb058702ff00bc4b798f4f30d41e.ipv6.abo.wanadoo.fr. [2a01:cb05:8702:ff00:bc4b:798f:4f30:d41e]) by smtp.gmail.com with ESMTPSA id l18sm9170002wmj.22.2020.05.14.01.22.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 May 2020 01:22:12 -0700 (PDT) From: Etienne Carriere To: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] firmware: psci: support SMCCC v1.2 for SMCCC conduit Date: Thu, 14 May 2020 10:21:09 +0200 Message-Id: <20200514082109.27573-2-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200514082109.27573-1-etienne.carriere@linaro.org> References: <20200514082109.27573-1-etienne.carriere@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_012214_847268_2E566C63 X-CRM114-Status: GOOD ( 12.82 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, lorenzo.pieralisi@arm.com, maz@kernel.org, steven.price@arm.com, alexios.zavras@intel.com, tglx@linutronix.de, etienne.carriere@linaro.org, will@kernel.org, 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 Update PSCI driver to support SMCCC v1.2 reported by secure firmware and indirectly make SMCCC conduit properly set when so. TF-A release v2.3 implements and reports SMCCC v1.2 since commit [1]. Link: [1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=e34cc0cedca6e229847c232fe58d37fad2610ce9 Signed-off-by: Etienne Carriere --- drivers/firmware/psci/psci.c | 14 ++++++++++---- include/linux/psci.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index 2937d44b5df4..80cf73bea4b0 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -409,11 +409,17 @@ static void __init psci_init_smccc(void) feature = psci_features(ARM_SMCCC_VERSION_FUNC_ID); if (feature != PSCI_RET_NOT_SUPPORTED) { - u32 ret; - ret = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0); - if (ret == ARM_SMCCC_VERSION_1_1) { + ver = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0); + + switch (ver) { + case ARM_SMCCC_VERSION_1_1: psci_ops.smccc_version = SMCCC_VERSION_1_1; - ver = ret; + break; + case ARM_SMCCC_VERSION_1_2: + psci_ops.smccc_version = SMCCC_VERSION_1_2; + break; + default: + break; } } diff --git a/include/linux/psci.h b/include/linux/psci.h index a67712b73b6c..c7d99b7f34ed 100644 --- a/include/linux/psci.h +++ b/include/linux/psci.h @@ -24,6 +24,7 @@ bool psci_has_osi_support(void); enum smccc_version { SMCCC_VERSION_1_0, SMCCC_VERSION_1_1, + SMCCC_VERSION_1_2, }; struct psci_operations {