Skip to contentSkip to conversation

kvmppc: full instruction emulation

PATCH In review [email protected] 1 participant 1 message Apr 14, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 kvmppc: full instruction emulation

From: Christian Ehrhardt <[email protected]>

This adds a relayfs based kernel interface that allows tracing of all emulated guest instructions. It is based on Hollis tracing of tlb activities. A suitable userspace program to read from that interface and a post processing script that give users a readable output follow.
This feature is configurable in .config under the kvmppc virtualization itself.

---

[diffstat]

 Kconfig   |    9 ++++++
 emulate.c |   84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 powerpc.c |   11 ++++++++
 3 files changed, 104 insertions(+)
arch/powerpc/kvm/Kconfig +9 -0
@@ -49,6 +49,15 @@ config KVM_POWERPC_440_INSTRUCTION_STAT
 	  used to debug performance issues and adds a slight runtime overhead.
 	  If unsure, say N.
 
+config KVM_POWERPC_440_TRACE_INSTRUCTIONS
+	bool "ppc440 instruction emulation tracing"
+	depends on KVM && 44x && KVM_POWERPC_440
+	select RELAY
+	---help---
+	  Adds the complete tracing of the emulated instructions via a relayfs
+	  channel.
+	  If unsure, say N.
+
 config KVM_PPC_VIRTIO
        bool "Virtio Support"
        select VIRTIO
arch/powerpc/kvm/emulate.c +84 -0

102 lines not on this page · raw message

arch/powerpc/kvm/powerpc.c +11 -0
@@ -1082,6 +1082,7 @@ long kvm_arch_vm_ioctl(struct file *filp
 }
 
 extern struct rchan *kvmppc_44x_tlb_chan;
+extern struct rchan *kvmppc_44x_instr_chan;
 /*
  * create_buf_file() callback.  Creates relay file in debugfs.
  */
@@ -1133,6 +1134,13 @@ int kvm_arch_init(void *opaque)
 	if (!kvmppc_44x_tlb_chan)
 		printk("relay_open failed\n");
 
+#ifdef CONFIG_KVM_POWERPC_440_TRACE_INSTRUCTIONS
+	kvmppc_44x_instr_chan = relay_open("44x_instr", kvm_debugfs_dir, 64,
+					   64, &relay_callbacks, NULL);
+	if (!kvmppc_44x_instr_chan)
+		printk(KERN_ERR"relay_open failed\n");
+#endif
+
 #ifdef CONFIG_MAGIC_SYSRQ
 	printk("Registering kvmppc sysrq handler\n");
 	register_sysrq_key('V', &sysrq_kvm_op);
@@ -1144,6 +1152,9 @@ void kvm_arch_exit(void)
 void kvm_arch_exit(void)
 {
 	relay_close(kvmppc_44x_tlb_chan);
+#ifdef CONFIG_KVM_POWERPC_440_TRACE_INSTRUCTIONS
+	relay_close(kvmppc_44x_instr_chan);
+#endif
 }
 
 static int kvmppc_44x_init(void)

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
kvm-ppc-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel