aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2015-02-10 23:57:01 -0500
committerRusty Russell <rusty@rustcorp.com.au>2015-02-11 01:17:45 -0500
commit00f8d546512a7661d43600625f87a42a98cae26a (patch)
treebcd7a3e192674123341e35e45ec1a7e9517ae6d3 /tools
parenta561adfaecc9eb6fb66941b450458801f3f60ca0 (diff)
lguest: remove NOTIFY facility from demonstration launcher.
This was only used for early console, now we can get rid of it altogether. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'tools')
-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);