From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v6 11/19] x86/VPMU: Initialize PMU for PV guests Date: Tue, 20 May 2014 13:47:36 -0400 Message-ID: <537B9538.1040304@oracle.com> References: <1399996413-1998-1-git-send-email-boris.ostrovsky@oracle.com> <1399996413-1998-12-git-send-email-boris.ostrovsky@oracle.com> <537B963702000078000143A6@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <537B963702000078000143A6@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: kevin.tian@intel.com, keir@xen.org, suravee.suthikulpanit@amd.com, andrew.cooper3@citrix.com, donald.d.dugger@intel.com, xen-devel@lists.xen.org, dietmar.hahn@ts.fujitsu.com, jun.nakajima@intel.com List-Id: xen-devel@lists.xenproject.org On 05/20/2014 11:51 AM, Jan Beulich wrote: >>>> On 13.05.14 at 17:53, wrote: >> --- a/xen/arch/x86/hvm/svm/svm.c >> +++ b/xen/arch/x86/hvm/svm/svm.c >> @@ -1150,7 +1150,8 @@ static int svm_vcpu_initialise(struct vcpu *v) >> return rc; >> } >> >> - vpmu_initialise(v); >> + if ( is_hvm_domain(v->domain) ) >> + vpmu_initialise(v); > Why? This patch adds initialization for PV domains, which is conditioned by is_pv_domain() in amd_vpmu_initialise()/core2_vpmu_alloc_resource(). I don't want PVH domains (which call these routines) to try to set up their VPMUs from here. This is supposed to happen via pvpmu_init() (which in this patch will return -EINVAL for PVH). Same reason for conditioning vpmu_destroy(). I think I should drop this whole business of delaying PVH support until later patch and do it incrementally at the same time as I add PV support. (The reason, BTW, for doing it this way was because when I started with this project PVH support wasn't there yet and I couldn't test it). -boris