Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5662315ybi; Tue, 28 May 2019 17:23:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzm1vtRN3kmQlR3zPSrLZcGY8dgpB3r4Oi7qr/XCrR0At3LyEQpK6Unj4UQirBj0esTmLdu X-Received: by 2002:a63:1d02:: with SMTP id d2mr134738153pgd.26.1559089414976; Tue, 28 May 2019 17:23:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559089414; cv=none; d=google.com; s=arc-20160816; b=Vf/p0Vkvapt7i6ptrL1885lpfUJRNvSWbzBoXnnTq4g/l9K/HrcXkYzk9Sy1ENi5a2 YWDfNNqQNKBb7zQ1mPktuW49VP+pLGnHXqWxHt4zVejCeCScbo6zPJVb+5eu3m/XId2W s2MFK9ToJNgyWkEzyzqIH3/dr6fZASGC7Fv1ne9hx/Kyb0BQUtpvHWtlxc01zGV9C/Vx GUuJ4Ghp7AchSudeSMdmjK5Ka+GDltm59x4r73a0ySINgM7j8almrfDTdzAAxWa/Gcfu LiGp1GZMysJY4aGUs/J+PbbFfqszBlvU1dDMGORCAoWTGkTJDcay4Ya7qn1MPmXgTpJd 1PHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date; bh=ImTZjbShYe7QD1CmYnF3hak1JmPZVgfzeH7UD9GaZU0=; b=L1sfO1A/1tuKfxGmqUxIgf/W8OnvU4TOPaYaTs1dT/foBVpwmmY1loMIDDh9GgBmk8 REkjB5PYf7YR9Ir4YfrvcSm7vLAgAuOMHAZR3W2IZNABenHQXK9UD/k5RDyQNONHTm02 76MayX3lVmojM9gW1JKWWnFePiM1mrQP1uSMM2ytshxeWqI4DH5+Ae3NREAGABUKRxve 6p2MpGAkhnztmV0TmwZZ7+ziPASweeD2DRFqIzY0a403PjxTG3365OrlHOVEmAk144FD EgM4RMFp8d9zIejrtAZBHlrt0LUXkYIKydi1gLeJG8+Wr0DN4KD734W1i5VZjUO1f3jh oVFw== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4si23609616pgp.307.2019.05.28.17.23.19; Tue, 28 May 2019 17:23:34 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726996AbfE2AWQ (ORCPT + 99 others); Tue, 28 May 2019 20:22:16 -0400 Received: from mga18.intel.com ([134.134.136.126]:26926 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbfE2AWP (ORCPT ); Tue, 28 May 2019 20:22:15 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 17:22:14 -0700 X-ExtLoop1: 1 Received: from joy-optiplex-7040.sh.intel.com (HELO joy-OptiPlex-7040) ([10.239.13.9]) by orsmga005.jf.intel.com with ESMTP; 28 May 2019 17:22:09 -0700 Date: Tue, 28 May 2019 20:16:25 -0400 From: Yan Zhao To: Cornelia Huck Cc: "cjia@nvidia.com" , "kvm@vger.kernel.org" , "aik@ozlabs.ru" , "Zhengxiao.zx@alibaba-inc.com" , "shuangtai.tst@alibaba-inc.com" , "qemu-devel@nongnu.org" , "kwankhede@nvidia.com" , "eauger@redhat.com" , "Liu, Yi L" , "eskultet@redhat.com" , "Yang, Ziye" , "mlevitsk@redhat.com" , "pasic@linux.ibm.com" , "libvir-list@redhat.com" , "felipe@nutanix.com" , "Ken.Xue@amd.com" , "Tian, Kevin" , "dgilbert@redhat.com" , "zhenyuw@linux.intel.com" , "dinechin@redhat.com" , "alex.williamson@redhat.com" , "intel-gvt-dev@lists.freedesktop.org" , "Liu, Changpeng" , "berrange@redhat.com" , "linux-kernel@vger.kernel.org" , "Wang, Zhi A" , "jonathan.davies@nutanix.com" , "He, Shaopeng" Subject: Re: [PATCH v3 1/2] vfio/mdev: add migration_version attribute for mdev device Message-ID: <20190529001625.GG27438@joy-OptiPlex-7040> Reply-To: Yan Zhao References: <20190527034155.31473-1-yan.y.zhao@intel.com> <20190527034342.31523-1-yan.y.zhao@intel.com> <20190528105332.7c5a2f82.cohuck@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190528105332.7c5a2f82.cohuck@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 28, 2019 at 04:53:32PM +0800, Cornelia Huck wrote: > On Sun, 26 May 2019 23:43:42 -0400 > Yan Zhao wrote: > > > migration_version attribute is used to check migration compatibility > > between two mdev device of the same mdev type. > > s/device/devices/ > yes... sorry and thanks :) > > The key is that it's rw and its data is opaque to userspace. > > > > Userspace reads migration_version of mdev device at source side and > > writes the value to migration_version attribute of mdev device at target > > side. It judges migration compatibility according to whether the read > > and write operations succeed or fail. > > > > As this attribute is under mdev_type node, userspace is able to know > > whether two mdev devices are compatible before a mdev device is created. > > > > userspace needs to check whether the two mdev devices are of the same > > mdev type before checking the migration_version attribute. It also needs > > to check device creation parameters if aggregation is supported in > > future. > > > > __ userspace > > /\ \ > > / \write > > / read \ > > ________/__________ ___\|/_____________ > > | migration_version | | migration_version |-->check migration > > --------------------- --------------------- compatibility > > mdev device A mdev device B > > > > Cc: Alex Williamson > > Cc: Erik Skultety > > Cc: "Dr. David Alan Gilbert" > > Cc: Cornelia Huck > > Cc: "Tian, Kevin" > > Cc: Zhenyu Wang > > Cc: "Wang, Zhi A" > > Cc: Neo Jia > > Cc: Kirti Wankhede > > Cc: Daniel P. Berrang? > > Cc: Christophe de Dinechin > > > > Signed-off-by: Yan Zhao > > > > --- > > v3: > > 1. renamed version to migration_version > > (Christophe de Dinechin, Cornelia Huck, Alex Williamson) > > 2. let errno to be freely defined by vendor driver > > (Alex Williamson, Erik Skultety, Cornelia Huck, Dr. David Alan Gilbert) > > 3. let checking mdev_type be prerequisite of migration compatibility > > check. (Alex Williamson) > > 4. reworded example usage section. > > (most of this section came from Alex Williamson) > > 5. reworded attribute intention section (Cornelia Huck) > > > > v2: > > 1. added detailed intent and usage > > 2. made definition of version string completely private to vendor driver > > (Alex Williamson) > > 3. abandoned changes to sample mdev drivers (Alex Williamson) > > 4. mandatory --> optional (Cornelia Huck) > > 5. added description for errno (Cornelia Huck) > > --- > > Documentation/vfio-mediated-device.txt | 113 +++++++++++++++++++++++++ > > 1 file changed, 113 insertions(+) > > > > While I probably would have written a more compact description, your > version is fine with me as well. > > Reviewed-by: Cornelia Huck Thank you Cornelia! > _______________________________________________ > intel-gvt-dev mailing list > intel-gvt-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev