From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH v10 17/20] x86/VPMU: Add privileged PMU mode Date: Wed, 10 Sep 2014 16:39:39 +0100 Message-ID: <54108CDB02000078000336CD@mail.emea.novell.com> References: <1409802080-6160-1-git-send-email-boris.ostrovsky@oracle.com> <1409802080-6160-18-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1409802080-6160-18-git-send-email-boris.ostrovsky@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: tim@xen.org, kevin.tian@intel.com, keir@xen.org, suravee.suthikulpanit@amd.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, Aravind.Gopalakrishnan@amd.com, jun.nakajima@intel.com List-Id: xen-devel@lists.xenproject.org >>> On 04.09.14 at 05:41, wrote: > @@ -191,32 +198,65 @@ int vpmu_do_interrupt(struct cpu_user_regs *regs) > vpmu->arch_vpmu_ops->arch_vpmu_save(sampling); > vpmu_reset(vpmu, VPMU_CONTEXT_SAVE | VPMU_CONTEXT_LOADED); > > - /* Store appropriate registers in xenpmu_data */ > - if ( is_pv_32bit_domain(sampling->domain) ) > + if ( !is_hvm_domain(sampled->domain) ) > { > - /* > - * 32-bit dom0 cannot process Xen's addresses (which are 64 bit) > - * and therefore we treat it the same way as a non-privileged > - * PV 32-bit domain. > - */ > - struct compat_cpu_user_regs *cmp; > - > - gregs = guest_cpu_user_regs(); > - > - cmp = (void *)&vpmu->xenpmu_data->pmu.r.regs; > - XLAT_cpu_user_regs(cmp, gregs); > + /* Store appropriate registers in xenpmu_data */ > + if ( is_pv_32bit_domain(sampling->domain) ) So this apparent mismatch of sampled vs sampling is now being carried through various patches ... > + { > + /* > + * 32-bit dom0 cannot process Xen's addresses (which are 64 bit) > + * and therefore we treat it the same way as a non-privileged > + * PV 32-bit domain. > + */ > + struct compat_cpu_user_regs *cmp; > + > + gregs = guest_cpu_user_regs(); > + > + cmp = (void *)&vpmu->xenpmu_data->pmu.r.regs; > + XLAT_cpu_user_regs(cmp, gregs); > + > + /* Adjust RPL for kernel mode */ > + if ((cmp->cs & 3) == 1) Coding style. Please. Jan