Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 02 Jul 2018 17:29:26 -0000 Received: from mx3-rdu2.redhat.com ([66.187.233.73] helo=mx1.redhat.com) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fa2dh-0008Ic-CH for speck@linutronix.de; Mon, 02 Jul 2018 19:29:25 +0200 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B41D7DAC2 for ; Mon, 2 Jul 2018 17:29:19 +0000 (UTC) Received: from [10.36.117.221] (ovpn-117-221.ams2.redhat.com [10.36.117.221]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE75E2026D5B for ; Mon, 2 Jul 2018 17:29:18 +0000 (UTC) Subject: [MODERATED] Re: [patch V5 10/10] KVM magic # 10 References: <20180702154426.910579106@linutronix.de> <20180702160529.330106151@linutronix.de> From: Paolo Bonzini Message-ID: Date: Mon, 2 Jul 2018 19:29:17 +0200 MIME-Version: 1.0 In-Reply-To: <20180702160529.330106151@linutronix.de> Content-Type: multipart/mixed; boundary="QsMJlJhgwTBbgAQucuRE5ZWHPXq8jbwJM"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --QsMJlJhgwTBbgAQucuRE5ZWHPXq8jbwJM Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 02/07/2018 17:44, speck for Thomas Gleixner wrote: > + * If the CPU has the flush MSR then clear the flush bit. If not > + * then act depending on the mitigation mode: 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. > */ Perhaps clearer: /* * If the CPU has the flush MSR, then "flush always" mode * is handled via MSR autoload; no need to do anything here. */ always =3D vmentry_l1d_flush =3D=3D VMENTER_L1D_FLUSH_ALWAYS; if (static_cpu_has(X86_FEATURE_FLUSH_L1D) && always) { vcpu->arch.l1tf_flush_l1d =3D false; return; } /* * If not in "flush always" mode, clear the bit; vcpu_run() * or one of the unsafe vmexit handlers will set it back. */ vcpu->arch.l1tf_flush_l1d =3D always; vcpu->stat.l1d_flush++; etc. Paolo --QsMJlJhgwTBbgAQucuRE5ZWHPXq8jbwJM--