From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73786C433F5 for ; Wed, 15 Sep 2021 15:57:42 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D82C661157 for ; Wed, 15 Sep 2021 15:57:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D82C661157 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:47886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQXI4-0008UN-Sh for qemu-devel@archiver.kernel.org; Wed, 15 Sep 2021 11:57:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQXGO-0007Fw-TI; Wed, 15 Sep 2021 11:55:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:60112) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQXGM-0008Hm-TM; Wed, 15 Sep 2021 11:55:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A074260BD3; Wed, 15 Sep 2021 15:55:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631721351; bh=2ZZn3sGcETYHyWcTlrCWnzp9asDOTRWblOngQTvX8UA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iEZWo/BA37C62vzbd+eF5pfplgZckM3Sg403CQiYJO5W9N62Q7mv0iOdzBURgrzSk /OFCpx6/PyWyVa/3IUifwwfec1thMNuGvUeu7hcumFgF+0yLu7V9+e0c7CTrbOygj/ Pq5zsEnFZ4AtqJdyhGLGfpfxULtvqaa62DeLnFXj/10kamLAvVLHVTl+hUVFUh/Yb2 7VuzdQPPhYOWJoqOZN66FbwmssS6HbOovVH/NQLeEkRSkV1JqE97WjgRHREyjMosPm s8mwptaJBId5M7zNkOwVb4WqA5XLCYK3Qrr7ZrQoyJJNoWwDC/H1MmFVsJ3D8dtejh CFIwYhMQtkPxg== Date: Wed, 15 Sep 2021 08:55:48 -0700 From: Keith Busch To: Pankaj Raghav Subject: Re: [PATCH v2] hw/nvme: Return error for fused operations Message-ID: <20210915155548.GB3850143@dhcp-10-100-145-180.wdc.com> References: <8df37610-0200-d02a-7281-30b22718201d@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8df37610-0200-d02a-7281-30b22718201d@samsung.com> Received-SPF: pass client-ip=198.145.29.99; envelope-from=kbusch@kernel.org; helo=mail.kernel.org X-Spam_score_int: -74 X-Spam_score: -7.5 X-Spam_bar: ------- X-Spam_report: (-7.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: its@irrelevant.dk, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wed, Sep 15, 2021 at 05:43:30PM +0200, Pankaj Raghav wrote: > Currently, FUSED operations are not supported by QEMU. As per the 1.4 SPEC, > controller should abort the command that requested a fused operation with > an INVALID FIELD error code if they are not supported. > > Changes from v1: > Added FUSE flag check also to the admin cmd processing as the FUSED > operations are mentioned in the general SQE section in the SPEC. Just for future reference, the changes from previous versions should go below the "---" line so that they don't get included in the official changelog. > + if (NVME_CMD_FLAGS_FUSE(req->cmd.flags)) { > + return NVME_INVALID_FIELD; > + } > + > req->ns = ns; > > switch (req->cmd.opcode) { > @@ -5475,6 +5479,10 @@ static uint16_t nvme_admin_cmd(NvmeCtrl *n, NvmeRequest *req) > return NVME_INVALID_FIELD | NVME_DNR; > } > > + if (NVME_CMD_FLAGS_FUSE(req->cmd.flags)) { > + return NVME_INVALID_FIELD; > + } I'm a little surprised this macro exists considering this is the first time it's used! But this looks fine, I really hope hosts weren't actually trying fused commands on this target, but it's good to confirm. Reviewed-by: Keith Busch