Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758053AbeAHWdl convert rfc822-to-8bit (ORCPT + 1 other); Mon, 8 Jan 2018 17:33:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45702 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756427AbeAHWdi (ORCPT ); Mon, 8 Jan 2018 17:33:38 -0500 Date: Mon, 8 Jan 2018 17:33:38 -0500 (EST) From: Paolo Bonzini To: David Woodhouse Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, jmattson@google.com, aliguori@amazon.com, thomas lendacky , bp@alien8.de Message-ID: <1441531276.31733151.1515450818280.JavaMail.zimbra@redhat.com> In-Reply-To: <1515440467.7317.43.camel@infradead.org> References: <1515434925-10250-1-git-send-email-pbonzini@redhat.com> <1515434925-10250-4-git-send-email-pbonzini@redhat.com> <1515440467.7317.43.camel@infradead.org> Subject: Re: [PATCH 3/7] kvm: vmx: pass MSR_IA32_SPEC_CTRL and MSR_IA32_PRED_CMD down to the guest MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [94.39.196.37, 10.4.196.18, 10.4.195.15] Thread-Topic: pass MSR_IA32_SPEC_CTRL and MSR_IA32_PRED_CMD down to the guest Thread-Index: gxPAH/cxdqUNzs2mpA8hcWyiHeuDwA== X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 08 Jan 2018 22:33:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: ----- Original Message ----- > From: "David Woodhouse" > To: "Paolo Bonzini" , linux-kernel@vger.kernel.org, kvm@vger.kernel.org > Cc: jmattson@google.com, aliguori@amazon.com, "thomas lendacky" , bp@alien8.de > Sent: Monday, January 8, 2018 8:41:07 PM > Subject: Re: [PATCH 3/7] kvm: vmx: pass MSR_IA32_SPEC_CTRL and MSR_IA32_PRED_CMD down to the guest > > On Mon, 2018-01-08 at 19:08 +0100, Paolo Bonzini wrote: > > > > +       if (have_spec_ctrl && vmx->spec_ctrl != 0) > > +               wrmsrl(MSR_IA32_SPEC_CTRL, vmx->spec_ctrl); > > + > > I think this one probably *is* safe even without an 'else lfence', > which means that the CPU can speculate around it, but it wants a > comment explaining that someone has properly analysed it and saying > precisely why. This one is okay as long as there are no indirect jumps until vmresume. But the one on vmexit is only okay because right now it's *disabling* IBRS. Once IBRS is used by Linux, we'll need an lfence there. I'll add a comment. Paolo