From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v12 for-xen-4.5 09/20] x86/VPMU: Add public xenpmu.h Date: Mon, 29 Sep 2014 11:19:35 -0400 Message-ID: <54297887.8070201@oracle.com> References: <1411673336-32736-1-git-send-email-boris.ostrovsky@oracle.com> <1411673336-32736-10-git-send-email-boris.ostrovsky@oracle.com> <54298632020000780003A972@mail.emea.novell.com> <54298917020000780003A9AB@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: <54298917020000780003A9AB@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, tim@xen.org, dietmar.hahn@ts.fujitsu.com, xen-devel@lists.xen.org, Aravind.Gopalakrishnan@amd.com, jun.nakajima@intel.com, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org On 09/29/2014 10:30 AM, Jan Beulich wrote: >>>> On 29.09.14 at 16:17, wrote: >>>>> On 25.09.14 at 21:28, wrote: >>> --- a/xen/include/public/arch-x86/xen-x86_64.h >>> +++ b/xen/include/public/arch-x86/xen-x86_64.h >>> @@ -174,6 +174,14 @@ struct cpu_user_regs { >>> typedef struct cpu_user_regs cpu_user_regs_t; >>> DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t); >>> >>> +struct xen_pmu_regs { >>> + __DECL_REG(ip); >>> + __DECL_REG(sp); >> Do you really need __DECL_REG() here? I.e. can't these two fields >> be just xen_ulong_t e[is]p and the structure definition then be >> shared with 32-bit code (and hence moved altogether into pmu.h)? > Otoh - is cs useful at all on 64-bit? perf uses user_mode() to figure which mode we are in and that requires CS. > > And thinking of that - is esp without ss useful on 32-bit? And > are cs (and maybe ss) useful without knowing the execution > mode of the target? I don't know how exactly ESP is used (by perf, which is the only tool that I have been testing with). For performance counters it is not used at all, I added it only because it will clearly be needed for stack unwinding when this becomes supported. But presumably SS would also be necessary, yes. CS is useful because only CPL field is looked at. -boris