From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] KVM: Handle MSR_IA32_PERF_CTL Date: Fri, 27 May 2016 17:22:25 +0200 Message-ID: <20160527152224.GA11721@potion> References: <770161464247923@webcorp02g.yandex-team.ru> <20160526203931.GB25334@potion> <20160526204439.GF2186@HEDWIG.INI.CMU.EDU> <920591464331762@webcorp02f.yandex-team.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "Gabriel L. Somlo" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "gleb@kernel.org" , "pbonzini@redhat.com" To: kmeaw@yandex-team.ru Return-path: Content-Disposition: inline In-Reply-To: <920591464331762@webcorp02f.yandex-team.ru> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2016-05-27 09:49+0300, kmeaw@yandex-team.ru: > 26.05.2016, 23:44, "Gabriel L. Somlo" : >> On Thu, May 26, 2016 at 10:39:31PM +0200, Radim Kr=C4=8Dm=C3=A1=C5=99= wrote: >>> =C2=A02016-05-26 10:32+0300, kmeaw@yandex-team.ru: >>> =C2=A0> This patch implements a dummy handler for MSR_IA32_PERF_CTL= to avoid the >>> =C2=A0> crashes. Most notably it fixes an issue with MacOS X 10.10 = kernel. >>> =C2=A0Does MacOS X write it too? >> >> After setting /sys/module/kvm/parameters/ignore_msrs, all I get in >> dmesg after firing up OS X is: >> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0vcpu0 ignored rdmsr:= 0x199 >> >> So no, I don't think it would try to write it. >=20 > That's right, OS X does not issue an wrmsr to 0x199. More specificall= y, I have not > observed that on my KVM instances. Should I remove the "wrmsr" portio= n from the > patch? Yes, please. Silently ignoring the write is worse than #GP and #GP is not a problem, so I wouldn't bother with a phony implementation. Returning 0 on read is ok as seems to mean P-state=3D0, which is within expectations. (I wonder why MacOS X doesn't read IA32_PERF_STATUS, though.)