From cdc011441b7677e1e789e54e08b2290430cf0870 Mon Sep 17 00:00:00 2001 From: Liu Jinsong <jinsong.liu@intel.com> Date: Wed, 4 Dec 2013 04:45:00 +0800 Subject: [PATCH v5 5/7] X86: generic MSRs dump This patch is generic MSRs dump. With it new MSRs dump does not need the addition of new dump types any more. Suggested-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com> --- tools/misc/xen-hvmctx.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/tools/misc/xen-hvmctx.c b/tools/misc/xen-hvmctx.c index 5a69245..6855f87 100644 --- a/tools/misc/xen-hvmctx.c +++ b/tools/misc/xen-hvmctx.c @@ -399,6 +399,19 @@ static void dump_tsc_adjust(void) printf(" TSC_ADJUST: tsc_adjust %" PRIx64 "\n", p.tsc_adjust); } +static void dump_hvm_msr(void) +{ + int i; + + HVM_SAVE_TYPE(HVM_MSR) p; + READ(p); + + for ( i = 0; i < p.count; i++ ) + if ( p.msr[i].index ) + printf(" HVM_MSR: msr %" PRIx32 " val %" PRIx64 "\n", + p.msr[i].index, p.msr[i].val); +} + int main(int argc, char **argv) { int entry, domid; @@ -467,6 +480,7 @@ int main(int argc, char **argv) case HVM_SAVE_CODE(VIRIDIAN_VCPU): dump_viridian_vcpu(); break; case HVM_SAVE_CODE(VMCE_VCPU): dump_vmce_vcpu(); break; case HVM_SAVE_CODE(TSC_ADJUST): dump_tsc_adjust(); break; + case HVM_SAVE_CODE(HVM_MSR): dump_hvm_msr(); break; case HVM_SAVE_CODE(END): break; default: printf(" ** Don''t understand type %u: skipping\n", -- 1.7.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel