From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v11 for-xen-4.5 16/20] x86/VPMU: Handle PMU interrupts for PV guests Date: Tue, 23 Sep 2014 15:07:17 -0400 Message-ID: <20140923190717.GY3007@laptop.dumpdata.com> References: <1411430281-6132-1-git-send-email-boris.ostrovsky@oracle.com> <1411430281-6132-17-git-send-email-boris.ostrovsky@oracle.com> <20140923183139.GR3007@laptop.dumpdata.com> <5421C2A9.6010701@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5421C2A9.6010701@oracle.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: Boris Ostrovsky Cc: kevin.tian@intel.com, keir@xen.org, jbeulich@suse.com, jun.nakajima@intel.com, andrew.cooper3@citrix.com, tim@xen.org, dietmar.hahn@ts.fujitsu.com, xen-devel@lists.xen.org, Aravind.Gopalakrishnan@amd.com, suravee.suthikulpanit@amd.com List-Id: xen-devel@lists.xenproject.org On Tue, Sep 23, 2014 at 02:57:45PM -0400, Boris Ostrovsky wrote: > On 09/23/2014 02:31 PM, Konrad Rzeszutek Wilk wrote: > >> int vpmu_do_interrupt(struct cpu_user_regs *regs) > >> { .. snip .. > >>+ cur_regs = guest_cpu_user_regs(); > >>+ > >>+ cmp = (void *)&vpmu->xenpmu_data->pmu.r.regs; > >.. what we read from here. Did I miss a patch? > > > >>+ cmp->eip = cur_regs->rip; > >>+ cmp->esp = cur_regs->rsp; > >>+ cmp->cs = cur_regs->cs; > >>+ if ( (cmp->cs & 3) == 1 ) > >>+ cmp->cs &= ~3; > >>+ } > >>+ else > >>+ { > >>+ struct xen_pmu_regs *r = &vpmu->xenpmu_data->pmu.r.regs; > >Ditto here. > > > >Perhaps a comment stating _who_ (or _what_) is responsible for populating > >the 'pmu.r.regs' structure? > > There are different registers --- PMU MSRs and GPRs. Comment "PV guest will > be reading PMU MSRs from xenpmu_data" was in reference to guest accessing > MSRs that are cached in pmu.c(ontext) as opposed to doing rd/wrmsr and > trapping to hypervisor.. That's why we do arch_vpmu_save(): to save PMU MSRs > into the shared page. > > pmu.r(egisters) are sampled VCPU's GPRs and are filled in this routine. > > Does this answer your question? Yes thank you. And I need more coffee.