VMMCP: EPT failures: don't exit, return all f's
authorRonald G. Minnich <rminnich@gmail.com>
Mon, 14 Sep 2015 17:00:24 +0000 (10:00 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 2 Nov 2015 23:53:50 +0000 (18:53 -0500)
On real hardware, a read outside memory returns all 1s. In some cases
kernels count on this. We can't rewrite every single place, so just
return all 1's for now.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tests/vmm/vmrunkernel.c

index 9ceefab..2859e26 100644 (file)
@@ -559,9 +559,10 @@ printf("%p %p %p %p\n", PGSIZE, PGSHIFT, PML1_SHIFT, PML1_PTE_REACH);
                        } else {
                                printf("EPT violation: can't handle %p\n", gpa);
                                printf("RIP %p, shutdown 0x%x\n", vmctl.regs.tf_rip, vmctl.shutdown);
+                               printf("Returning 0xffffffff\n");
                                showstatus(stdout, &vmctl);
-                               quit = 1;
-                               break;
+                               // Just fill the whole register for now.
+                               *regp = (uint64_t) -1;
                        }
                        vmctl.regs.tf_rip += advance;
                        if (debug) printf("Advance rip by %d bytes to %p\n", advance, vmctl.regs.tf_rip);