From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaqOL-0000Nu-NZ for qemu-devel@nongnu.org; Mon, 28 Oct 2013 13:14:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VaqOE-0002gu-DV for qemu-devel@nongnu.org; Mon, 28 Oct 2013 13:14:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaqOE-0002gb-1v for qemu-devel@nongnu.org; Mon, 28 Oct 2013 13:14:06 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9SHE3R4015449 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 28 Oct 2013 13:14:03 -0400 Date: Mon, 28 Oct 2013 19:16:53 +0200 From: "Michael S. Tsirkin" Message-ID: <20131028171653.GA14263@redhat.com> References: <1382978620-16641-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1382978620-16641-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [WIP PATCH 00/24] IDE cleanups, initial work on AHCI rerror/werror=stop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Mon, Oct 28, 2013 at 05:43:16PM +0100, Paolo Bonzini wrote: > Hi all, > > this is some cleanup to the IDE code that I started long ago > and picked up again on my flight back from KVM Forum... > > The patches clean up the callbacks to prepare for implementing request > retry for AHCI. After these patches, PIO retry should work for AHCI and > non-NCQ retry should be very close (you need an implementation of the > new restart_dma callback). NCQ retry and save/restore is AHCI-specific > and has to be done separately, similar to how we do it for SCSI already. > > Patches 1-4 set up a new (incomplete) testcase. Patches 5-13 are no-op > cleanups, or so I hope. Patches 14-23 genericize retry and make it > "just work" for all adapters for PIO. Patch 24 is another cleanup that > could probably be moved earlier in the series. > > Throwing it out since I know Kevin and mst are working on AHCI, to avoid > doing duplicate work. Patches 2 and 4 are known to be racy and > incomplete. Extremely light testing, if something breaks tells me and > I'll look at it. > > Paolo Well ATM win7 boot is broken with non NCQ (crash on boot). Do you patches help? Also, without NCQ win 7 boot will sometime hang. The following patch by Alex makes it behave better: it still sometimes hangs for a very long time but with the patch it will after a long time proceed. Sometimes it proceeds normally. diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index a8be62c..fbea9e8 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -961,7 +961,8 @@ static int handle_cmd(AHCIState *s, int port, int slot) /* We're ready to process the command in FIS byte 2. */ ide_exec_cmd(&s->dev[port].port, cmd_fis[2]); - if (s->dev[port].port.ifs[0].status & READY_STAT) { + if ((s->dev[port].port.ifs[0].status & (READY_STAT|DRQ_STAT|BUSY_STAT)) == + READY_STAT) { ahci_write_fis_d2h(&s->dev[port], cmd_fis); } }