From patchwork Thu Mar 1 12:53: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: 10251407 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 0ACE060211 for ; Thu, 1 Mar 2018 13:31:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE5AF212BE for ; Thu, 1 Mar 2018 13:31:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC6722223E; Thu, 1 Mar 2018 13:31:38 +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 70140212D5 for ; Thu, 1 Mar 2018 13:31:38 +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=rFaw4IBsJhyuKMHv3PHzS2RoNU4QmH+RNtQ4JCa9I4E=; b=J8/29GGHvYrohHUp2KPiG7ADXC srm6LvxWtn8kNXJEAHkIYD/YzPc8bhJacMn+x3MVOYPPXN8hBONZgXkx4p07RaqQMMzPNnopLD8gI 8RT0ECzMC0hujUeSA3Li1uqA5TMzKKzdFkt5OVDeaah59/WWxuZipsaP/Rvswi0UAzEQft4nckuIT iShlohQbg6hfwqzEERVf9cO26hcKzKtQ7DC9Sryyd0zaDTpbmKexk8MIjVw8MYiF8Ku6MurEtmQWW 1WHcgLeeQLr3wdvGU+oXQZN8dTStXAldf0IYtd/GJWKyFt6eijhxd7vk9KOsHXNtKMnZebagrjhlS 4xhERb6w==; 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 1erOIq-00046Y-KO; Thu, 01 Mar 2018 13:31:20 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1erO0X-0005gV-EB for linux-arm-kernel@bombadil.infradead.org; Thu, 01 Mar 2018 13:12:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tfc0ew0kAdAAuBXUjDfVzA2fzAypIwJmE3g0LacJX+Y=; b=Y4ycaAyvf1uaBxNXa8T0TTmwW WIUlZuzLw2yTyDYCoxX+2Vqf7u42rVWRKf6pxVDnIF/WL3ducR4XYkuVGmzz7FRa9sFdKpfhiWtnq g0Fi4qs8DnPnUVQc8Kb5y2Rj0d7ecgaAV0SRefi0SBCpH8RqZ02ZpI+Hdkyydvs6QTIcoVhTtBuTQ a09bM5ix57rNsB4o2wmyge8lDieVWlok1d2EGojQpnBkdz65a6ecmeNx+tphO7/jd8tEyAMrXHLVp kLHnZ/TZB5Wg5xe32VIkGsTsTG4MWuhsrhF6pUEkVRHPD6hYh1OMXtbm8xKEsmu8KWYXqaSJRfPfs vF7/72Oog==; Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1erNmC-00053i-Bh for linux-arm-kernel@lists.infradead.org; Thu, 01 Mar 2018 12:57:38 +0000 Received: by mail-pl0-x244.google.com with SMTP id v9-v6so3580117plp.12 for ; Thu, 01 Mar 2018 04:57:26 -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=tfc0ew0kAdAAuBXUjDfVzA2fzAypIwJmE3g0LacJX+Y=; b=K/FCKrmcqHlWnlFt2drTfmezPq8tliZx9Wb2Z1LSw+Q99Op4u61KrNuUPul8I+jcFn 6a5Mmqhp6tXl6vPDJgmmKVrWKIgEJB5w9kmkb2loIddvOoYiLXw/8/1ipWoh4qxZ7os8 FDLX+NMr/TRI+kOamuadUUE+dBIgLc8b8xa0o= 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=tfc0ew0kAdAAuBXUjDfVzA2fzAypIwJmE3g0LacJX+Y=; b=aUlW/qRmbv5wvYVv+B0PzRPkr67ABYgRnboXRDS0xOMEwV+JWEovkzfCCo5sLJeYxJ IMXDFtrjcopdEDR2CCpCbd2DapIrllJqSrnKcyTHcw2VcWeLnlx6Y97gxn8SJU6bjAZM W//LVNR9+pwwH81b2oX79VLBbUNXS1PZ0/9/Jx5zPBRSBhyHkknkbOe5+wyGCejzfqgO sh0djuITuUQFZb38PureLiwt4xonIS7MnGjSzvLcLkH2GbTO7ICsGxdwuKq2SQ+GBBvW Vwo4OzUTpcQf7v1CRhPuuP8kXO7FKEkj9tplcPo0PwATw4bePhdvui/6xl8e1i9/1vxw bajg== X-Gm-Message-State: APf1xPDFPBKMod0Uhg6WpMtttl7lKexE+qLHF8QS8CpGkMEljfOgo2Kw HV+YwkbhB2wAQx6nExLyzUHAKw== X-Google-Smtp-Source: AG47ELvBMqsugVSgNzxqtFdYFVZBMrcoO8rEho8D8R5AJcGI6d4vcgv1upSD0WrwJXDMqxH4zw8tpg== X-Received: by 2002:a17:902:9882:: with SMTP id s2-v6mr1910969plp.196.1519909044733; Thu, 01 Mar 2018 04:57:24 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id x4sm2289655pfb.46.2018.03.01.04.57.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Mar 2018 04:57:24 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/45] drivers/firmware: Expose psci_get_version through psci_ops structure Date: Thu, 1 Mar 2018 20:53:54 +0800 Message-Id: <1519908862-11425-18-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519908862-11425-1-git-send-email-alex.shi@linaro.org> References: <1519908862-11425-1-git-send-email-alex.shi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180301_125736_386840_384018A6 X-CRM114-Status: GOOD ( 13.67 ) 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 8263429..9a3ce76 100644 --- a/drivers/firmware/psci.c +++ b/drivers/firmware/psci.c @@ -496,6 +496,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 bdea1cb..6306ab1 100644 --- a/include/linux/psci.h +++ b/include/linux/psci.h @@ -26,6 +26,7 @@ int psci_cpu_init_idle(unsigned int cpu); int psci_cpu_suspend_enter(unsigned long index); 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);