Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7484640rwb; Tue, 6 Dec 2022 06:24:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf4h7jey565HJ5ub0l8aiHZ2HkdCC18QnulWfDi3qcGRxG9nUpGIW0isYWksb33zrn7+jFcT X-Received: by 2002:a17:906:d8a6:b0:7c0:b741:8b61 with SMTP id qc6-20020a170906d8a600b007c0b7418b61mr18669967ejb.625.1670336666519; Tue, 06 Dec 2022 06:24:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670336666; cv=none; d=google.com; s=arc-20160816; b=axeyHjDUq2iiMQ9m2hLqc8vkH5abts1Q6ezGYw4fK14dDTTKydwp1KwtJgyPMYvsyG h169G4yvAa+peV3v7HgamkaaDaOHiwz6zZywUa5VxnkDEXvq6Ze+1XubtzOBrNGeJj/N g3oDa/HNcvMkXatW8Q2/pKXAQGmSmYrCknMGoK5Xfk3HQ/OunmznScktS/YcF3rZAhFV /JnUB5a0dSoPci+vAsSkvdEv2gSy41uSUWubLC73w8yeizaiFlFyFY5o8R3UWj3CpubH 8zATwbyEVspktawyQCKxzGoLvwmiphtHa4aQXYoGlLCdRYXO1GyOUDWr58iShx4b+MIF MwAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=x/F73bhC9vmaG0huNlBhFWiZSQ3nKQuQkWd8Dmu/Zbs=; b=bGQlPyKU2WCCbbGAN69iYx5YKFo4Ue0tnCr8hQ1afmIx8OcYodm5dhf0io1IqNTHRF 5GpGyO7xd8FkzIbAGjrjnvrsSjadRMLJzw9g5zQ8tPej3edZG5Tzy1dcCw2tHYCN/H42 7TgCI2w/e9n7Crk41Tv7zN5fGoYlNOp+zAj1F7MIiYY9QUMi3GvaKHaXQI2vK0/eB9lq jXlIDKSsYHSQi9dRRTUBtmMtbkYepRefXmYptpn44H1ppI7FlRsmKGYkbI+WjgXD2ath Fg8/8QfwJCoKVS0XkeemRJLZnJkLbEkQkJXXuDw10zGMbsfISxhYWV9s8mWB4bZvIsMK pdIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g2omVqEN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg11-20020a170907a40b00b0078de51e1c3dsi10705806ejc.840.2022.12.06.06.24.07; Tue, 06 Dec 2022 06:24:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g2omVqEN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234671AbiLFNsX (ORCPT + 80 others); Tue, 6 Dec 2022 08:48:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234494AbiLFNsH (ORCPT ); Tue, 6 Dec 2022 08:48:07 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56393A1B7; Tue, 6 Dec 2022 05:48:02 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 698F161769; Tue, 6 Dec 2022 13:48:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A421C433D6; Tue, 6 Dec 2022 13:47:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670334481; bh=2JYS2naf9E4zAIWrMEAyI5LO342tnYyw1XzP6ZaY6B0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g2omVqENBHzAwHg4smn2aRF4jnFXHRhuOxYLek0wV9y2ANZ2ICNy6r0t127kPwEV0 UjavF360bI6edL/lh71+UcGZNDZ/DytjcFKG9VK9c51vticZtLv0+Hk0SlyHnsxjao lJXBTxkbA5Ll6lfiID3UUbbAzDvJggsJNUB9i+WfoPG0Dg3JfigCMu1JryIv9eRIWQ wZ1zQD0qSyPTbdJDBmg6qZYEyP+W8BvvuZoTlKbDN8tIsboJw0yLX2xkMyNqvfi2cr 9lrQf4LBdD3F7C6G+EzJUFqSlBTT12XpLHzpAboz93x+CLRpIQ6JDbuLhSsF2bOuzf ef8Wbrq3e/8/A== Date: Tue, 6 Dec 2022 13:47:55 +0000 From: Keith Busch To: Lei Rao Cc: axboe@fb.com, kch@nvidia.com, hch@lst.de, sagi@grimberg.me, alex.williamson@redhat.com, cohuck@redhat.com, jgg@ziepe.ca, yishaih@nvidia.com, shameerali.kolothum.thodi@huawei.com, kevin.tian@intel.com, mjrosato@linux.ibm.com, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, kvm@vger.kernel.org, eddie.dong@intel.com, yadong.li@intel.com, yi.l.liu@intel.com, Konrad.wilk@oracle.com, stephen@eideticom.com, hang.yuan@intel.com Subject: Re: [RFC PATCH 4/5] nvme-vfio: check if the hardware supports live migration Message-ID: References: <20221206055816.292304-1-lei.rao@intel.com> <20221206055816.292304-5-lei.rao@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221206055816.292304-5-lei.rao@intel.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 06, 2022 at 01:58:15PM +0800, Lei Rao wrote: > +static bool nvmevf_check_migration(struct pci_dev *pdev) > +{ > + struct nvme_command c = { }; > + struct nvme_id_ctrl *id; > + u8 live_mig_support; > + int ret; > + > + c.identify.opcode = nvme_admin_identify; > + c.identify.cns = NVME_ID_CNS_CTRL; > + > + id = kmalloc(sizeof(struct nvme_id_ctrl), GFP_KERNEL); > + if (!id) > + return false; > + > + ret = nvme_submit_vf_cmd(pdev, &c, NULL, id, sizeof(struct nvme_id_ctrl)); > + if (ret) { > + dev_warn(&pdev->dev, "Get identify ctrl failed (ret=0x%x)\n", ret); > + goto out; > + } > + > + live_mig_support = id->vs[0]; Considering this is a vendor specific region, it seems rather presumptuous to assume this byte means "live migration supported".