Fix inb when linux tests for the PIC
authorGan Shun <ganshun@gmail.com>
Thu, 4 Aug 2016 17:45:18 +0000 (10:45 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 4 Aug 2016 18:06:46 +0000 (11:06 -0700)
Previously we clobbered bits 63:8 of RAX when responding to this inb.
This is not technically correct. We now only change the low 8 bits.

Signed-off-by: Gan Shun <ganshun@gmail.com>
Change-Id: Iacb0c72cbbb0b4dfa229824c19ba4b000177e567
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/vmm/io.c

index 62766ee..b8fae46 100644 (file)
@@ -208,7 +208,7 @@ int io(struct guest_thread *vm_thread)
         */
        if (*ip16 == 0x21e4) {
                vm_tf->tf_rip += 2;
-               vm_tf->tf_rax = ~0ULL;
+               vm_tf->tf_rax |= 0x00000ff;
                return 0;
        }
        if (*ip16 == 0xed66) {