[tip:tools/kvm] kvm tools: Add --debug-mmio option

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

 



Commit-ID:  b3fdd1d126a67f071347ad605ae7f311d12d9d11
Gitweb:     http://git.kernel.org/tip/b3fdd1d126a67f071347ad605ae7f311d12d9d11
Author:     Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
AuthorDate: Thu, 3 May 2012 23:16:55 +0400
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Tue, 8 May 2012 08:34:58 +0300

kvm tools: Add --debug-mmio option

This switches the default behaviour of lkvm if access
on unregistered MMIO address happens -- we don't spam
a user with warning messages anymore. If one needs details
on unhandled MMIOs the --debug-mmio option should be passed.

Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/builtin-run.c |    3 +++
 tools/kvm/mmio.c        |    9 ++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
index 97f61d0..4f6ea15 100644
--- a/tools/kvm/builtin-run.c
+++ b/tools/kvm/builtin-run.c
@@ -101,6 +101,7 @@ static bool custom_rootfs;
 static bool no_net;
 static bool no_dhcp;
 extern bool ioport_debug;
+extern bool mmio_debug;
 static int  kvm_run_wrapper;
 extern int  active_console;
 extern int  debug_iodelay;
@@ -481,6 +482,8 @@ static const struct option options[] = {
 			"Enable single stepping"),
 	OPT_BOOLEAN('\0', "debug-ioport", &ioport_debug,
 			"Enable ioport debugging"),
+	OPT_BOOLEAN('\0', "debug-mmio", &mmio_debug,
+			"Enable MMIO debugging"),
 	OPT_INTEGER('\0', "debug-iodelay", &debug_iodelay,
 			"Delay IO by millisecond"),
 	OPT_END()
diff --git a/tools/kvm/mmio.c b/tools/kvm/mmio.c
index 7760a7f..dd28ef33 100644
--- a/tools/kvm/mmio.c
+++ b/tools/kvm/mmio.c
@@ -21,6 +21,7 @@ struct mmio_mapping {
 };
 
 static struct rb_root mmio_tree = RB_ROOT;
+bool mmio_debug = false;
 
 static struct mmio_mapping *mmio_search(struct rb_root *root, u64 addr, u64 len)
 {
@@ -128,9 +129,11 @@ bool kvm__emulate_mmio(struct kvm *kvm, u64 phys_addr, u8 *data, u32 len, u8 is_
 
 	if (mmio)
 		mmio->mmio_fn(phys_addr, data, len, is_write, mmio->ptr);
-	else
-		fprintf(stderr, "Warning: Ignoring MMIO %s at %016llx (length %u)\n",
-			to_direction(is_write), phys_addr, len);
+	else {
+		if (mmio_debug)
+			fprintf(stderr, "Warning: Ignoring MMIO %s at %016llx (length %u)\n",
+				to_direction(is_write), phys_addr, len);
+	}
 	br_read_unlock();
 
 	return true;
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux