Removed more patches to linux
authorKyle Milka <kmilka1995@gmail.com>
Fri, 1 Jul 2016 16:19:35 +0000 (09:19 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 6 Jul 2016 15:41:41 +0000 (11:41 -0400)
Sets up the EBDA and adds a command line option that allows
us to run the master branch of Linux.

Change-Id: Ib9af5c3bbdf120ca6264966fc4ad39d2c3f68aa8
Signed-off-by: Kyle Milka <kmilka@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tests/vmm/vmrunkernel.c
user/vmm/decode.c

index dd8d873..034b4fc 100644 (file)
@@ -318,7 +318,8 @@ int main(int argc, char **argv)
                                    " init=/bin/launcher"
                                    " lapic=notscdeadline"
                                    " lapictimerfreq=1000000"
-                                   " pit=none";
+                                   " pit=none"
+                                   " noinvpcid";
        char *cmdline_extra = "\0";
        char *cmdline;
        uint64_t *p64;
@@ -359,9 +360,8 @@ int main(int argc, char **argv)
        memset(lowmem, 0xff, 2*1048576);
        vm->low4k = malloc(PGSIZE);
        memset(vm->low4k, 0xff, PGSIZE);
-       // avoid at all costs, requires too much instruction emulation.
-       //low4k[0x40e] = 0;
-       //low4k[0x40f] = 0xe0;
+       vm->low4k[0x40e] = 0;
+       vm->low4k[0x40f] = 0;
 
        //Place mmap(Gan)
        a_page = mmap((void *)0xfee00000, PGSIZE, PROT_READ | PROT_WRITE,
index 39910d6..a38438c 100644 (file)
@@ -99,7 +99,7 @@ static int target(void *insn, int *store)
        case 0x0f:
        switch(*word) {
                case 0xb70f:
-                       s = 4;
+                       s = 2;
                        break;
                default:
                        fprintf(stderr, "can't get size of %02x/%04x @ %p\n", *byte, *word, byte);
@@ -114,6 +114,8 @@ static int target(void *insn, int *store)
        }
 
        switch(*byte) {
+       case 0x0f:
+               break;
        case 0x3a:
        case 0x8a:
        case 0x88:
@@ -123,7 +125,7 @@ static int target(void *insn, int *store)
                *store = !(*byte & 2);
                break;
        default:
-               fprintf(stderr, "%s: Can't happen\n", __func__);
+               fprintf(stderr, "%s: Can't happen. rip is: %p\n", __func__, byte);
                break;
        }
        return s;
@@ -224,7 +226,7 @@ int decode(struct guest_thread *vm_thread, uint64_t *gpa, uint8_t *destreg,
 
        *advance = insize(kva);
 
-       uint16_t ins = *(uint16_t *)(kva + (kva[0] == 0x44));
+       uint16_t ins = *(uint16_t *)(kva + (kva[0] == 0x44) + (kva[0] == 0x0f));
        DPRINTF("ins is %04x\n", ins);
 
        *destreg = (ins>>11) & 7;