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: Wed, 21 May 2014 10:03:35 -0400 Message-ID: <537CB237.9020406@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> <537B9538.1040304@oracle.com> <537C798302000078000145F8@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: <537C798302000078000145F8@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/21/2014 04:01 AM, Jan Beulich wrote: >>>> 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. Primarily because of interrupt handling: we don't end up in HVM guest's interrupt handler for PMU interrupts but rather in the PV PMU_VIRQ handler which expects shared context to be set up. This means that initialization for PVH has to be slightly different. -boris