Return-Path: 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 1fNLkF-0003y7-Vu for speck@linutronix.de; Mon, 28 May 2018 19:15:44 +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 B5E13401EF04 for ; Mon, 28 May 2018 17:15:36 +0000 (UTC) Received: from [10.36.118.75] (unknown [10.36.118.75]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2941A2023487 for ; Mon, 28 May 2018 17:15:36 +0000 (UTC) Subject: [MODERATED] Re: L1D-Fault KVM mitigation References: <1524563292.8691.38.camel@infradead.org> <20180424110445.GU4043@hirez.programming.kicks-ass.net> <1527068745.8186.89.camel@infradead.org> <20180524094526.GE12198@hirez.programming.kicks-ass.net> <20180526204319.GB4486@tassilo.jf.intel.com> <20180527182550.GC4486@tassilo.jf.intel.com> From: Paolo Bonzini Message-ID: <347b7818-b73b-bad5-2def-da50d34e80c3@redhat.com> Date: Mon, 28 May 2018 19:15:34 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="WHFXd7y1pTGTkjCWtZA0KsGywFu4woZQz"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --WHFXd7y1pTGTkjCWtZA0KsGywFu4woZQz Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 28/05/2018 17:56, speck for Thomas Gleixner wrote: >> There is a problem though. The only way to know if the guest is in >> hlt/mwait/pause, is to cause a vmexit, e.g. with an IPI, and read the = VM >> control state (which you can only do from the CPU that was running it!= ). >> So even for the "idle in the guest" case you pretty much have to do >> synchronization. > Right, but there ucode assist would be handy. If the sibling is in > hlt/mwait then the other could do a vmexit undisturbed and when the > mwait/hlt resumes then it either forces a vmexit if the other sibling i= s > still in the host or it lets it continue when the other sibling reenter= ed > guest mode again. Yes, but I am not sure how microcode can do it since it could potentially block a sibling forever. Perhaps some kind of "sibling not in VMX non-root mode" vmexit, to automate the IPI part of the synchronization, would be useful. When the hypervisor receives it, it can decide whether to poll for completion of the sibling's vmexit, or to go to sleep. Paolo --WHFXd7y1pTGTkjCWtZA0KsGywFu4woZQz--