]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: don't exit on debug ioport write
authorSasha Levin <levinsasha928@gmail.com>
Tue, 18 Sep 2012 09:45:13 +0000 (11:45 +0200)
committerPekka Enberg <penberg@kernel.org>
Wed, 19 Sep 2012 06:54:11 +0000 (09:54 +0300)
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@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/tests/pit/tick.S
tools/kvm/x86/ioport.c

index b9e5a80b9fea3676da6bff80e9df05a4fe697f7e..635dc8dd46bc83a2ca999c87812fb9c609b43493 100644 (file)
@@ -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
index 4993f9daa8c47edf44c3fd57cb57f6a497d744a7..e35d0ee93186bab0786bae497f8f89c4a0c30bfb 100644 (file)
@@ -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 = {