Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4786598ooa; Tue, 14 Aug 2018 10:31:48 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwnsINtPRoUoPCVf1HiiPbGrsyy9lVgczZRW45r2MkL71VEPxLZgbyRgfrVqfTrHzfTEhrf X-Received: by 2002:a63:5106:: with SMTP id f6-v6mr21419472pgb.95.1534267908552; Tue, 14 Aug 2018 10:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534267908; cv=none; d=google.com; s=arc-20160816; b=fr6QSLUAPDofw+Cdz2vr7n6SbTtFwQFANBklJKmiNVqJBcv2i2pP9mJJbSbPMmovSi w2DN22mUo326HdbRBIcTBrQ/fEn1gP7lwmASXVWXk6JLHsGI3JB4g41jlAYAk2/E43VE DIX3TieKi0DtXkFM+6eI4iTZxedskoW3l1gdl4Fr+tYw2hQklM3dcHh3IbNRK5VVhflz N/fKmvdhF15LR/jBhIQy/oiujfJBgXuvlkvnmUFLlDZk02pYW+I6ECRDr1mDNqAYBHNH 46j1sQkf/331RzQbykyZDYKP5JhwG964KNZ92sJ6ni1F4CcNFm+dD+WKgnkoOBUuoI8K QhLQ== 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=+uS6Bm1kHIdCCVnwH11DzFIe3bw9/1W66HXLy0wWFHc=; b=mAJGaodBo0s1xWxK26jzNejrCISpcDUYX643uKz+J7C8BxNpjaLCR5mvEL1WA9EmSj Fh2Xshy1ULw3+RRo3Js7IpK9/qpbXy5Zycs/5DjqUtJ5Y2WdtzBolLhZIixEYAHEdl1b //rfsarxS13n4XA8zyCBbzks52OLmWBMJW/nfJkh0B3qsq2ExeBq8pgCyAEyAA3UNKmQ R7QFAvtgIvbDi11JtkFB4LUABG07VyGW8JYd7V8ZN2/jthBDtVrTe/acXSe3gHCgtwvv uv7KLesz7dz4d4dUmTtJIub55H1mGUNLRnIayTVebqsNPKjdF285p9a1hAIidD/30AHZ Rv7g== 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 z125-v6si23486335pfz.10.2018.08.14.10.31.10; Tue, 14 Aug 2018 10:31:48 -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 S2388608AbeHNUPG (ORCPT + 99 others); Tue, 14 Aug 2018 16:15:06 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52380 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388032AbeHNUPF (ORCPT ); Tue, 14 Aug 2018 16:15:05 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 403B040B; Tue, 14 Aug 2018 17:26:59 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolai Stange , Thomas Gleixner Subject: [PATCH 4.18 61/79] x86/KVM/VMX: Dont set l1tf_flush_l1d to true from vmx_l1d_flush() Date: Tue, 14 Aug 2018 19:17:20 +0200 Message-Id: <20180814171340.230209838@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: Nicolai Stange 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: 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 @@ -9727,15 +9727,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++;