Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8098834imu; Tue, 4 Dec 2018 03:00:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/UvYidmGgs7gKgG+M7TzmBNWKIaWEPXIhxufyonpC+0yQzOUbEdfIFpf5utZTA5u7+hsQ2e X-Received: by 2002:a62:130c:: with SMTP id b12mr19724968pfj.247.1543921207511; Tue, 04 Dec 2018 03:00:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543921207; cv=none; d=google.com; s=arc-20160816; b=DpPqHvWHEJgGyHm6sMGNwhhYQwyL2XOPOVTdHamwBdvLMYClItkhIjuGzMNM3XS4EW /Qm4ZgTrmXOaKodmpSwPQMn8GiSLaCuv2WawCYjzmzjH3IxTASrK6sfp2BO1jS3bk8wj 8We4DvgTx6EjYo1hNNVltpNpR1X2grGPFJqj+Ip4M9q2mkNEz0p53D5rNKlfxqGAe+QN Fy5PwYiUVI61dXt5sE70x5P1G8u+FAwRVGdmxNvMgwzAseJ7ZXCFyb/WYM0LQ/rD/KQ8 lwOpnJ11TOPRx/wkeYkAD4OMFGGqcGSHBVjDREt8Kq49JzLIfuExg5f9Ou9X74DR3PEt mJXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JtUAKOQXuM4+6KDZanCeNneyozqduiVnUI6m1fO0AFc=; b=O5iog2R3VDgQbqSNbojG41PG5kbuX5RSP8LyeMxYjYI5pHCA7c8ROVDG+J1L/xXAAn ue9/QMuNTwojCjZOC/9qPKdcZfquk0SSyvG/8pTx4a1+QcmnmoXi3ql5GvcGw/oTGzzd 6pS04rUydBzDyXrDBeaQioPtGhgnK+oGT0dty0D8Cz7xNBC4qRkmBwJwdKcDevxB2Gdq bqKYfzE4d2lvxAFj37qf20ozCe1tRp1Obw/IDm3DBsFRwcUa5d4e/PIAk0EdQQ84v14W aRWNsGYVvZ9p00h4U+W7bwydGA0ZFkh72e+aufoOczxiDgfd3WQTV0RSDPOnzkDWeHh7 23PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lcD2GDOf; 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 k38si15153682pgi.235.2018.12.04.02.59.52; Tue, 04 Dec 2018 03:00:07 -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; dkim=pass header.i=@kernel.org header.s=default header.b=lcD2GDOf; 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 S1725849AbeLDK6R (ORCPT + 99 others); Tue, 4 Dec 2018 05:58:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:42512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726905AbeLDK6P (ORCPT ); Tue, 4 Dec 2018 05:58:15 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6E288214C1; Tue, 4 Dec 2018 10:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543921094; bh=YuXFXN7awfwlw2UVCbQmNZqfzlcBAFflEjCk/1g/nYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lcD2GDOf8+HBEJ1GRyPqP6895a6mbaC1glH/qU5blmzY0l5vXEL7PIflaf4dEXwV8 n+1br/L0S/3C2eQGL0vtrlAwsrI8qVMvPXnBdrapgcVQebxnCbELPNcMWD299ZrUaC V50l+14H2GbuSmlh25b1x/933J9B22LEuVK8BHUA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Linus Torvalds , Jiri Kosina , Tom Lendacky , Josh Poimboeuf , Andrea Arcangeli , David Woodhouse , Tim Chen , Andi Kleen , Dave Hansen , Casey Schaufler , Asit Mallick , Arjan van de Ven , Jon Masters , Waiman Long , Dave Stewart , Kees Cook Subject: [PATCH 4.19 044/139] x86/l1tf: Show actual SMT state Date: Tue, 4 Dec 2018 11:48:45 +0100 Message-Id: <20181204103651.798712505@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Gleixner tglx@linutronix.de commit 130d6f946f6f2a972ee3ec8540b7243ab99abe97 upstream Use the now exposed real SMT state, not the SMT sysfs control knob state. This reflects the state of the system when the mitigation status is queried. This does not change the warning in the VMX launch code. There the dependency on the control knob makes sense because siblings could be brought online anytime after launching the VM. Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Cc: Peter Zijlstra Cc: Andy Lutomirski Cc: Linus Torvalds Cc: Jiri Kosina Cc: Tom Lendacky Cc: Josh Poimboeuf Cc: Andrea Arcangeli Cc: David Woodhouse Cc: Tim Chen Cc: Andi Kleen Cc: Dave Hansen Cc: Casey Schaufler Cc: Asit Mallick Cc: Arjan van de Ven Cc: Jon Masters Cc: Waiman Long Cc: Greg KH Cc: Dave Stewart Cc: Kees Cook Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20181125185004.613357354@linutronix.de Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/bugs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -830,13 +830,14 @@ static ssize_t l1tf_show_state(char *buf if (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_EPT_DISABLED || (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_NEVER && - cpu_smt_control == CPU_SMT_ENABLED)) + sched_smt_active())) { 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"); + sched_smt_active() ? "vulnerable" : "disabled"); } #else static ssize_t l1tf_show_state(char *buf)