From: Paolo Bonzini Subject: Re: [PATCH v5 4/5] KVM: VMX: Allow direct access to MSR_IA32_SPEC_CTRL Date: Wed, 31 Jan 2018 16:59:10 -0500 Message-ID: References: <1517427467-28567-1-git-send-email-karahmed@amazon.de> <1517427467-28567-5-git-send-email-karahmed@amazon.de> <06cb88da-f355-41ed-380f-7daa8ddf6159@amazon.com> <67dca2bb-1298-c7fa-f681-018e4edc6725@redhat.com> <16d89e09-fbfc-4a08-00a6-40cfb4776018@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: KarimAllah Ahmed , KarimAllah Ahmed , kvm list , LKML , the arch/x86 maintainers , Asit Mallick , Arjan Van De Ven , Dave Hansen , Andi Kleen , Andrea Arcangeli , Linus Torvalds , Tim Chen , Thomas Gleixner , Dan Williams , Jun Nakajima , David Woodhouse , Greg KH , Andy Lutomirski , Ashok Raj To: Jim Mattson Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 31/01/2018 16:53, Jim Mattson wrote: > On Wed, Jan 31, 2018 at 1:42 PM, Paolo Bonzini wrote: > >> Can we just say it sucks to be L2 too? :) Because in the end as long as >> no one ever writes to spec_ctrl, everybody is happy. > > Unfortunately, quite a few OS vendors shipped IBRS-based mitigations > earlier this month. (Has Redhat stopped writing to IA32_SPEC_CTRL yet? > :-) Not yet, but getting there. :) > And in the long run, everyone is going to set IA32_SPEC_CTRL.IBRS=1 on > CPUs with IA32_ARCH_CAPABILITIES.IBRS_ALL. And then it will suck for everyone---they will have to pay the price of saving/restoring an MSR that is going to be written just once. Perhaps we will have to tweak the heuristic, only passing IBRS through when the guest writes IBRS=0. In the end I think it's premature to try and optimize for L2 guests of long-lived L1 hypervisors. Paolo