Skip to contentSkip to conversation

svm: debug improvements

PATCH In review Christoph Egger 2 participants 4 messages Jun 23, 2010 – Jun 24, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 svm: debug improvements

Hi!

Attached patch moves vmcb dump function into
its own svm debug files.
Add svm_vmcb_isvalid() to svm code to validate
the vmcb.

P.S.: svm_vmcb_isvalid() is extracted from my
nested virtualization patches.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
xen/arch/x86/hvm/svm/Makefile +1 -0
diff -r e2f5e4f3481c xen/arch/x86/hvm/svm/Makefile
@@ -3,5 +3,6 @@ obj-y += emulate.o
 obj-y += entry.o
 obj-y += intr.o
 obj-y += svm.o
+obj-y += svmdebug.o
 obj-y += vmcb.o
 obj-y += vpmu.o
xen/arch/x86/hvm/svm/svm.c +2 -1
diff -r e2f5e4f3481c xen/arch/x86/hvm/svm/svm.c
@@ -48,6 +48,7 @@
 #include <asm/hvm/svm/vmcb.h>
 #include <asm/hvm/svm/emulate.h>
 #include <asm/hvm/svm/intr.h>
+#include <asm/hvm/svm/svmdebug.h>
 #include <asm/x86_emulate.h>
 #include <public/sched.h>
 #include <asm/hvm/vpt.h>
@@ -1451,7 +1452,7 @@ asmlinkage void svm_vmexit_handler(struc
 
     if ( unlikely(exit_reason == VMEXIT_INVALID) )
     {
-        svm_dump_vmcb(__func__, vmcb);
+        svm_vmcb_dump(__func__, vmcb);
         goto exit_and_crash;
     }
 
xen/arch/x86/hvm/svm/svmdebug.c new file +185 -0

185 lines not on this page · raw message

xen/arch/x86/hvm/svm/vmcb.c +2 -71

91 lines not on this page · raw message

xen/include/asm-x86/hvm/svm/svm.h +0 -2
diff -r e2f5e4f3481c xen/include/asm-x86/hvm/svm/svm.h
@@ -29,8 +29,6 @@
 #include <asm/i387.h>
 #include <asm/hvm/vpmu.h>
 
-void svm_dump_vmcb(const char *from, struct vmcb_struct *vmcb);
-
 #define SVM_REG_EAX (0) 
 #define SVM_REG_ECX (1) 
 #define SVM_REG_EDX (2) 
xen/include/asm-x86/hvm/svm/svmdebug.h new file +30 -0
diff -r e2f5e4f3481c xen/include/asm-x86/hvm/svm/svmdebug.h
@@ -0,0 +1,30 @@
+/*
+ * svmdebug.h: SVM related debug defintions
+ * Copyright (c) 2010, AMD Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ */
+
+#ifndef __ASM_X86_HVM_SVM_SVMDEBUG_H__
+#define __ASM_X86_HVM_SVM_SVMDEBUG_H__
+
+#include <asm/types.h>
+#include <asm/hvm/svm/vmcb.h>
+
+void svm_vmcb_dump(const char *from, struct vmcb_struct *vmcb);
+bool_t svm_vmcb_isvalid(const char *from, struct vmcb_struct *vmcb,
+                        bool_t verbose);
+
+#endif /* __ASM_X86_HVM_SVM_SVMDEBUG_H__ */

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 4 lines · Christoph Egger

Attached patch moves vmcb dump function into
its own svm debug files.
Add svm_vmcb_isvalid() to svm code to validate
the vmcb.

I won't take patches to add things that aren't used. Unless they are used later in the same patch series, all posted with intention to be applied at the same time. Otherwise the function is dead code, and I love to delete dead code.

-- Keir

#2 lore raw
Quoted 8 lines · On Wednesday 23 June 2010 15:48:28 Keir Fraser wrote:
Quoted 4 lines · Christoph Egger

Attached patch moves vmcb dump function into
its own svm debug files.
Add svm_vmcb_isvalid() to svm code to validate
the vmcb.

I won't take patches to add things that aren't used. Unless they are used later in the same patch series,

Yes, that is the case. It will be used in the nested virtualization patch series. Do you prefer me to resend it as part of the patch series?

Quoted 3 lines

all posted with intention to be applied at
the same time. Otherwise the function is dead code, and I love to delete dead code.

Me, too.

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#3 lore raw
Quoted 5 lines · Christoph Egger
Quoted 2 lines

I won't take patches to add things that aren't used. Unless they are used later in the same patch series,

Yes, that is the case. It will be used in the nested virtualization patch series. Do you prefer me to resend it as part of the patch series?

Yes indeed.

K.