Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4801909ooa; Tue, 14 Aug 2018 10:44:57 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwkv91jEvPC+ltI6IWWdbx5uECFsBvrwbunAma9KHVS7SLE4355j0jqr787K9+4WTDPpGml X-Received: by 2002:a62:a216:: with SMTP id m22-v6mr23947115pff.163.1534268697648; Tue, 14 Aug 2018 10:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534268697; cv=none; d=google.com; s=arc-20160816; b=jxmY7HhxWJ1rZCM4sz3l/y1bZOLFzX7aeMyV7unr7SoIPNVc9B8fplddWHCUvZdozj zjedb0RQe2gfJ6QdQEGfLuWTi7YdtA4x/CmP7QO494to5RxC7s6DaYkSanw2jCqNSzjn 5dOyAftgHdFkGeryfmo4XUceA1KchA1Vpyb7i1QkCTRCAYSH8s3STCJ2jrWtDyndC3bm acKt9OQcUPBVsEKgO8BhmjpbEnWhZ+bJS4cqCJ/7cNJAgU+eIdhKwMUUQrA70XDJ/kFo b4xJnUCYA6XgwEb8f14QpQnP91nUmKQTDD73YqlQEQAqKb9UHLe0Ymvqp44BZShH51Vc 3IwA== 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=oF/0Ppx3E8ixWeSRBKHDNz7zrlpFVns5tR2pD/Z92jE=; b=py7oKJQ7lq4QLmpls/6tonRr+Ncpe9s6SLHK0tzIbhtXv4oANbt0v0oA0Hg2Mc+3uJ Refy9lNaI3nc5sQWrBQmu+9Rpo2wyaEGHlugKnkHmOIpV+KGedYBMKT7aiHJ9V6Z9RqW SVqVLM2tXahQAlajwVRjuFu98cnBgc46ntimL3aC2FbyjYgOAF7Ajego1wBILENeZeGO x3LWpzKwTd619O8LeLIEK7bs8PnY9DpoJRB94cYAQ5KqwGc1KuelOWw9aj4Hfgn5JFyl PqJgFVks0OkhaCy/l0jXPxRmNBTdAce8fXBjLfGSoFFAqpuafp8gLYFX7j199ctO5yoq DYkQ== 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 u16-v6si17503769pgv.180.2018.08.14.10.44.42; Tue, 14 Aug 2018 10:44:57 -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 S2390648AbeHNUcE (ORCPT + 99 others); Tue, 14 Aug 2018 16:32:04 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59916 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728642AbeHNUcD (ORCPT ); Tue, 14 Aug 2018 16:32:03 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 612FBAF3; Tue, 14 Aug 2018 17:43:52 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolai Stange , Thomas Gleixner , David Woodhouse Subject: [PATCH 4.9 083/107] x86/KVM/VMX: Dont set l1tf_flush_l1d to true from vmx_l1d_flush() Date: Tue, 14 Aug 2018 19:17:46 +0200 Message-Id: <20180814171525.849679001@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180814171520.883143803@linuxfoundation.org> References: <20180814171520.883143803@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nicolai Stange commit 379fd0c7e6a391e5565336a646f19f218fb98c6c upstream vmx_l1d_flush() gets invoked only if l1tf_flush_l1d is true. There's no point in setting l1tf_flush_l1d to true from there again. Signed-off-by: Nicolai Stange Signed-off-by: Thomas Gleixner Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/vmx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -8665,15 +8665,15 @@ static void vmx_l1d_flush(struct kvm_vcp /* * This code is only executed when the the flush mode is 'cond' or * 'always' - * - * If 'flush always', keep the flush bit set, otherwise clear - * it. The flush bit gets set again either from vcpu_run() or from - * one of the unsafe VMEXIT handlers. */ - if (static_branch_unlikely(&vmx_l1d_flush_always)) - vcpu->arch.l1tf_flush_l1d = true; - else + if (!static_branch_unlikely(&vmx_l1d_flush_always)) { + /* + * Clear the flush bit, it gets set again either from + * vcpu_run() or from one of the unsafe VMEXIT + * handlers. + */ vcpu->arch.l1tf_flush_l1d = false; + } vcpu->stat.l1d_flush++;