From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:47064 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbeBDLgk (ORCPT ); Sun, 4 Feb 2018 06:36:40 -0500 Subject: Patch "powerpc/64s: Allow control of RFI flush via debugfs" has been added to the 4.9-stable tree To: mpe@ellerman.id.au, gregkh@linuxfoundation.org, npiggin@gmail.com Cc: , From: Date: Sun, 04 Feb 2018 12:08:36 +0100 Message-ID: <1517742516157174@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled powerpc/64s: Allow control of RFI flush via debugfs to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: powerpc-64s-allow-control-of-rfi-flush-via-debugfs.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 236003e6b5443c45c18e613d2b0d776a9f87540e Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Tue, 16 Jan 2018 22:17:18 +1100 Subject: powerpc/64s: Allow control of RFI flush via debugfs From: Michael Ellerman commit 236003e6b5443c45c18e613d2b0d776a9f87540e upstream. Expose the state of the RFI flush (enabled/disabled) via debugfs, and allow it to be enabled/disabled at runtime. eg: $ cat /sys/kernel/debug/powerpc/rfi_flush 1 $ echo 0 > /sys/kernel/debug/powerpc/rfi_flush $ cat /sys/kernel/debug/powerpc/rfi_flush 0 Signed-off-by: Michael Ellerman Reviewed-by: Nicholas Piggin Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/setup_64.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -779,6 +780,35 @@ void __init setup_rfi_flush(enum l1d_flu rfi_flush_enable(enable); } +#ifdef CONFIG_DEBUG_FS +static int rfi_flush_set(void *data, u64 val) +{ + if (val == 1) + rfi_flush_enable(true); + else if (val == 0) + rfi_flush_enable(false); + else + return -EINVAL; + + return 0; +} + +static int rfi_flush_get(void *data, u64 *val) +{ + *val = rfi_flush ? 1 : 0; + return 0; +} + +DEFINE_SIMPLE_ATTRIBUTE(fops_rfi_flush, rfi_flush_get, rfi_flush_set, "%llu\n"); + +static __init int rfi_flush_debugfs_init(void) +{ + debugfs_create_file("rfi_flush", 0600, powerpc_debugfs_root, NULL, &fops_rfi_flush); + return 0; +} +device_initcall(rfi_flush_debugfs_init); +#endif + ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf) { if (rfi_flush) Patches currently in stable-queue which might be from mpe@ellerman.id.au are queue-4.9/powerpc-64-add-macros-for-annotating-the-destination-of-rfid-hrfid.patch queue-4.9/powerpc-pseries-add-h_get_cpu_characteristics-flags-wrapper.patch queue-4.9/powerpc-64s-allow-control-of-rfi-flush-via-debugfs.patch queue-4.9/powerpc-powernv-check-device-tree-for-rfi-flush-settings.patch queue-4.9/powerpc-64s-convert-slb_miss_common-to-use-rfi_to_user-kernel.patch queue-4.9/powerpc-64s-support-disabling-rfi-flush-with-no_rfi_flush-and-nopti.patch queue-4.9/powerpc-64-convert-the-syscall-exit-path-to-use-rfi_to_user-kernel.patch queue-4.9/powerpc-64s-add-support-for-rfi-flush-of-l1-d-cache.patch queue-4.9/powerpc-pseries-query-hypervisor-for-rfi-flush-settings.patch queue-4.9/powerpc-64-convert-fast_exception_return-to-use-rfi_to_user-kernel.patch queue-4.9/powerpc-64s-wire-up-cpu_show_meltdown.patch