Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp969604yba; Thu, 9 May 2019 08:40:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHzFoWijXA56Nc0pogfGsjbVG1P0XO0q/ddly/LTt3uTMEwNWCb/F0Ur+PoIty08D7QPY+ X-Received: by 2002:a62:43d1:: with SMTP id l78mr6253663pfi.124.1557416427696; Thu, 09 May 2019 08:40:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557416427; cv=none; d=google.com; s=arc-20160816; b=Vq3h9G16EhvgU4MYBMmNtM0QV62Gull0uFD7LIBuuBbCnUBzrxIlTqiVqA/HUAxjnt FHi5VwlzUVu8h7EMtAYXWiCSwZ69Ci+dVJtfWXxp/scn9lWaefpdM5OHQuRgYI/aIQG7 LkdSbCYmOmlWluxYgfr5UAxOimLlohJaTUpMTBsiSsfmPWr3t1LLxyfSM6Klypyl2nTa 7ZERMwd0qYSv2YmSqJC3rs2o0h5tY+MkIErBoH5EyXxLn0y3q6ON5W4zFIQ3FHTs0w+C Fu8BaRPZa6hQCiU5Xi1niZZtCvkW4zxm2tTLmbFygXonOHe2uUmFfUT9hThHleGhYOqI D3Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=wM0Hcd3PNi2fdz7Q5bvKpkSxLpQLbmAcqkPfEsEtzys=; b=aDHcV7grSJLHYBV2RE8/v3mvLTlT0JLKObbCKJ/pGs5BHAjwJ15chvveBBylOpQ1Wm S3rgcyjAoGJtVJKNvSliMBUBKFm6puohyRDDVaqSeBZNX3XMEP9pRQ25LUFQmJIA2eBL iGEr4f893FrRSSCW7hhkl5fMSoVB8ae8TfhmRwOoJwuuU7uqUDilVMssbeu4tMBvXNop xcyaynX+Me6s+Zz1fkYazR9RBNKuekWqhtoqEZGmmn8rSjlShGFSfC65Mp++rhzHthNQ 4ignbUPJCblZRjehwTddDPDJlTY2Ykj0YkE0hy0IyRzRg5vdEOyHUrcCsaw5zq3vFUNq Uu7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j23si3456989pgg.541.2019.05.09.08.40.11; Thu, 09 May 2019 08:40:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726714AbfEIPi7 (ORCPT + 99 others); Thu, 9 May 2019 11:38:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53930 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726650AbfEIPi7 (ORCPT ); Thu, 9 May 2019 11:38:59 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ACEFF307D9CE; Thu, 9 May 2019 15:38:56 +0000 (UTC) Received: from gondolin (dhcp-192-213.str.redhat.com [10.33.192.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8403279B9; Thu, 9 May 2019 15:38:41 +0000 (UTC) Date: Thu, 9 May 2019 17:38:39 +0200 From: Cornelia Huck To: Alex Williamson Cc: Yan Zhao , intel-gvt-dev@lists.freedesktop.org, arei.gonglei@huawei.com, aik@ozlabs.ru, Zhengxiao.zx@alibaba-inc.com, shuangtai.tst@alibaba-inc.com, qemu-devel@nongnu.org, eauger@redhat.com, yi.l.liu@intel.com, ziye.yang@intel.com, mlevitsk@redhat.com, pasic@linux.ibm.com, felipe@nutanix.com, changpeng.liu@intel.com, Ken.Xue@amd.com, jonathan.davies@nutanix.com, shaopeng.he@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, libvir-list@redhat.com, eskultet@redhat.com, dgilbert@redhat.com, kevin.tian@intel.com, zhenyuw@linux.intel.com, zhi.a.wang@intel.com, cjia@nvidia.com, kwankhede@nvidia.com, berrange@redhat.com, dinechin@redhat.com Subject: Re: [PATCH v2 1/2] vfio/mdev: add version attribute for mdev device Message-ID: <20190509173839.2b9b2b46.cohuck@redhat.com> In-Reply-To: <20190507151826.502be009@x1.home> References: <20190506014514.3555-1-yan.y.zhao@intel.com> <20190506014904.3621-1-yan.y.zhao@intel.com> <20190507151826.502be009@x1.home> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 09 May 2019 15:38:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 7 May 2019 15:18:26 -0600 Alex Williamson wrote: > On Sun, 5 May 2019 21:49:04 -0400 > Yan Zhao wrote: > > + Errno: > > + If vendor driver wants to claim a mdev device incompatible to all other mdev > > + devices, it should not register version attribute for this mdev device. But if > > + a vendor driver has already registered version attribute and it wants to claim > > + a mdev device incompatible to all other mdev devices, it needs to return > > + -ENODEV on access to this mdev device's version attribute. > > + If a mdev device is only incompatible to certain mdev devices, write of > > + incompatible mdev devices's version strings to its version attribute should > > + return -EINVAL; > > I think it's best not to define the specific errno returned for a > specific situation, let the vendor driver decide, userspace simply > needs to know that an errno on read indicates the device does not > support migration version comparison and that an errno on write > indicates the devices are incompatible or the target doesn't support > migration versions. I think I have to disagree here: It's probably valuable to have an agreed error for 'cannot migrate at all' vs 'cannot migrate between those two particular devices'. Userspace might want to do different things (e.g. trying with different device pairs).