From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBGbs-0006Vd-W7 for qemu-devel@nongnu.org; Sat, 04 Jul 2015 02:07:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZBGbo-0003We-Pt for qemu-devel@nongnu.org; Sat, 04 Jul 2015 02:07:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBGbo-0003WV-KL for qemu-devel@nongnu.org; Sat, 04 Jul 2015 02:07:28 -0400 From: John Snow Date: Sat, 4 Jul 2015 02:06:56 -0400 Message-Id: <1435990034-8945-18-git-send-email-jsnow@redhat.com> In-Reply-To: <1435990034-8945-1-git-send-email-jsnow@redhat.com> References: <1435990034-8945-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PULL 17/35] libqos/ahci: set the NCQ tag on command_commit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, jsnow@redhat.com NCQ commands have the concept of a "TAG" that they need to set, but in the AHCI world, it is mandated that the TAG always match the command slot that you executed the NCQ from. See AHCI 9.3.1.1.5.2 "Native Queued Commands". Signed-off-by: John Snow Reviewed-by: Stefan Hajnoczi Message-id: 1435016308-6150-14-git-send-email-jsnow@redhat.com --- tests/libqos/ahci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 953a320..7cf667a 100644 --- a/tests/libqos/ahci.c +++ b/tests/libqos/ahci.c @@ -857,6 +857,11 @@ void ahci_command_commit(AHCIQState *ahci, AHCICommand *cmd, uint8_t port) cmd->port = port; cmd->slot = ahci_pick_cmd(ahci, port); + if (cmd->props->ncq) { + NCQFIS *nfis = (NCQFIS *)&cmd->fis; + nfis->tag = (cmd->slot << 3) & 0xFC; + } + /* Create a buffer for the command table */ prdtl = size_to_prdtl(cmd->xbytes, cmd->prd_size); table_size = CMD_TBL_SIZ(prdtl); -- 2.1.0