Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2027819ybg; Thu, 24 Oct 2019 03:48:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUcWKlQ61nyp8qfqf9Ft4Xv5wdLIVBkK/ej0hkPu2NZlwzX7kavdf/ZB6HJddfJLRkhmH4 X-Received: by 2002:a05:6402:304c:: with SMTP id bu12mr25825888edb.230.1571914110131; Thu, 24 Oct 2019 03:48:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571914110; cv=none; d=google.com; s=arc-20160816; b=C4/iolDFI3yvSxVSVDP6YYB0tnsSqvV7kfLKR3OkGVfTITW5a5z5+oxjQvcGoRvpas vrXCkAkEV1fuNGz7ewNL/Mqmbi0io8njCjOSoiEsKfELZY2SSuNIfAxf2H63Qw6NuDtR keCYUAjuSmtZtY2c8HMHuzvrSN3iXewPAMSbGv8SzgSjTivi5nUZwD8FYObjPeh/XI4H UNwo2+ljr7qyRkNYqTKe87qr/PZ4BpYN2rGmiwLgub/wHb9g8nGHDWbphq15OZXEqwdd P8NTqmTK4t0TcPB+w8NYPM3gnvolfPJAtA+VJxzU8vAbCkZ3hsY0c2+K1BW0e6jHnTwc k/EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=NalAL07f5HutXXwa+1Q4X8qy6hVKEN+PzqVoDq+V0Uc=; b=KohWds2HmCW7u6P8+f5pgR+msp1JVcEIpKrSEySmaiC4cOypsAjhZ370fHd4Zv6ECh sK95M5SVEWA8iRpw5bppahN+BByTA0dqkqXgAxEIhLcq/qI4OdyzRiF1HITmmEQzkMtf ZXCzwLrzUCdRgKdNLpv7pHneDtwWHaUJGh8acKSTitEeEOoAJahMpgDEqFgsfMuSfJ2Z KEOuqK887/qGKaDT6klSEn0upZemooFUpcO3GRF4dRC82nfOM0y2yA/ZAXqajVkAXqc+ mQ9B3NSipqMrp+olVCN956mCLWbvdL3TykPDds+2ulpvAUeRjyNW7EyFAuMharTqWsek 2L0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fVqFjUBl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si4000141ede.120.2019.10.24.03.48.06; Thu, 24 Oct 2019 03:48:30 -0700 (PDT) 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=@google.com header.s=20161025 header.b=fVqFjUBl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408001AbfJWXEf (ORCPT + 99 others); Wed, 23 Oct 2019 19:04:35 -0400 Received: from mail-qk1-f202.google.com ([209.85.222.202]:41362 "EHLO mail-qk1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733196AbfJWXEf (ORCPT ); Wed, 23 Oct 2019 19:04:35 -0400 Received: by mail-qk1-f202.google.com with SMTP id c13so8260876qko.8 for ; Wed, 23 Oct 2019 16:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=NalAL07f5HutXXwa+1Q4X8qy6hVKEN+PzqVoDq+V0Uc=; b=fVqFjUBlr6WYdeW8nfpaSXUvftzYUbrImmEdERDjPUyQDfW0iAnu5Tq3IkJmWctpxj LJ6qGO7PBSpKC/nTaigcHmYD5jmo3yNToB1i9Y/Yy7FNPjYnr2uElafDiGubQf0bx9pH 2uZH6zm4zFnizaRySLxRApWRh9dW/2NPbr5OC1F8RaMcopR//eMP5EOwMhCo2kQ/0mK3 QCoIaqBYlW1NxwoRptyjEnr+2g8XNQDRpbnsZyQjhnprN/Td4eE6Mgl+KFRLEIbQWpvS i/nKt+kO9HmysD8EpE54gGqeSI4UuY4UOFpQEAYRo7D/bjudKLD2GxH84o8ql4XvrsMV OgVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=NalAL07f5HutXXwa+1Q4X8qy6hVKEN+PzqVoDq+V0Uc=; b=cq6atjMH2LJ4Fa6lzJcFdpKaeTwO74tkRKHPFcIPSvZp4etGItJCSYcLTmsrH8f0e+ ZGXXFOupPylV7rp2lqPWIAVb5LC+zGtl4/PYIEjlwF8C8Mnavdud6TycqDxgNAoFxhaB GIWq1geggfyuDG5X/fZ6KwA3pk2sldHMM4Xh9VzZE9bDLQNyKqyjR3/n4DNkWwg3nyOZ vI48B9tBjTR6jshEXh6nHaamucUEEIt5wttlnr/RkdpTAHd2+VxKBgV9XWJvmqbQYUg/ dn+T2ywIOlc2/W2ayX0rP8IfrXsNjAAB/U5NPRbOP7ht2cZvZ0VQLRQyproa+HS5nhvf G9tA== X-Gm-Message-State: APjAAAWn55aGJ/pugpEMsYNjPGxmYJPqUJ+Vya09UmrGq9ClbKokZB6M BQFw8hjhkUrCsztknCuXyma5Q6bHX6yzew+oR6qsHEXfyVUmpZuJ11mdwOEYa/p7jVjV8Guv1DP zBPoe2wF5ZGDx1CPqoyIP6lgKSLNsRAjHD2/2qGJDbUmp2jTp2sZQ/etRGmeoU0ee6sXo8oIMy7 UYTGs1PHvS X-Received: by 2002:ad4:4503:: with SMTP id k3mr11282482qvu.155.1571871872076; Wed, 23 Oct 2019 16:04:32 -0700 (PDT) Date: Wed, 23 Oct 2019 16:04:26 -0700 Message-Id: <20191023230426.200068-1-asteinhauser@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.23.0.866.gb869b98d4c-goog Subject: [PATCH] SYSFS reporting of L1TF on PowerPC. From: Anthony Steinhauser To: linux-kernel@vger.kernel.org Cc: Michael Ellerman , Anthony Steinhauser 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 L1TF affects PowerPC of the same range as Meltdown-US. I tested it personally: https://github.com/google/safeside/pull/52 and it is also admitted in the IBM report: https://www.ibm.com/blogs/psirt/potential-impact-processors-power-family/ Similarly to Meltdown it is effectively mitigated by the rfi_flush. Signed-off-by: Anthony Steinhauser --- arch/powerpc/kernel/security.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c index 7cfcb294b11c..410232e79371 100644 --- a/arch/powerpc/kernel/security.c +++ b/arch/powerpc/kernel/security.c @@ -167,6 +167,18 @@ ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, cha return sprintf(buf, "Vulnerable\n"); } + +ssize_t cpu_show_l1tf(struct device *dev, struct device_attribute *attr, char *buf) +{ + if (rfi_flush) + return sprintf(buf, "Mitigation: RFI Flush"); + + if (!security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV) && + !security_ftr_enabled(SEC_FTR_L1D_FLUSH_PR)) + return sprintf(buf, "Not affected\n"); + + return sprintf(buf, "Vulnerable\n"); +} #endif ssize_t cpu_show_spectre_v1(struct device *dev, struct device_attribute *attr, char *buf) -- 2.23.0.866.gb869b98d4c-goog