From patchwork Fri Mar 9 09:06:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 10270129 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 57C4360211 for ; Fri, 9 Mar 2018 09:13:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5344329DA0 for ; Fri, 9 Mar 2018 09:13:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47C6629DA2; Fri, 9 Mar 2018 09:13:51 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CA4CA29DA0 for ; Fri, 9 Mar 2018 09:13:50 +0000 (UTC) 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=qCeVvOJc8QKPqChWEfjB1AxguqgaLjLoEPICr3Fe9sU=; b=ubxGOPlDzY9gfPyOVqmcRODrGN NoOUCa85rFaNVpi4OzxAoKy0sNMj8aWatrUtGPiC2N/9QT8NKgWCBVgXR+4htfPtuPe/92GXSoCl7 4TygFV75nlfX/MGL0yurLa1ntJ1jGUIRdsoFtD+B11KoSE6f9vmqeD8Xwrnxep0TJ6czEwGFE3Nne PY+lkOjChHaBZNW7LIhPJrdVI8misjocfdd51xrx1jF3V7UgeWYmZR/md5+pniLpwJBq/+PyIRzCb QM/ktyQ9V9VizR/2rWn+HBWsEe44JM6FV1J3Ui5NDSkCmt9pGzJhud3ZJ4ZspGrgmcoeP+PlOVa2y 7eClLDLg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1euE5t-0007bV-Ie; Fri, 09 Mar 2018 09:13:41 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1euE1p-0003pH-Rl for linux-arm-kernel@lists.infradead.org; Fri, 09 Mar 2018 09:10:28 +0000 Received: by mail-pf0-x242.google.com with SMTP id d26so1053499pfn.5 for ; Fri, 09 Mar 2018 01:09:19 -0800 (PST) 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=TYFqbuH12qZWdAZxW/nHNsvIOUr1iq1L69q/E1//C3w=; b=FfCikHq/CS/Grfgey9iQTxK0f+dWQ/Wr3fx70CLtdexFZRBuCtcUKRZDSf8MUWiI8j EI+HqxezTlLBNC+aMxs2QzGjE73bvXHzcu/5ORorIfjSSwt/eNKlb8pMyn8LJRmricPO PACYamnCq7jVAI2DOlAQsvtZZZTUfAaNy9tWw= 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=TYFqbuH12qZWdAZxW/nHNsvIOUr1iq1L69q/E1//C3w=; b=eA/n+G5TFBSjCL4hALqC/majKSIbdnJ4Okbf/AZfz14PQ2Pv++t+KN7YBHWSuk9eVM LCp3J9zXWpIK2Tzrn3jbwkBykkWc/kgM87J3Cw5ijUiTO0PC4pGRrRNGygKpJQmiSE2Z M4lmTOZ48LgStIAyHdDaLxzns9ULJnTJaHFC9PFuxMvsZbGzPhlBsveC1ep1B4pBp8A4 903XyU0Va6jp81t8bNynLpViabIiNoFXRZyykjyzows6AkCdYxWCxlqqdWNmWGQbDcD0 A9JqkI0+J9PJysBoFbGJHG3qC/fLKV4f1nL/8GrObpy2+E1bQW6QrAx0MKTT4MY/IvC6 sYxA== X-Gm-Message-State: AElRT7EWZ3uR8w2YlgnXYUCPQuV/zFtJP5+/nxP1PHzLQF2gGyF5T94B Px5OMa3nKLkZpvoE2r56K+JDv8A5i0c= X-Google-Smtp-Source: AG47ELvEKGybyE55Hnl+zMqoyPe8lcKzLmBqndDXEqWzFFc/DIatRE6jSVBH32QGaCLG5tTuH8gWpw== X-Received: by 10.99.113.94 with SMTP id b30mr329979pgn.196.1520586559091; Fri, 09 Mar 2018 01:09:19 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id c7sm1961752pfg.36.2018.03.09.01.09.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 01:09:18 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , broonie@linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 11/39] drivers/firmware: Expose psci_get_version through psci_ops structure Date: Fri, 9 Mar 2018 17:06:54 +0800 Message-Id: <20180309090722.26279-12-alex.shi@linaro.org> X-Mailer: git-send-email 2.16.2.440.gc6284da In-Reply-To: <20180309090722.26279-1-alex.shi@linaro.org> References: <20180309090722.26279-1-alex.shi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180309_010930_609946_45B096D8 X-CRM114-Status: GOOD ( 13.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Shi 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 From: Will Deacon commit d68e3ba5303f upstream. Entry into recent versions of ARM Trusted Firmware will invalidate the CPU branch predictor state in order to protect against aliasing attacks. This patch exposes the PSCI "VERSION" function via psci_ops, so that it can be invoked outside of the PSCI driver where necessary. Acked-by: Lorenzo Pieralisi Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas Signed-off-by: Alex Shi --- drivers/firmware/psci.c | 2 ++ include/linux/psci.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c index ae70d2485ca1..290f8982e7b3 100644 --- a/drivers/firmware/psci.c +++ b/drivers/firmware/psci.c @@ -305,6 +305,8 @@ static void __init psci_init_migrate(void) static void __init psci_0_2_set_functions(void) { pr_info("Using standard PSCI v0.2 function IDs\n"); + psci_ops.get_version = psci_get_version; + psci_function_id[PSCI_FN_CPU_SUSPEND] = PSCI_FN_NATIVE(0_2, CPU_SUSPEND); psci_ops.cpu_suspend = psci_cpu_suspend; diff --git a/include/linux/psci.h b/include/linux/psci.h index 12c4865457ad..04b4d92c7791 100644 --- a/include/linux/psci.h +++ b/include/linux/psci.h @@ -25,6 +25,7 @@ bool psci_power_state_loses_context(u32 state); bool psci_power_state_is_valid(u32 state); struct psci_operations { + u32 (*get_version)(void); int (*cpu_suspend)(u32 state, unsigned long entry_point); int (*cpu_off)(u32 state); int (*cpu_on)(unsigned long cpuid, unsigned long entry_point);