From: David Miller Subject: Re: [PATCH net V4] vhost: log dirty page correctly Date: Thu, 17 Jan 2019 11:58:55 -0800 (PST) Message-ID: <20190117.115855.725358558291814993.davem@davemloft.net> References: <20190116085442.3836-1-jasowang@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: mst@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jintack@cs.columbia.edu To: jasowang@redhat.com Return-path: In-Reply-To: <20190116085442.3836-1-jasowang@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org From: Jason Wang Date: Wed, 16 Jan 2019 16:54:42 +0800 > Vhost dirty page logging API is designed to sync through GPA. But we > try to log GIOVA when device IOTLB is enabled. This is wrong and may > lead to missing data after migration. > > To solve this issue, when logging with device IOTLB enabled, we will: > > 1) reuse the device IOTLB translation result of GIOVA->HVA mapping to > get HVA, for writable descriptor, get HVA through iovec. For used > ring update, translate its GIOVA to HVA > 2) traverse the GPA->HVA mapping to get the possible GPA and log > through GPA. Pay attention this reverse mapping is not guaranteed > to be unique, so we should log each possible GPA in this case. > > This fix the failure of scp to guest during migration. In -next, we > will probably support passing GIOVA->GPA instead of GIOVA->HVA. > > Fixes: 6b1e6cc7855b ("vhost: new device IOTLB API") > Reported-by: Jintack Lim > Cc: Jintack Lim > Signed-off-by: Jason Wang Michaell, can I get a review for this please? Thank you.