From: "Jan Beulich" Subject: Re: [PATCH v6 11/19] x86/VPMU: Initialize PMU for PV guests Date: Wed, 21 May 2014 09:01:39 +0100 Message-ID: <537C798302000078000145F8@mail.emea.novell.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> <537B9538.1040304@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <537B9538.1040304@oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky 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 20.05.14 at 19:47, wrote: > 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). So what's the reason for making PVH PV-like here rather than HVM-like? With the intended goal of making PVH a HVM sub-mode, that'll require more exceptions in the long run. Jan