[PATCH] kvm tools: don't exit on debug ioport write

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

 



While it shouldn't happen on regular guests, we sometimes hit it when fuzzing
within the guest, which would cause the lkvm process to exit - which is
undesired.

Our PIT tests were using the debug port to trigger a reboot. Instead of using
that port we now use the reboot line of our i8042 controller.

Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx>
---
 tools/kvm/tests/pit/tick.S | 14 +++-----------
 tools/kvm/x86/ioport.c     |  2 +-
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/tools/kvm/tests/pit/tick.S b/tools/kvm/tests/pit/tick.S
index b9e5a80..635dc8d 100644
--- a/tools/kvm/tests/pit/tick.S
+++ b/tools/kvm/tests/pit/tick.S
@@ -4,15 +4,6 @@
 #define TIMER_FREQ	1193182
 #define TIMER_DIV(x)	((TIMER_FREQ+(x)/2)/(x))
 
-/*
- * hpa noted:
- *
- * 0xe0..0xef are "motherboard specific", but 0xe9 is
- * used for Bochs debugging and 0xed is the Phoenix-reserved
- * delay port
- */
-#define DBG_PORT	0xe0
-
 #define TEST_COUNT	0x0200
 
 	.code16gcc
@@ -82,8 +73,9 @@ test_ok:
 	mov	$(msg2_end-msg2), %cx
 	cs rep/outsb
 
-	/* not a valid port to force exit */
-	outb	%al, $DBG_PORT
+	/* Reboot by using the i8042 reboot line */
+	mov	$0xfe, %al
+	outb	%al, $0x64
 
 timer_isr:
 	cli
diff --git a/tools/kvm/x86/ioport.c b/tools/kvm/x86/ioport.c
index 86302e6..4ea0091 100644
--- a/tools/kvm/x86/ioport.c
+++ b/tools/kvm/x86/ioport.c
@@ -5,7 +5,7 @@
 
 static bool debug_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size)
 {
-	exit(EXIT_SUCCESS);
+	return 0;
 }
 
 static struct ioport_operations debug_ops = {
-- 
1.7.12

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux