From: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: jun.nakajima@intel.com, haitao.shan@intel.com,
jacob.shin@amd.com, dietmar.hahn@ts.fujitsu.com,
xen-devel@lists.xen.org, JBeulich@suse.com
Subject: Re: [PATCH v2 9/9] x86/AMD: Dump AMD VPMU info
Date: Mon, 15 Apr 2013 12:54:49 -0500 [thread overview]
Message-ID: <516C3EE9.3000004@amd.com> (raw)
In-Reply-To: <1365789566-3733-10-git-send-email-boris.ostrovsky@oracle.com>
This is nice. Tested and Acked.
Thanks
Suravee
On 4/12/2013 12:59 PM, Boris Ostrovsky wrote:
> Dump VPMU registers on AMD in the 'q' keyhandler.
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> ---
> xen/arch/x86/hvm/svm/vpmu.c | 42 +++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 41 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
> index b36ab2b..4d1fbc8 100644
> --- a/xen/arch/x86/hvm/svm/vpmu.c
> +++ b/xen/arch/x86/hvm/svm/vpmu.c
> @@ -414,13 +414,53 @@ static void amd_vpmu_destroy(struct vcpu *v)
> }
> }
>
> +/* VPMU part of the 'q' keyhandler */
> +static void amd_vpmu_dump(struct vcpu *v)
> +{
> + struct vpmu_struct *vpmu = vcpu_vpmu(v);
> + struct amd_vpmu_context *ctxt = vpmu->context;
> + unsigned int i;
> +
> + printk(" VPMU state: 0x%x ", vpmu->flags);
> + if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
> + {
> + printk("\n");
> + return;
> + }
> +
> + printk("(");
> + if ( vpmu_is_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED) )
> + printk("PASSIVE_DOMAIN_ALLOCATED, ");
> + if ( vpmu_is_set(vpmu, VPMU_FROZEN) )
> + printk("FROZEN, ");
> + if ( vpmu_is_set(vpmu, VPMU_CONTEXT_SAVE) )
> + printk("SAVE, ");
> + if ( vpmu_is_set(vpmu, VPMU_RUNNING) )
> + printk("RUNNING, ");
> + if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
> + printk("LOADED, ");
> + printk("ALLOCATED)\n");
> +
> + for ( i = 0; i < num_counters; i++ )
> + {
> + uint64_t ctrl, cntr;
> +
> + rdmsrl(ctrls[i], ctrl);
> + rdmsrl(counters[i], cntr);
> + printk(" 0x%08x: 0x%lx (0x%lx in HW) 0x%08x: 0x%lx (0x%lx in HW)\n",
> + ctrls[i], ctxt->ctrls[i], ctrl,
> + counters[i], ctxt->counters[i], cntr);
> + }
> +}
> +
> struct arch_vpmu_ops amd_vpmu_ops = {
> .do_wrmsr = amd_vpmu_do_wrmsr,
> .do_rdmsr = amd_vpmu_do_rdmsr,
> .do_interrupt = amd_vpmu_do_interrupt,
> .arch_vpmu_destroy = amd_vpmu_destroy,
> .arch_vpmu_save = amd_vpmu_save,
> - .arch_vpmu_load = amd_vpmu_load
> + .arch_vpmu_load = amd_vpmu_load,
> + .arch_vpmu_dump = amd_vpmu_dump
> };
>
> int svm_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
next prev parent reply other threads:[~2013-04-15 17:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-12 17:59 [PATCH v2 0/9] Various VPMU patches, version 2 Boris Ostrovsky
2013-04-12 17:59 ` [PATCH v2 1/9] x86/AMD: Allow more fine-grained control of VMCB MSR Permission Map Boris Ostrovsky
2013-04-12 17:59 ` [PATCH v2 2/9] x86/AMD: Do not intercept access to performance counters MSRs Boris Ostrovsky
2013-04-12 17:59 ` [PATCH v2 3/9] x86/AMD: Load context when attempting to read VPMU MSRs Boris Ostrovsky
2013-04-12 17:59 ` [PATCH v2 4/9] x86/AMD: Stop counters on VPMU save Boris Ostrovsky
2013-04-12 17:59 ` [PATCH v2 5/9] x86/VPMU: Add Haswell support Boris Ostrovsky
2013-04-12 17:59 ` [PATCH v2 6/9] x86/VPMU: Factor out VPMU common code Boris Ostrovsky
2013-04-12 17:59 ` [PATCH v2 7/9] x86/VPMU: Save/restore VPMU only when necessary Boris Ostrovsky
2013-04-12 17:59 ` [PATCH v2 8/9] x86/AMD: Clean up context_update() in AMD VPMU code Boris Ostrovsky
2013-04-15 18:00 ` Suravee Suthikulanit
2013-04-12 17:59 ` [PATCH v2 9/9] x86/AMD: Dump AMD VPMU info Boris Ostrovsky
2013-04-15 17:54 ` Suravee Suthikulanit [this message]
2013-04-15 18:04 ` [PATCH v2 0/9] Various VPMU patches, version 2 Suravee Suthikulanit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=516C3EE9.3000004@amd.com \
--to=suravee.suthikulpanit@amd.com \
--cc=JBeulich@suse.com \
--cc=boris.ostrovsky@oracle.com \
--cc=dietmar.hahn@ts.fujitsu.com \
--cc=haitao.shan@intel.com \
--cc=jacob.shin@amd.com \
--cc=jun.nakajima@intel.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.