From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D024606A32E for ; Mon, 30 Nov 2026 05:34:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JRVEmlWg Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xXu1l-0003CY-35; Mon, 30 Nov 2026 00:34:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xXu1g-0003Bg-TH; Mon, 30 Nov 2026 00:34:09 -0500 Received: from tor.source.kernel.org ([172.105.4.254]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xXu1f-0004xb-09; Mon, 30 Nov 2026 00:34:08 -0500 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 56922612B7; Mon, 30 Nov 2026 05:34:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13D571F00897; Mon, 30 Nov 2026 05:34:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796016845; bh=m9jlwqxaPBurt8zegyjuw7TBHCq/MLqTMAUHgRvmGvY=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=JRVEmlWgCa8oedsO61V6Z2aOx3JghzA2HzrUMIFnVF7CEoOXysrWr1LDgRq2DXgxf lElDWIx12GmAvBV1j3Q7NU4An/lqnJ869r2u2pGz7JTta+VCCy//1ixSgjDm61wmrB rNMbkqfCox021uhmCFcnomTqEabdIVJxrX7cdx/w5Amhc7IbACrRRCcotu4+YzyjMN znYTgEOkyeaAdN3ejb69tZrys0C4iZiL1jD9U8NoMtY+Z/Hb5/8zs95FI5lfYVSmaE BY92DdR76YJ34seeoHOEsRZR3Af1C/u0/n/Z8T4tsDKrjYwY2zHc10oRgMuF8Gbujz 6fN3LiEHosoeg== Message-ID: <2a345599-4950-4aaa-9dae-29dfdd2a0f6d@kernel.org> Date: Mon, 30 Nov 2026 14:34:02 +0900 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 09/13] hw/ide: implement the NCQ Command Error log (10h) To: Niklas Cassel , John Snow , "Denis V. Lunev" , Fabiano Rosas , Laurent Vivier , Paolo Bonzini Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org References: <20261127191250.3298004-1-cassel@kernel.org> <20261127191250.3298004-10-cassel@kernel.org> From: Damien Le Moal Content-Language: en-US Organization: Western Digital Research In-Reply-To: <20261127191250.3298004-10-cassel@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=172.105.4.254; envelope-from=dlemoal@kernel.org; helo=tor.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 11/28/26 04:12, Niklas Cassel wrote: > As per ACS-6 9.15, when an NCQ command fails, the device enter the NCQ > error state, and the host shall read the NCQ Command Error log (10h) to > find out which command that failed. > > The NCQ Command Error log is a mandatory part of the NCQ feature set. > QEMU did not implement this mandatory part, making it impossible for the > host to know which command that failed. > > Record the failed command in the log, with its sense data through NCQ > Autosense. Report INVALID COMMAND OPERATION CODE for an unsupported NCQ > command, INVALID FIELD IN CDB for an invalid RECEIVE FPDMA QUEUED, and > none for a failed read or write. > > A PRDT that is too short for the transfer is detected by the HBA, not > the device (AHCI 1.3.1 6.1.5), so for that case, the command is only > released and OFS raised, without recording an error. > > Once the device has entered the NCQ error state (see DFPDMAQ11 to > DFPDMAQ15), the outstanding NCQ commands neither complete nor fail, and > new commands are aborted (except for a READ LOG of the NCQ Command Error > log) or the port is reset. > > Add qtests for the log contents, the error state and the sense data. > > Signed-off-by: Niklas Cassel Looks OK to me. Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research