Received: by 10.223.185.116 with SMTP id b49csp3496308wrg; Mon, 26 Feb 2018 00:35:17 -0800 (PST) X-Google-Smtp-Source: AH8x224xrpLVMAhqD3r0Yi92L7OblUZWJsBRhAktW4fd8vmJijCxvVHqQ1P/5rtYio4ktP73cavf X-Received: by 2002:a17:902:7e0d:: with SMTP id b13-v6mr9821839plm.97.1519634117645; Mon, 26 Feb 2018 00:35:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519634117; cv=none; d=google.com; s=arc-20160816; b=iqiYnd3zEHH2dZkqlmHZdSQ0Dg48/htE0+fkpjORSel6NH9tmDPaKNyNDPiTKTNJ+s DOR1c2+RPT/MFy3+RVKvMP3imqJkcaoluLbzjTMlU6Z+nTDn8SeTKBhE14yQQMniTs13 OlLIqwStHe+Y7AzDWOd9/PnUXNP49MRpcmfXmhtJnr13lEhHsH8tcAYD35E7wOWqsmL3 TOnjASIaZCdG397PXZVWNuaWgrDbovzt3cVuYJ95riiTjn8B1zgy0XilkBoW0CoFtVYS +mffesdMRgQOphMqu7ctBin3xb96OvutfOPeR3jyAdm4wLPacrVx0oEfMA9Tt6040HQ2 Y8uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=tfc0ew0kAdAAuBXUjDfVzA2fzAypIwJmE3g0LacJX+Y=; b=CGDrrJ/fSYsYzJ69hFyOXDfL2hD4hA0X30V8NrpVIj9U7CnxG/ltVurHzIHY/CZWws 2jgeHzqRN73mFzm3twKKebTm4jkCHg4jXzecNcdtjy4MRXkGwcWk+hdKzQfrvbjrEcpk 2HEzMSgZEbJAwrXtQiIrYZ8SQvtn+BDztoap0WGtZ/OE9P29wI+SUszBK2LWC0X1KzKX cuJY4epjFZBZ66ijcKA5OIzDXoII1b1M6kL+giADCMF/4Ca3G9BNAeKXdi1RtqnwUtN4 t5Bwcbhhq5kSWtA7JriggWskmIY0Wx0v9qTJ9jkxKq8Wp8u7Md/4EIuPkYgZcFGSsgS/ L4Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L+2IwLVV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4-v6si6398736plb.282.2018.02.26.00.35.03; Mon, 26 Feb 2018 00:35:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L+2IwLVV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752500AbeBZIXS (ORCPT + 99 others); Mon, 26 Feb 2018 03:23:18 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:32782 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751793AbeBZIXN (ORCPT ); Mon, 26 Feb 2018 03:23:13 -0500 Received: by mail-pg0-f65.google.com with SMTP id g12so5911627pgs.0 for ; Mon, 26 Feb 2018 00:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=tfc0ew0kAdAAuBXUjDfVzA2fzAypIwJmE3g0LacJX+Y=; b=L+2IwLVV/I7yt8ZRN0CuWj/4LYf+vmJ8g59f02fqiY49+b0GuUfXhNKTDoafP6Azh6 UhP8IGpimoCmEjxYXkayTqWT0xAb4ZkR951W2YUXAsH4IawK+usZVWoj0omgcNFotK+B uiOynSlVLLBNJIeFp+IGzlSMihP6K3s4ROlWE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=tfc0ew0kAdAAuBXUjDfVzA2fzAypIwJmE3g0LacJX+Y=; b=RsUSE1NRVXnD+7n9xl+MMiTjecyQk5CFjBpBqXTCzz4+WvWcPtKpAz+V51BsGUPYS3 8aui0eUj+oy+Dgn7I6UFlqi9RK/4OT47KC4ufVV3ts8o8bi0NVEM7Q+lqa2z6RlBgNQ8 idh+k1qcDpG17bSS0nUFzHHn0w3/kXNUd3YHNVfOb2qoUe1HwvUXGdnqSotFKn5CLGzj 1Dex1jbVWmGwkDGegX1bhN2nuO0PlR+EzXCMw4jbydFjQ9hflHzywa7oVLWCVd3wbVZ5 MOWwxa9TEiS+YFIxZziB29aivsZNQk9TSdW1lQpIZ1NpuzT6h43X3oQOl90cynr1FsVx HBlA== X-Gm-Message-State: APf1xPCZ9hVBEhMlvSNeM8AIMM2i7UeSG2IU81ZfBieIHlrwItXXEG4x 62xgsnB2t+BborCUk28lkYk9ow== X-Received: by 10.99.170.73 with SMTP id x9mr7812380pgo.393.1519633392563; Mon, 26 Feb 2018 00:23:12 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id o86sm1422706pfi.87.2018.02.26.00.23.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Feb 2018 00:23:11 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , stable@vger.kernel.org, Mark Rutland , Lorenzo Pieralisi , linux-arm-kernel@lists.infradead.org (open list:POWER STATE COORDINATION INTERFACE (PSCI)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 17/52] drivers/firmware: Expose psci_get_version through psci_ops structure Date: Mon, 26 Feb 2018 16:19:51 +0800 Message-Id: <1519633227-29832-18-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519633227-29832-1-git-send-email-alex.shi@linaro.org> References: <1519633227-29832-1-git-send-email-alex.shi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.7.4