From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44656 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751425AbeBWRff (ORCPT ); Fri, 23 Feb 2018 12:35:35 -0500 Subject: Re: [PATCH 1/3] KVM: x86: use native MSR ops for SPEC_CTRL To: Konrad Rzeszutek Wilk Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , KarimAllah Ahmed , David Woodhouse , Jim Mattson , Thomas Gleixner , Ingo Molnar , stable@vger.kernel.org References: <1519249297-73718-1-git-send-email-pbonzini@redhat.com> <1519249297-73718-2-git-send-email-pbonzini@redhat.com> <20180222170717.GP31483@char.us.oracle.com> <20180223172220.GK8252@char.us.oracle.com> From: Paolo Bonzini Message-ID: <7534bcd3-e21b-240c-9ed2-62026ba10301@redhat.com> Date: Fri, 23 Feb 2018 18:35:30 +0100 MIME-Version: 1.0 In-Reply-To: <20180223172220.GK8252@char.us.oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On 23/02/2018 18:22, Konrad Rzeszutek Wilk wrote: > On Fri, Feb 23, 2018 at 10:37:49AM +0100, Paolo Bonzini wrote: >> On 22/02/2018 18:07, Konrad Rzeszutek Wilk wrote: >>>> Having a paravirt indirect call in the IBRS restore path is not a >>>> good idea, since we are trying to protect from speculative execution >>>> of bogus indirect branch targets. It is also slower, so use >>>> native_wrmsrl on the vmentry path too. >>> But it gets replaced during patching. As in once the machine boots >>> the assembler changes from: >>> >>> callq *0xfffflbah >>> >>> to >>> wrmsr >>> >>> ? I don't think you need this patch. >> >> Why not be explicit? According to the spec, PRED_CMD and SPEC_CTRL > > Explicit is fine. > > But I would recommend you change the commit message to say so, and > perhaps remove 'It is also slower' - as that is incorrect. Actually it is faster---that's why I made the change in the first place, though later I noticed > If it is detected to be Xen PV, then yes > it will be a call to a function. But that won't help as Xen PV runs in > ring 3, so it has a whole bunch of other issues. Ok, I wasn't sure about PVH (which runs in ring 0 afair). Paolo