From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v6 4/5] KVM: VMX: Allow direct access to MSR_IA32_SPEC_CTRL Date: Fri, 2 Feb 2018 13:19:21 -0500 Message-ID: <20180202181921.GV28192@char.us.oracle.com> References: <1517522386-18410-1-git-send-email-karahmed@amazon.de> <1517522386-18410-5-git-send-email-karahmed@amazon.de> <20180202175352.GT28192@char.us.oracle.com> <1517594754.31953.65.camel@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: KarimAllah Ahmed , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Asit Mallick , Arjan Van De Ven , Dave Hansen , Andi Kleen , Andrea Arcangeli , Linus Torvalds , Tim Chen , Thomas Gleixner , Dan Williams , Jun Nakajima , Paolo Bonzini , Greg KH , Andy Lutomirski , Ashok Raj To: David Woodhouse Return-path: Received: from userp2120.oracle.com ([156.151.31.85]:58048 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754180AbeBBSTz (ORCPT ); Fri, 2 Feb 2018 13:19:55 -0500 Content-Disposition: inline In-Reply-To: <1517594754.31953.65.camel@infradead.org> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Feb 02, 2018 at 06:05:54PM +0000, David Woodhouse wrote: > On Fri, 2018-02-02 at 12:53 -0500, Konrad Rzeszutek Wilk wrote: > > .snip.. > > >=20 > > > @@ -1913,6 +1914,29 @@ static void update_exception_bitmap(struct > > > kvm_vcpu *vcpu) > > > =A0} > > > =A0 > > > =A0/* > > > + * Check if MSR is intercepted for currently loaded MSR bitmap. > > > + */ > > > +static bool msr_write_intercepted(struct kvm_vcpu *vcpu, u32 msr) > > > +{ > > > + unsigned long *msr_bitmap; > > > + int f =3D sizeof(unsigned long); > > > > unsigned int >=20 > $ grep -n 'f =3D sizeof' vmx.c > 1934: int f =3D sizeof(unsigned long); > 5013: int f =3D sizeof(unsigned long); > 5048: int f =3D sizeof(unsigned long); > 5097: int f =3D sizeof(unsigned long); >=20 > It sucks enough that we're doing this stuff repeatedly, and it's a > prime candidate for cleaning up, but I wasn't going to send Karim off > to bikeshed that today. Let's at least keep it consistent. Sure.