From patchwork Mon Jun 22 23:38:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 487436 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D45D114012C for ; Tue, 23 Jun 2015 09:47:26 +1000 (AEST) Received: from localhost ([::1]:42532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7BQz-0005hS-19 for incoming@patchwork.ozlabs.org; Mon, 22 Jun 2015 19:47:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7BIb-0001Tm-TQ for qemu-devel@nongnu.org; Mon, 22 Jun 2015 19:38:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7BIb-0005L1-1W for qemu-devel@nongnu.org; Mon, 22 Jun 2015 19:38:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7BIX-0005JU-Fj; Mon, 22 Jun 2015 19:38:41 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 1E8D5359A6C; Mon, 22 Jun 2015 23:38:41 +0000 (UTC) Received: from scv.usersys.redhat.com (dhcp-17-29.bos.redhat.com [10.18.17.29]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5MNcTeI023300; Mon, 22 Jun 2015 19:38:40 -0400 From: John Snow To: qemu-block@nongnu.org Date: Mon, 22 Jun 2015 19:38:25 -0400 Message-Id: <1435016308-6150-14-git-send-email-jsnow@redhat.com> In-Reply-To: <1435016308-6150-1-git-send-email-jsnow@redhat.com> References: <1435016308-6150-1-git-send-email-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, pbonzini@redhat.com, John Snow , qemu-devel@nongnu.org, stefanha@redhat.com Subject: [Qemu-devel] [PATCH v2 13/16] libqos/ahci: set the NCQ tag on command_commit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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);