From: John Snow Date: Sat, 4 Jul 2015 06:06:04 +0000 (-0400) Subject: libqos/ahci: set the NCQ tag on command_commit X-Git-Tag: qemu-xen-4.7.0-rc1~198^2~18 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a8973ff50a04f96c3ce5c803c8fd3ec16ed8d6c5;p=qemu-xen.git libqos/ahci: set the NCQ tag on command_commit 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 --- diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 953a32097b..7cf667affd 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);