From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH 1/7] KVM: VMX: Allocate MSR Bitmap for each vcpu Date: Wed, 8 Oct 2008 19:21:55 +0800 Message-ID: <200810081921.56055.sheng@linux.intel.com> References: <1223439478-26515-1-git-send-email-sheng@linux.intel.com> <200810081841.30880.sheng@linux.intel.com> <48EC9536.4060507@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mga09.intel.com ([134.134.136.24]:50928 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750790AbYJHLXN (ORCPT ); Wed, 8 Oct 2008 07:23:13 -0400 In-Reply-To: <48EC9536.4060507@redhat.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Wednesday 08 October 2008 19:10:46 Avi Kivity wrote: > Sheng Yang wrote: > > On Wednesday 08 October 2008 18:14:22 Avi Kivity wrote: > >> Sheng Yang wrote: > >>> Separate msr_bitmap for each vcpu, prepared for guest PAT support. > >> > >> Why is this necessary? True, it reduces the overhead of the guest > >> reading and writing the PAT MSRs, but is such access frequent? > >> > >> I would think guests set the PAT once, and never change it later. > > > > Yeah. In fact, I just think msr_bitmap for each vcpu would be done sooner > > or later, so get it done here. And it's natural to go with GUEST_PAT. And > > Xen use it for another purpose(DEBUGCTLMSR related, I haven't checked it > > through) (Also svm.c in KVM use per-vcpu msr bitmap) > > svm.c uses it for last branch record; I think these are also rarely > accessed from the guest. > > > And without that, a callback should be implement to hook MSR write and > > update guest pat write for both vmx and svm, or we should update GUEST > > PAT every vmentry according to the vcpu->pat. Either way seems not that > > natural with GUEST_PAT support. > > We need the callbacks (vmx_set_msr and vmx_get_msr, or did you mean > something else?) anyway for save/restore support. Nothing else(think something wrong...) > > > However, if you think msr_bitmap for each vcpu is a waste, I'd like to > > add callbacks. > > I agree that we will likely need msr bitmap support one day; but let's > start without it as this way we test the pat msr callbacks. OK, I will update the patch with callbacks. Thanks! -- regards Yang, Sheng