From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUD7v-0002FS-Ie for qemu-devel@nongnu.org; Mon, 22 Apr 2013 05:33:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUD7u-0003Lv-Ai for qemu-devel@nongnu.org; Mon, 22 Apr 2013 05:33:35 -0400 Received: from mail-qa0-x22c.google.com ([2607:f8b0:400d:c00::22c]:56021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUD7u-0003Lq-7M for qemu-devel@nongnu.org; Mon, 22 Apr 2013 05:33:34 -0400 Received: by mail-qa0-f44.google.com with SMTP id j8so290325qah.17 for ; Mon, 22 Apr 2013 02:33:33 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <517503E0.1080906@redhat.com> Date: Mon, 22 Apr 2013 11:33:20 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1366346658-4680-1-git-send-email-akong@redhat.com> <5172BD04.2050504@redhat.com> <20130422073252.GC1938@t430s.nay.redhat.com> <20130422080935.GA29975@t430s.nay.redhat.com> In-Reply-To: <20130422080935.GA29975@t430s.nay.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] monitor: intervally send down events to guest in hold time List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: lcapitulino@redhat.com, kraxel@redhat.com, qemu-devel@nongnu.org Il 22/04/2013 10:09, Amos Kong ha scritto: > On Mon, Apr 22, 2013 at 03:32:52PM +0800, Amos Kong wrote: >> On Sat, Apr 20, 2013 at 10:06:28AM -0600, Eric Blake wrote: >>> On 04/18/2013 10:44 PM, Amos Kong wrote: >>>> (qemu) sendkey a 1000 >>>> >>>> Current design is that qemu only send one down event to guest, >>>> and delay sometime, then send one up event. In this case, only >>>> key can be identified by guest. >>>> >>>> This patch changed qemu to intervally send down events to guest >>>> in the hold time, the interval is 100ms. >>> >>> I don't like this. >> >>> When you hold a key for a long time on bare metal, >>> there is only one down and one up event; >> >> Really? I do check events by 'showkey', the output of showkey is not the >> events sent from keyboard? >> >> # showkey -s (show keys' scancode) >> I can always see many down scancodes, and one up scancode. >> It's same when I disable / enable auto-repeat mode in system. >> >> In the real host / vnc guest/ sdl guest, hold one key, many down >> events can be checked by showkey. > > # watch cat /proc/interrupts > CPU0 CPU1 CPU2 CPU3 > 1: 1692 40309 1462 1795 IO-APIC-edge i8042 > > hit a botton without long-time holding, interrupt count increased 2. > hit a botton with long-time holding, interrupt count increased a lot (more than 2) You're right. The typematic delay/rate is implemented within the i8042 keyboard microcontroller (QEMU does not implement that register). It is possible that software ignores interrupts for a key that is already down, and reimplements autorepeat in software, but your patch is correct. Paolo