[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v4 5/7] X86: generic MSRs dump



From beb570928235dc51fc7f866b0357af492d219cf8 Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@xxxxxxxxx>
Date: Mon, 2 Dec 2013 04:51:27 +0800
Subject: [PATCH v4 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@xxxxxxxx>
Signed-off-by: Liu Jinsong <jinsong.liu@xxxxxxxxx>
---
 tools/misc/xen-hvmctx.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/tools/misc/xen-hvmctx.c b/tools/misc/xen-hvmctx.c
index 5a69245..8602398 100644
--- a/tools/misc/xen-hvmctx.c
+++ b/tools/misc/xen-hvmctx.c
@@ -399,6 +399,18 @@ 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++ )
+        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 +479,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

Attachment: 0005-X86-generic-MSRs-dump.patch
Description: 0005-X86-generic-MSRs-dump.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.