Received: from eggs.gnu.org ([2001:4830:134:3::10]:33164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgEXA-0003za-43 for qemu-devel@nongnu.org; Fri, 02 May 2014 10:34:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WgEX0-0007Cc-Sn for qemu-devel@nongnu.org; Fri, 02 May 2014 10:33:52 -0400 Received: from mail-ee0-x236.google.com ([2a00:1450:4013:c00::236]:35638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgEX0-0007CT-Lc for qemu-devel@nongnu.org; Fri, 02 May 2014 10:33:42 -0400 Received: by mail-ee0-f54.google.com with SMTP id b57so1290601eek.41 for ; Fri, 02 May 2014 07:33:41 -0700 (PDT) Received: from playground.lan (net-37-117-141-58.cust.vodafonedsl.it. [37.117.141.58]) by mx.google.com with ESMTPSA id x45sm5013195eeu.23.2014.05.02.07.33.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 May 2014 07:33:41 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 2 May 2014 16:33:21 +0200 Message-Id: <1399041202-26184-8-git-send-email-pbonzini@redhat.com> In-Reply-To: <1399041202-26184-1-git-send-email-pbonzini@redhat.com> References: <1399041202-26184-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH v2 7/8] pc: port 92 reset requires a low->high transition List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The PIIX datasheet says that "before another INIT pulse can be generated via [port 92h], [bit 0] must be written back to a zero. This bug is masked right now because a full reset will clear the value of port 92h. But once we implement soft reset correctly, the next attempt to enable the A20 line by setting bit 1 (and leaving the others untouched) will cause another reset. Reviewed-by: Anthony Liguori Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 14f0d91..a59e958 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -471,11 +471,12 @@ static void port92_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { Port92State *s = opaque; + int oldval = s->outport; DPRINTF("port92: write 0x%02x\n", val); s->outport = val; qemu_set_irq(*s->a20_out, (val >> 1) & 1); - if (val & 1) { + if ((val & 1) && !(oldval & 1)) { qemu_system_reset_request(); } } -- 1.8.3.1