From patchwork Mon Feb 26 08:19:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 10241485 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 7E397602DC for ; Mon, 26 Feb 2018 08:27:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67A6829D0D for ; Mon, 26 Feb 2018 08:27:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C39629D42; Mon, 26 Feb 2018 08:27:14 +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 D96BB29D33 for ; Mon, 26 Feb 2018 08:27:13 +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:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rFaw4IBsJhyuKMHv3PHzS2RoNU4QmH+RNtQ4JCa9I4E=; b=b6tuPAkGKvoY0A 6A9vcW34UGgNXwllVHb9+Brfk5iXWJ3EukAAs5VB7cIO4lIX73c0aumeDApfEwJqDJ1rLPk961Uyz 9F2EuUZBe34VTOHfFnIDJihsj3NHpn0PMecMq1bXha+1V1FgDzERgdqxwBHbgsV0nOejztwm4dSju JhGIsyOrOBLR1/IWuBuHo6aibloIzjJ+38lemHNcAg6G3I/OfGAg5x+NDJepSh60tacv6PB8EYdOy qxP0oam4rcOQAVeLJtoTYM/8opwOKDV11CD5qJUfkxHPzHp/ERZzMSQCAXzeu0o0UZwiMb5lhBipA QjmsRTP2nzVx+Gyzgkvg==; 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 1eqE7m-0004de-3c; Mon, 26 Feb 2018 08:27:06 +0000 Received: from mail-pg0-f67.google.com ([74.125.83.67]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eqE4B-0001EW-SA for linux-arm-kernel@lists.infradead.org; Mon, 26 Feb 2018 08:24:03 +0000 Received: by mail-pg0-f67.google.com with SMTP id e11so5900239pgq.12 for ; Mon, 26 Feb 2018 00:23:13 -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=fW6Taj8UsCiT+4PZ2VEIubNcJ9QTkSeuk3dyKm7P/Nc86W5e8QTlZJLY5F3HkHCrWs e1JVE2Y/zBKKM5w08WTQ8tyt7PhTiwOXJVSYE6fst+KVHldHlYwFsMtuJkkmOT9izD5E hi0fa7o0Nb5A/FITvk3e7HMiXzC4kNuxpVtOQ89CrIjUM6pKMztmGQTpshUqRUR7ULfJ 0wj/mzKobt5O18C0AvSMd3yxjOxtzBTqvRis2XxFsNfEpD/yLMpXHg12Sbv8PtbhtR0r pvnvKfeMe7LMqu+yeYGu+4knyqd9XBuXl+tYJixghE0TgMD9YmRWgTiKMtS04Yaqfo++ X7Ew== X-Gm-Message-State: APf1xPCKHAlDEseZ+Vw8BsrPx3s8Hpka78DDLNa0Fs1UvGGDltZ9WspB pybLPxs3YZCu/oRfd8zlsMisPQ== X-Google-Smtp-Source: AH8x225w45emhMQsQfhEt+GkVCTXs31wTps36odkn0QmvtPN9e+G4fkFsZIsFt73V0xx8Y+mHY+hbQ== 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180226_002324_569958_C95B5215 X-CRM114-Status: GOOD ( 12.44 ) 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: , 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);