From patchwork Sun Dec 26 21:21:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 433231 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBRKCV59025997 for ; Mon, 27 Dec 2010 20:14:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752681Ab0LZVTf (ORCPT ); Sun, 26 Dec 2010 16:19:35 -0500 Received: from ssl.dlh.net ([91.198.192.8]:49509 "EHLO ssl.dlh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752634Ab0LZVTf convert rfc822-to-8bit (ORCPT ); Sun, 26 Dec 2010 16:19:35 -0500 Received: from localhost (localhost [127.0.0.1]) by ssl.dlh.net (Postfix) with ESMTP id 342241440EE; Sun, 26 Dec 2010 22:19:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ssl.dlh.net Received: from ssl.dlh.net ([127.0.0.1]) by localhost (ssl.dlh.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id snZwjsA3AmQB; Sun, 26 Dec 2010 22:19:32 +0100 (CET) Received: from peter-lievens-macbook-pro.fritz.box (unknown [82.141.21.121]) by ssl.dlh.net (Postfix) with ESMTPSA id D34711438FA; Sun, 26 Dec 2010 22:19:31 +0100 (CET) Subject: FIXED: Re: [Qemu-devel] possible regression in qemu-kvm 0.13.0 (memtest) Mime-Version: 1.0 (Apple Message framework v1081) From: Peter Lieven In-Reply-To: Date: Sun, 26 Dec 2010 22:21:45 +0100 Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, kvm@vger.kernel.org Message-Id: References: <5C297A9E-0B1C-4273-9A7B-8190CE4DB87E@dlh.net> To: Peter Lieven , Blue Swirl X-Mailer: Apple Mail (2.1081) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 27 Dec 2010 20:14:06 +0000 (UTC) --- qemu-0.13.0/hw/pckbd.c 2010-10-15 22:56:09.000000000 +0200 +++ qemu-0.13.0-fix/hw/pckbd.c 2010-12-26 19:38:35.835114033 +0100 @@ -212,13 +212,16 @@ static void ioport92_write(void *opaque, uint32_t addr, uint32_t val) { KBDState *s = opaque; - - DPRINTF("kbd: write outport=0x%02x\n", val); - s->outport = val; - if (s->a20_out) { - qemu_set_irq(*s->a20_out, (val >> 1) & 1); + if (val & 0x02) { // bit 1: enable/disable A20 + if (s->a20_out) qemu_irq_raise(*s->a20_out); + s->outport |= KBD_OUT_A20; + } + else + { + if (s->a20_out) qemu_irq_lower(*s->a20_out); + s->outport &= ~KBD_OUT_A20; } - if (!(val & 1)) { + if ((val & 1)) { // bit 0: raised -> fast reset qemu_system_reset_request(); } } @@ -226,11 +229,8 @@ static uint32_t ioport92_read(void *opaque, uint32_t addr) { KBDState *s = opaque; - uint32_t ret; - - ret = s->outport; - DPRINTF("kbd: read outport=0x%02x\n", ret); - return ret; + return (s->outport & 0x02); // only bit 1 (KBD_OUT_A20) of port 0x92 is identical to s->outport + /* XXX: bit 0 is fast reset, bits 6-7 hdd activity */ } static void kbd_write_command(void *opaque, uint32_t addr, uint32_t val) @@ -340,7 +340,9 @@ kbd_queue(s, val, 1); break; case KBD_CCMD_WRITE_OUTPORT: - ioport92_write(s, 0, val); + ioport92_write(s, 0, (ioport92_read(s,0) & 0xfc) // copy bits 2-7 of 0x92 + | (val & 0x02) // bit 1 (enable a20) + | (~val & 0x01)); // bit 0 (fast reset) of port 0x92 has inverse logic break; case KBD_CCMD_WRITE_MOUSE: ps2_write_mouse(s->mouse, val);