lguest: suppress PS/2 keyboard polling.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 11 Feb 2015 04:45:10 +0000 (15:15 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 11 Feb 2015 06:17:32 +0000 (16:47 +1030)
While hacking on getting I/O out to the lguest launcher, I noticed
that returning 0xFF for the PS/2 keyboard status made it spin for a
while thinking there was a key pending.  Fix this by returning 1
instead of 0xFF.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools/lguest/lguest.c

index b2217657f62cf3ec275fc0bd7a0ca33e92fde15e..485fe13db12e5808f9298577c0811f55f8488efa 100644 (file)
@@ -1259,6 +1259,10 @@ static void emulate_insn(const u8 insn[])
        else
                mask = 0xFFFFFFFF;
 
+       /* This is the PS/2 keyboard status; 1 means ready for output */
+       if (port == 0x64)
+               val = 1;
+
        /*
         * If it was an "IN" instruction, they expect the result to be read
         * into %eax, so we change %eax.