Received: by 10.223.176.5 with SMTP id f5csp687008wra; Fri, 9 Feb 2018 05:42:29 -0800 (PST) X-Google-Smtp-Source: AH8x224K+sOF+h+gZwlzwh7wS4gfdTfgb4oO0622XLyBgfG485p2ViI0XfZ/Ft511VYkdrGp1fXt X-Received: by 10.98.67.138 with SMTP id l10mr2920736pfi.72.1518183749666; Fri, 09 Feb 2018 05:42:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518183749; cv=none; d=google.com; s=arc-20160816; b=CtsrcUJPRjQudJ5TN5z6ty2N6+EcgmwQ3jjw2nBwWuDSwu0VKF4quRHr3vBF0tFKyd l3t8tPhQErteVCv6GxBGCdk0jnf00odlyFnYhFoe/6xv48G9dnA3PH13MR+dH5rjB+Hw wYl/ppddPvfxCZLboXlq2Xk0DxCJ0NGQNfTJ8dj14kKJecwV05my5VIxVRRTk3EGbiom LUAgi6mfsuMLrsuQPH9aT4+Sx+zWAPFdCcrQiy9728KIo4MhLFI+9jtzKfYTz6DFe1RH HSHReCEXrnifIi6aAihpnthahGD+ZQ6xVwodlRlbRPu6i8SxlT/m2eqlB5cov51djkHb 83HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=H14H2CubR0bPuBMq72GJ52J+ihrYB+OAwW65FO2nkzE=; b=l435awK4giqdWabPMZfHFLJPISpmzUvBjzHPSPkhlHzELaZlRA02xf/GXn6xpXVg0r suRGzZcC5emUg5IcuxqW6sJAthiirlzdoe9l16m38JFx8CmfXuYv9/Ux4eUEKSn8fE6R LQYZdH+pFgoLDqRkaFbhLBVmAiMd4tne8H36GD+Db3aLZgK3iwB2HZgWx9/LvwEiRSou jelmLX0cBTdD7bjRIxk45XFIZr/qfc7OgZzx7bKkXE7rQDwGm99EHIMMdVVaPL3qIEW+ 7SPbgR3FEmJccMmSP9eL7FnKmdhCtzJFWwW9CQxmgxWbCrIwkeBV2kHjVbscz0X7idnn nJDA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m26-v6si1576240pli.564.2018.02.09.05.42.15; Fri, 09 Feb 2018 05:42:29 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752469AbeBINlI (ORCPT + 99 others); Fri, 9 Feb 2018 08:41:08 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:48344 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752384AbeBINlA (ORCPT ); Fri, 9 Feb 2018 08:41:00 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8394B1068; Fri, 9 Feb 2018 13:40:59 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman Subject: [PATCH 4.9 10/92] powerpc/64s: Wire up cpu_show_meltdown() Date: Fri, 9 Feb 2018 14:38:39 +0100 Message-Id: <20180209133931.991858082@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209133931.211869118@linuxfoundation.org> References: <20180209133931.211869118@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Ellerman commit fd6e440f20b1a4304553775fc55938848ff617c9 upstream. The recent commit 87590ce6e373 ("sysfs/cpu: Add vulnerability folder") added a generic folder and set of files for reporting information on CPU vulnerabilities. One of those was for meltdown: /sys/devices/system/cpu/vulnerabilities/meltdown This commit wires up that file for 64-bit Book3S powerpc. For now we default to "Vulnerable" unless the RFI flush is enabled. That may not actually be true on all hardware, further patches will refine the reporting based on the CPU/platform etc. But for now we default to being pessimists. Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/setup_64.c | 8 ++++++++ 2 files changed, 9 insertions(+) --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -128,6 +128,7 @@ config PPC select ARCH_HAS_GCOV_PROFILE_ALL select GENERIC_SMP_IDLE_THREAD select GENERIC_CMOS_UPDATE + select GENERIC_CPU_VULNERABILITIES if PPC_BOOK3S_64 select GENERIC_TIME_VSYSCALL_OLD select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS_BROADCAST if SMP --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -778,5 +778,13 @@ void __init setup_rfi_flush(enum l1d_flu if (!no_rfi_flush) rfi_flush_enable(enable); } + +ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf) +{ + if (rfi_flush) + return sprintf(buf, "Mitigation: RFI Flush\n"); + + return sprintf(buf, "Vulnerable\n"); +} #endif /* CONFIG_PPC_BOOK3S_64 */ #endif