From patchwork Fri Jun 14 03:07:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 166752 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1505579ilk; Thu, 13 Jun 2019 20:12:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvGzM/NMS6iRKa77W4xN7BSRhpwTYaWllASvK4jh+RXC8LBft09vsUJYkBqx7VgGfdIU+N X-Received: by 2002:a17:90a:258b:: with SMTP id k11mr8359683pje.110.1560481952739; Thu, 13 Jun 2019 20:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560481952; cv=none; d=google.com; s=arc-20160816; b=gcfk+d97axXUOEgECiXv42d3W3PjQtq5vpAvF2+izutA/z8rIac+NQJO+EC95/sGEE q1FEYP+zbYrUw8ZDx+g1q7uTtcMIJBIt/l2rgVH5rfJtidCqKPYboCKWTAdMJEeGWvaG ScQzL7gd1N+Xqi2Z2XB8dJbEISSFS3kfzt7BzrW9Y9zcMMNQcWa7MB0nD3v9rjwq4G8x Mg173+BvG+TirIrJPZI21MuU+ESucu8xhKu9QNsb/0P+45FmPSoFInfaqbq4uXl6iR1Y 1t3Wu8PJu2klW8eL4ZsTpdSavcVQ6Tm9JFBXGJTKUozTyGBP3bBnt2CjA5L20Dl72LxM qf2g== 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=qKzHA8G+2fQoe2G4Jof4Q8AMaOl1uqaCaXjxkghjmK7Cakksya32MorIuS3jsKuOHW gTDr4Dxbk+eIptto+3a3jNX2I7kWPe7p3tsgoGVvh3xq5yAFyFZ+z4nR5qwNWhvMdQrG vo23SHRWyEXSFpapaXDJ6SKpB/eXl+lRuQdSU0D+W/isn4WVbbNCpaUXAHYQC3jrKmQY JXgQOtXh4VyK3O1i75HegRPi4Gns0+swQ1hGFVFoPTi0Wa1oscQMyMbHZtJtnhPlndRO 6Vr8LZ7IOWRVgUsI5+nnwk50xXujS6LH3CqoZZVqQeLrSXe9ZfzthrSHJ2BRrrHsNfAH tnSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G2wmSB0w; 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 e8si1073936plb.420.2019.06.13.20.12.32; Thu, 13 Jun 2019 20:12:32 -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=G2wmSB0w; 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 S1726429AbfFNDMc (ORCPT + 14 others); Thu, 13 Jun 2019 23:12:32 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:41526 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725819AbfFNDMc (ORCPT ); Thu, 13 Jun 2019 23:12:32 -0400 Received: by mail-pl1-f196.google.com with SMTP id s24so372145plr.8 for ; Thu, 13 Jun 2019 20:12:31 -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=G2wmSB0wl3ZSst3wBKM0lmkGVB3EAHRbdwUzF55iA5Zc7PyVUPSzOlglM3cYPWwRdH kG5s+Oc45ZUBoFc7mYCpXBsXAu5XGmy/7ktcJKN5fvs5gGGo+RUG59zBtu0U0c7OD1G5 rCdw3QRLYuHQN2CR2z5SNEW280SeN+8hmo3JnWq17WmQ0XAbAnBQB+8kSzeiv2GOos6N i3DZfvNnVkzqtXL9ayx0CfRlKWcSGFcOx2QhOmHPWcoJi1efyzQBp+8/rbWneAGyAo7p 6b75570FcqLite+nlTb86LYO3NmyJ9+l6P9/g2w84R7+Ws1R4y+j1181T/YYXzDR4xsa qF2w== 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=rFT4DWeanzrXN6Ghm8M0Y4Ne7Lw35GQxAVDj5ZqeqC5QlMSBi0Un+k30Pt8Cai/LMv XjAbOm63q0ruZ34vtm4hWqDl7Mfbs6WPYtXt39jMFB5bT9JT/mXlnWKfszUlUQoQjXif 2sLng9nRRnMMzbO3/OUzsopi35+sH44HQ83hnC9+CPBN2+HdDdhXavPpAKUalBonVhYX JhCG0Bc3PTNqVIcDPpMGAAwBlWlUOOcnw1gYdFyt77BZwGU5R+hbQlkhbY7PTqedxQ11 XonOhV+h00A2XjzPDmB2A193eR4XekrgIh0ykaxH1UAx7efwtmOHbJC/SIXpb0UtATrA uBNw== X-Gm-Message-State: APjAAAUVFiHnTvjGKjGWPSau1J7rT4+OWWuWcBh29kyAf2lYZbAfB+bA EgJi19+rAvmxoqUe/qjl/faqRA== X-Received: by 2002:a17:902:522:: with SMTP id 31mr86143113plf.296.1560481951066; Thu, 13 Jun 2019 20:12:31 -0700 (PDT) Received: from localhost ([122.172.66.84]) by smtp.gmail.com with ESMTPSA id p68sm1036348pfb.80.2019.06.13.20.12.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 20:12:30 -0700 (PDT) From: Viresh Kumar To: linux-arm-kernel@lists.infradead.org, Julien Thierry Cc: Viresh Kumar , stable@vger.kernel.org, Catalin Marinas , Marc Zyngier , Mark Rutland , Will Deacon , Russell King , Vincent Guittot , mark.brown@arm.com Subject: [PATCH v4.4 14/45] drivers/firmware: Expose psci_get_version through psci_ops structure Date: Fri, 14 Jun 2019 08:37:57 +0530 Message-Id: <5f5b6ed2828ebd885fa4bc8e764483d81f419bc5.1560480942.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);