Hi, > A PS/2 keyboard has a separate command reply queue that is > independant of the key queue. This prevents that command replies > and keyboard input mix. Keyboard command replies take precedence > over queued keystrokes. A new keyboard command removes any > remaining command replies from the command reply queue. > > Implement a separate keyboard command reply queue and clear the > command reply queue before command execution. This brings the > PS/2 keyboard emulation much closer to a real PS/2 keyboard.
It seems you place both queues in the existing 256-byte buffer, probably to avoid breaking live migration. Could you explain the logic a bit more, how the three pointers q->*ptr variables play together here? thanks, Gerd