Received: by 10.223.176.5 with SMTP id f5csp2821587wra; Mon, 5 Feb 2018 10:24:30 -0800 (PST) X-Google-Smtp-Source: AH8x227Kz0nzZdK+Osq7JMXTMuNCHfZ412nLqMpIccJmdn3bu9eHzfKWxN9Fqov4dl4T3uqrRW/N X-Received: by 10.98.207.6 with SMTP id b6mr50506670pfg.187.1517855070449; Mon, 05 Feb 2018 10:24:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517855070; cv=none; d=google.com; s=arc-20160816; b=OKamuqtowwTsYpqQIFf5+qfDQxG6iyXmCuJnn8zPQBkSfvAhZPUgFDh0wxfdiZlS/Y wHshAbt/U0bgUxPMgty3+sG45W1sGDZXm8BP4iJD8ArJFF9j72TGMtvkrxRFYIaseVrr RE+5o7++ned+IfZPeiGNyZPbSasQaRguAYBTU/TBFuT1HypK4pQh3S0h/HTJfUWbBnuZ dp21rfRCGDE+fkUUyya3lWT6N98z/EJLt1571e7duuGaFwf/wB7zjFU59Gccca3QRiM4 tItFRMnNNCB+lJWBIsJw/ugFZqls74xrRLBHsxrGtY6V8umXVxLmfCPMbjV5xaW+iY+F RRmw== 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=HJsD859MHemQ85kQzLqIYkh9vYpOq9WoXmekObsRry4=; b=TiA2ZkosFoat/7N36NVf2jN+QX541NBl/EMiyA452QzhbZa5fTizUEp3DwbnAFSRxg rRaFg8wuDys9oN0wowTcmg2YcGKH1L2HBQdl913+L7bj0pkXdwN8u57BTe+K5F4VaTtn AFC2faLb7mV0MyHtKbuuG00LXZS7d08dVwKpCd0CmR9uwkRMZzqm8GEqaxpe4TtEdfSf RQNNKFDeMl3NdF9k9TBIEiC1je9LxVQSCqIiJzozDdGaUafmy2MSPwhnJGClyC5YwAYa tvfRb6THiAMXSQtLo6730Sdt8QcMqtWJ1k05nIoZiaDUhzXl3toTb0WFjz0/2mOgUpfN NPLA== 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 m14si179564pgd.207.2018.02.05.10.24.15; Mon, 05 Feb 2018 10:24:30 -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 S1753452AbeBESXm (ORCPT + 99 others); Mon, 5 Feb 2018 13:23:42 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50780 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752920AbeBESX0 (ORCPT ); Mon, 5 Feb 2018 13:23:26 -0500 Received: from localhost (unknown [104.132.1.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 408B1FA1; Mon, 5 Feb 2018 18:23:26 +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.14 02/64] powerpc/64s: Wire up cpu_show_meltdown() Date: Mon, 5 Feb 2018 10:22:21 -0800 Message-Id: <20180205182138.665709120@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180205182138.571333346@linuxfoundation.org> References: <20180205182138.571333346@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.14-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 @@ -164,6 +164,7 @@ config PPC select GENERIC_CLOCKEVENTS_BROADCAST if SMP select GENERIC_CMOS_UPDATE select GENERIC_CPU_AUTOPROBE + select GENERIC_CPU_VULNERABILITIES if PPC_BOOK3S_64 select GENERIC_IRQ_SHOW select GENERIC_IRQ_SHOW_LEVEL select GENERIC_SMP_IDLE_THREAD --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -884,4 +884,12 @@ 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 */