aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/lguest/lguest.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c
index 7cc1fed1094d..5d104321f70f 100644
--- a/tools/lguest/lguest.c
+++ b/tools/lguest/lguest.c
@@ -1079,23 +1079,6 @@ static void cleanup_devices(void)
1079 tcsetattr(STDIN_FILENO, TCSANOW, &orig_term); 1079 tcsetattr(STDIN_FILENO, TCSANOW, &orig_term);
1080} 1080}
1081 1081
1082/*L:215
1083 * This is the generic routine we call when the Guest uses LHCALL_NOTIFY.
1084 */
1085static void handle_output(unsigned long addr)
1086{
1087 /*
1088 * Early console write is done using notify on a nul-terminated string
1089 * in Guest memory. It's also great for hacking debugging messages
1090 * into a Guest.
1091 */
1092 if (addr >= guest_limit)
1093 errx(1, "Bad NOTIFY %#lx", addr);
1094
1095 write(STDOUT_FILENO, from_guest_phys(addr),
1096 strnlen(from_guest_phys(addr), guest_limit - addr));
1097}
1098
1099/*L:217 1082/*L:217
1100 * We do PCI. This is mainly done to let us test the kernel virtio PCI 1083 * We do PCI. This is mainly done to let us test the kernel virtio PCI
1101 * code. 1084 * code.
@@ -2662,14 +2645,8 @@ static void __attribute__((noreturn)) run_guest(void)
2662 2645
2663 /* We read from the /dev/lguest device to run the Guest. */ 2646 /* We read from the /dev/lguest device to run the Guest. */
2664 readval = pread(lguest_fd, &notify, sizeof(notify), cpu_id); 2647 readval = pread(lguest_fd, &notify, sizeof(notify), cpu_id);
2665
2666 /* One unsigned long means the Guest did HCALL_NOTIFY */
2667 if (readval == sizeof(notify)) { 2648 if (readval == sizeof(notify)) {
2668 if (notify.trap == 0x1F) { 2649 if (notify.trap == 13) {
2669 verbose("Notify on address %#08x\n",
2670 notify.addr);
2671 handle_output(notify.addr);
2672 } else if (notify.trap == 13) {
2673 verbose("Emulating instruction at %#x\n", 2650 verbose("Emulating instruction at %#x\n",
2674 getreg(eip)); 2651 getreg(eip));
2675 emulate_insn(notify.insn); 2652 emulate_insn(notify.insn);