From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcUaY-0001xQ-NA for qemu-devel@nongnu.org; Thu, 17 Sep 2015 04:30:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcUaX-0003iX-RL for qemu-devel@nongnu.org; Thu, 17 Sep 2015 04:30:42 -0400 Date: Thu, 17 Sep 2015 09:30:33 +0100 From: Stefan Hajnoczi Message-ID: <20150917083033.GD21734@stefanha-thinkpad.redhat.com> References: <1441140641-17631-1-git-send-email-jsnow@redhat.com> <1441140641-17631-3-git-send-email-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1441140641-17631-3-git-send-email-jsnow@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/4] ahci: fix signature generation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: kwolf@redhat.com, pbonzini@redhat.com, armbru@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org On Tue, Sep 01, 2015 at 04:50:39PM -0400, John Snow wrote: > The initial register device-to-host FIS no longer needs to specially > set certain fields, as these can be handled generically by setting those > fields explicitly with the signatures we want at port reset time. > > (1) Signatures are decomposed into their four component registers and > set upon (AHCI) port reset. > (2) the signature cache register is no longer set manually per-each > device type, but instead just once during ahci_init_d2h. > > Signed-off-by: John Snow > --- > hw/ide/ahci.c | 32 ++++++++++++++++++++------------ > 1 file changed, 20 insertions(+), 12 deletions(-) > > diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c > index d04a161..3c50ccb 100644 > --- a/hw/ide/ahci.c > +++ b/hw/ide/ahci.c > @@ -542,20 +542,31 @@ static void ahci_init_d2h(AHCIDevice *ad) > { > uint8_t init_fis[20]; > IDEState *ide_state = &ad->port.ifs[0]; > + AHCIPortRegs *pr = &ad->port_regs; > > memset(init_fis, 0, sizeof(init_fis)); > > - init_fis[4] = 1; > - init_fis[12] = 1; > - > - if (ide_state->drive_kind == IDE_CD) { > - init_fis[5] = ide_state->lcyl; > - init_fis[6] = ide_state->hcyl; > - } > + /* We're emulating receiving the first Reg H2D Fis from the device; > + * Update the SIG register, but otherwise procede as normal. */ s/procede/proceed/