Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4783266ooa; Tue, 14 Aug 2018 10:29:23 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyzOvHOhpms09UzSNicDDQAs7Gypo1agjOdwFP4Uv4Udi2CRbzUV715TIav0tWfwaFGEkip X-Received: by 2002:a62:1756:: with SMTP id 83-v6mr24589708pfx.217.1534267763558; Tue, 14 Aug 2018 10:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534267763; cv=none; d=google.com; s=arc-20160816; b=LfVqh1zSpYJY50JsBimrYqHIcGChrr+P26wNAuVRruYyIzEqkGsC2egCToHrbkxmwh m5VEJ2LG1FDUoxi+q3CPs/yedTFdvRdbScD0OrEoN6dQY90u9kT94eg9tj16Q8hdsrEg AnYzKDwlAbTZuJdCNzVsJXlOiDd8P7NQKUlMcMDeeFGo/a9RmY6Z7iq5JHrUkyjDtlHf PH9DxFs13ate88DcXU4b5MqxED+U0B6GF7NI4+J0V2kGw6L6sQg5coPwreLMr36UmJAz cthZd1+V9cIJasJzwwXY1s3gddw4UE9NL/Yi14YtJSBMLM2yiwkFzG649wrJxgxqz7iq S2Gw== 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=kWZ9n6deqtZfYo9yIkaI+HwzknjEVFi9PWukgz+gT7s=; b=nkd+THYTwj51KZgckXZSLPE6rWE6wSd8jYuVD9Qgsy1p3SyUJPOWt9X3RVzkfkwnNh wJ2TaTdJiCKeHjU26KYRApCQcyRsw45hZk9Zp24dWvpDOB9Z/VEDmyNMOSy8aFQnU+b5 41Qb1QGnlty+WbLw0AL/y4x7zUzr0Ql1z0IZtZZ2THzoreuecwayOTXhieybXHSPVgbr nknJQArya633qIemNhJo82DtwUR1j3WO8yfSi9tw5ObeY6p2SjkagWj+tdlq52m25HZo PwT2904/eH5RL/jF+vuPKLIuxIMMX27HopcF2NQY7kl+Zh/ExzrluUZc8rzYEHogISpx nxaw== 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 y12-v6si23134782pfd.254.2018.08.14.10.29.08; Tue, 14 Aug 2018 10:29:23 -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; 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 S2388742AbeHNUPf (ORCPT + 99 others); Tue, 14 Aug 2018 16:15:35 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52474 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387886AbeHNUPe (ORCPT ); Tue, 14 Aug 2018 16:15:34 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D0DE240B; Tue, 14 Aug 2018 17:27:27 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Bonzini , Thomas Gleixner Subject: [PATCH 4.18 70/79] x86/speculation: Simplify sysfs report of VMX L1TF vulnerability Date: Tue, 14 Aug 2018 19:17:29 +0200 Message-Id: <20180814171340.812254646@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180814171336.799314117@linuxfoundation.org> References: <20180814171336.799314117@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paolo Bonzini Three changes to the content of the sysfs file: - If EPT is disabled, L1TF cannot be exploited even across threads on the same core, and SMT is irrelevant. - If mitigation is completely disabled, and SMT is enabled, print "vulnerable" instead of "vulnerable, SMT vulnerable" - Reorder the two parts so that the main vulnerability state comes first and the detail on SMT is second. Signed-off-by: Paolo Bonzini Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/bugs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -738,9 +738,15 @@ static ssize_t l1tf_show_state(char *buf if (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_AUTO) return sprintf(buf, "%s\n", L1TF_DEFAULT_MSG); - return sprintf(buf, "%s; VMX: SMT %s, L1D %s\n", L1TF_DEFAULT_MSG, - cpu_smt_control == CPU_SMT_ENABLED ? "vulnerable" : "disabled", - l1tf_vmx_states[l1tf_vmx_mitigation]); + if (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_EPT_DISABLED || + (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_NEVER && + cpu_smt_control == CPU_SMT_ENABLED)) + return sprintf(buf, "%s; VMX: %s\n", L1TF_DEFAULT_MSG, + l1tf_vmx_states[l1tf_vmx_mitigation]); + + return sprintf(buf, "%s; VMX: %s, SMT %s\n", L1TF_DEFAULT_MSG, + l1tf_vmx_states[l1tf_vmx_mitigation], + cpu_smt_control == CPU_SMT_ENABLED ? "vulnerable" : "disabled"); } #else static ssize_t l1tf_show_state(char *buf)