From patchwork Thu Aug 29 11:34:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 172599 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2091974ily; Thu, 29 Aug 2019 04:35:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/xQKamzBKviiQqxbcypaK8+XYfFZMLh7TZ4UegRpe3yc29HDj1kX0JFsR5irZVBUvNoB6 X-Received: by 2002:a62:ee0e:: with SMTP id e14mr11033611pfi.31.1567078553383; Thu, 29 Aug 2019 04:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567078553; cv=none; d=google.com; s=arc-20160816; b=rnm5GtQAx2vcXim6mIU1DYLs0Zd497156R5+UPeaYsmoOzz1jU4JzylNOYRmjYxaef L8Tk7u/Vx7Qy8WdbIENKZuJbnNRyuObsJEEuoOzEJf8sdf5aO9rwOQqJpoQ/+0UIYk/B zoFAL4vGn1wlR1DubvYxAN+2U5K3b2wnS6/90cnE3+o0RAzBLTG6WdJ4JetZwQWtxg/d Jtjl61L/QC/XDOX+ZrOTukOK0CqsJOtldDSjL+JM44vb737MSdYgUSpUFyLT24kvA4Td ymCHF10b3ELFxDYIpgPKC6+4P3X6OTM+YZ3/CObSi4FeBZQ8GWak32yqKKgEeEDjZYg/ UvXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tUK8ETga6k61l9Q+/z8rY6SIV6XG+DcjRuCd/1NWAIQ=; b=N4Xrlao0PpAODSXLMhfgLtibsLRC0P07ncS2rhpyzqZdlYPrEp9Lj/j4gUxfrP1453 tOtqfKHCcOZ1wgsJsYa91WrNFtN3B7tVlva3Gy0jUG2kDe1ImtgCy376XHNm19iXmVOi rzWvU//qeM6ZUaC2YK0HZz1Si4K5yXUlIFx/fnuKXjZqscZorYiID6B7yavv06NxuZTC tinOxjakYw/bcm/Cqeh7hMgKKCYERlY8CKU9oJ1qIlj24ibYjz4UOEXGCQsnnOuOayUC rUZwK02bTHXDPkx6xHleW3psbbo6ARTUt+VSz2OI/raoD7rSAgMaDdBXG5SCA86//LWi XNxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EKkXXo+2; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 b30si1720301pla.299.2019.08.29.04.35.53; Thu, 29 Aug 2019 04:35:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=EKkXXo+2; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727213AbfH2Lfw (ORCPT + 14 others); Thu, 29 Aug 2019 07:35:52 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:42469 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727118AbfH2Lfw (ORCPT ); Thu, 29 Aug 2019 07:35:52 -0400 Received: by mail-pg1-f194.google.com with SMTP id p3so1436028pgb.9 for ; Thu, 29 Aug 2019 04:35:52 -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 :mime-version:content-transfer-encoding; bh=tUK8ETga6k61l9Q+/z8rY6SIV6XG+DcjRuCd/1NWAIQ=; b=EKkXXo+25/F2wHAvxwC+L41EuvRc64ZuVgzd/LPBxjuYWjUOugeBxX/JmSX8/pPuWi tcTrkn9aLyId59ixMbK5XFkaU3wK0vKNY3VK/rHHrRBg/dPSckEW+9rmjlNWuQM9Tisx 0KJ3e7msSb2P0/kZmniWPexAfGtt/YjGycG7slVs+YzEMUXsFeD2Aewrk9WB7F+DPfeI TTd0iWFy2hXN8TbqyaK53fAVy0kmnGxF83t3lGsQU142ZiTORguncJKiCnZh3bb1pSpG YnyCr7j6D258ztcvLdFikS1wRddMjD+luCPjxUZUU/kiSvqvN5wsIEBuOgsJZ320VmEd wT8g== 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:mime-version:content-transfer-encoding; bh=tUK8ETga6k61l9Q+/z8rY6SIV6XG+DcjRuCd/1NWAIQ=; b=n7wkJoQuCXaZ0LBu0eBMmXr2XSp1wGIQHsj77xjw4Wx4PoJg2UFAfmIbA0Xrr2K+8J si6KyxSPYMs3CkdDINrI4L0Fh6FTmV8BycXf/WekQ7kJqtRoq258iLVM5nWYRK4IIhHN //zhXsAoPVHQjF/I0a+7WjPsRS794u2Z6ebEMV5yfqey8fC/MXVW4+yOpMCraiYl/Yss d4jdZzyNVnHiK+YG3lKLVCkM4kT9r+Nq5ZXt7qnVqvuCWF9Q6UHUFmY9Wnf87KsnQl2b 0uubg9m8/qe5eQXjphekx2dGO7IoCkecR/cCLrqncMgb58B3ZtzD1rWXz+izMxCsaoBK iohg== X-Gm-Message-State: APjAAAVlZEjOt+gGiGUG2loQBJIfayBaabeNns86XhKfAVqHgnbP5wy2 PVLr3h+VwT4h9j5ST2CdGFnMBeMFUaI= X-Received: by 2002:a17:90b:8c1:: with SMTP id ds1mr9513477pjb.114.1567078551685; Thu, 29 Aug 2019 04:35:51 -0700 (PDT) Received: from localhost ([122.167.132.221]) by smtp.gmail.com with ESMTPSA id c199sm3767496pfb.28.2019.08.29.04.35.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Aug 2019 04:35:50 -0700 (PDT) From: Viresh Kumar To: stable@vger.kernel.org, Julien Thierry , Mark Rutland Cc: Viresh Kumar , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Marc Zyngier , Will Deacon , Russell King , Vincent Guittot , mark.brown@arm.com Subject: [PATCH ARM64 v4.4 V3 22/44] drivers/firmware: Expose psci_get_version through psci_ops structure Date: Thu, 29 Aug 2019 17:04:07 +0530 Message-Id: <116c1fadc5685b62ab36b1a368eede3f9b1bb9da.1567077734.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Will Deacon commit d68e3ba5303f7e1099f51fdcd155f5263da8569b 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: Viresh Kumar --- drivers/firmware/psci.c | 2 ++ include/linux/psci.h | 1 + 2 files changed, 3 insertions(+) -- 2.21.0.rc0.269.g1a574e7a288b 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);