From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752860AbcFFQEb (ORCPT ); Mon, 6 Jun 2016 12:04:31 -0400 Received: from mail-vk0-f46.google.com ([209.85.213.46]:33145 "EHLO mail-vk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751741AbcFFQE3 (ORCPT ); Mon, 6 Jun 2016 12:04:29 -0400 MIME-Version: 1.0 In-Reply-To: References: <20151213212557.5410.48577.stgit@localhost.localdomain> <20160104204104.GB17427@char.us.oracle.com> <20160105113317-mutt-send-email-mst@redhat.com> From: Alex Duyck Date: Mon, 6 Jun 2016 09:04:27 -0700 Message-ID: Subject: Re: Re: [Qemu-devel] [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking To: Zhou Jie Cc: Alexander Duyck , "Michael S. Tsirkin" , Lan Tianyu , Yang Zhang , Alex Williamson , kvm@vger.kernel.org, Konrad Rzeszutek Wilk , "linux-pci@vger.kernel.org" , x86@kernel.org, "linux-kernel@vger.kernel.org" , qemu-devel@nongnu.org, Alexander Graf , "Dr. David Alan Gilbert" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 6, 2016 at 2:18 AM, Zhou Jie wrote: > Hi Alex, > > > On 2016/1/6 0:18, Alexander Duyck wrote: >> >> On Tue, Jan 5, 2016 at 1:40 AM, Michael S. Tsirkin wrote: >>> >>> On Mon, Jan 04, 2016 at 07:11:25PM -0800, Alexander Duyck wrote: >>>>>> >>>>>> The two mechanisms referenced above would likely require coordination >>>>>> with >>>>>> QEMU and as such are open to discussion. I haven't attempted to >>>>>> address >>>>>> them as I am not sure there is a consensus as of yet. My personal >>>>>> preference would be to add a vendor-specific configuration block to >>>>>> the >>>>>> emulated pci-bridge interfaces created by QEMU that would allow us to >>>>>> essentially extend shpc to support guest live migration with >>>>>> pass-through >>>>>> devices. >>>>> >>>>> >>>>> shpc? >>>> >>>> >>>> That is kind of what I was thinking. We basically need some mechanism >>>> to allow for the host to ask the device to quiesce. It has been >>>> proposed to possibly even look at something like an ACPI interface >>>> since I know ACPI is used by QEMU to manage hot-plug in the standard >>>> case. >>>> >>>> - Alex >>> >>> >>> >>> Start by using hot-unplug for this! >>> >>> Really use your patch guest side, and write host side >>> to allow starting migration with the device, but >>> defer completing it. >> >> >> Yeah, I'm fully on board with this idea, though I'm not really working >> on this right now since last I knew the folks on this thread from >> Intel were working on it. My patches were mostly meant to be a nudge >> in this direction so that we could get away from the driver specific >> code. > > > I have seen your email about live migration. > > I conclude the idea you proposed as following. > 1. Extend swiotlb to allow for a page dirtying functionality. > 2. Use pci express capability to implement of a PCI bridge to act > as a bridge between direct assigned devices and the host bridge. > 3. Using APCI event or extend shpc driver to support device pause. > Is it right? > > Will you implement the patchs for live migration? That is pretty much the heart of the proposal I had. I submitted an RFC as a proof-of-concept for item 1 in the hopes that someone else might try tackling items 2 and 3 but I haven't seen any updates since then. The trick is to find a way to make it so that item 1 doesn't slow down standard SWIOTLB when you are not migrating a VM. If nothing else we would probably just need to add a static key that we could default to false unless there is a PCI bridge indicating we are starting a migration. I haven't had time to really work on this though. In addition I am not that familiar with QEMU and the internals of live migration so pieces 2 and 3 would take me some additional time to work on. - Alex