Received: by 10.223.185.116 with SMTP id b49csp7392836wrg; Thu, 1 Mar 2018 04:58:54 -0800 (PST) X-Google-Smtp-Source: AG47ELsrQQtr0IBdpYzOTz9PIFam6ECQds+Xmnrtrah6qeSpf6gCMHgPuUoIQbOKb8sgkc+F+wpS X-Received: by 2002:a17:902:e83:: with SMTP id 3-v6mr1876949plx.158.1519909134801; Thu, 01 Mar 2018 04:58:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519909134; cv=none; d=google.com; s=arc-20160816; b=MM/gzEuF7FuOvvGeE7d7kZ4Zh/4wcWL76JJRaa/BQwySKaE2NuqSmI+PpoAGAnk7+8 0gxo8czYavv5jvk6hIFNBch5rxDQEvonVz4ag2vyGUpSDsS/YicLwZUs4LMfCfUemcPT 4l73f2npi/6n7jpfyC+j3PDPmaclipZOi4lRMQk0l94djq/nG5wLfRr15g2KlfppVUYE 6D6fa8N6Z3fomNTHfXK0+gzcsF4tYsTwpRnIPDdd9zm77Dx3oRNQVsviRHY4PLvZOs13 y0Fu8ACPXnapLNstmSXhuvRac/cPqRl7OFVs/G0Z96toQpd8Fmt8x5KFAaN+cTcZ+TME +D3w== 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:cc:to:from:dkim-signature:arc-authentication-results; bh=tfc0ew0kAdAAuBXUjDfVzA2fzAypIwJmE3g0LacJX+Y=; b=K7q6BfB5dBksf8D1QVtCqyO3fy3wX4GiML1ulnp32jXOCZTh869thlaHa3ntjYGTJO go2YAlclRYySasnsbMeOoVMwUv6bW3O0SzWR0HoPJvJSWTbkwujvc/l+my46YN/vkBsk D/2xbv5EKC669Hf49Pb9Z0FPimSPqDJW30SwOe7tHYUZdUFqvgvjdbPC+dY2hF651+HW gqh4NTV1wf9zfICJXx5VYcrJsMWAtlNv4/RCDSVr8wozZZ1ATG5XsPaBHXWAo0YUdcpO B3TK9B67TRvf4wJrTZUmS+xXdplp8nlFA4e/FJp02Wsn5OrH64ve4/m6yurO2Cb9sPYH AkWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K/FCKrmc; 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 m13si2383531pgd.641.2018.03.01.04.58.40; Thu, 01 Mar 2018 04:58:54 -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=K/FCKrmc; 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 S1030866AbeCAM53 (ORCPT + 99 others); Thu, 1 Mar 2018 07:57:29 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:38008 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030790AbeCAM5Z (ORCPT ); Thu, 1 Mar 2018 07:57:25 -0500 Received: by mail-pl0-f67.google.com with SMTP id m22-v6so71410pls.5 for ; Thu, 01 Mar 2018 04:57:25 -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=F4YeCTSRtGFWhMfuCU3PV7fSxdOHhLcD4pUh4GBQYTElIUYIExLdPXKZ89hI55+kvP +qGEnhE+sQdPTXtbf+bWQzZ6/WZca8LTB1BEhW4GCu9X4Jp5E19Dbit8jC2YABNGc/vF AriBuCPRF3YmN+EJIKJhM8rUhSMRiSsN6dS6MGo0YrV4Tzu/5wawvj/eelQJOPIl2qy7 FBvOEPHSSyP8JtszchBsPr+k6cLUZc7/MN8m4kSc32rj1ecLmiKIrBSxBJp9UoMPbcrK Gpcipj17artvdtjz0VGpFOSewElWzheVxkW09Nv0mXYtsDPVyOQL2+HFnXnO77Xl/gDg BAPw== X-Gm-Message-State: APf1xPBHOgmBEop3Vp7CPh0OuFqYqw2wS5P6HFdlMxZd7qHtiO/l4gCv QxsjrSVhkAqD1/66VQTJZy8Ejw== 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 Cc: Alex Shi 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> 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