From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTQVA-000345-VP for qemu-devel@nongnu.org; Wed, 10 Feb 2016 03:51:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTQV5-0003th-VD for qemu-devel@nongnu.org; Wed, 10 Feb 2016 03:51:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTQV5-0003tc-QS for qemu-devel@nongnu.org; Wed, 10 Feb 2016 03:51:51 -0500 Date: Wed, 10 Feb 2016 10:51:47 +0200 From: "Michael S. Tsirkin" Message-ID: <20160210103628-mutt-send-email-mst@redhat.com> References: <1453978470-222624-1-git-send-email-imammedo@redhat.com> <1453978470-222624-4-git-send-email-imammedo@redhat.com> <20160128125842-mutt-send-email-mst@redhat.com> <20160128130316.11af4330@nial.brq.redhat.com> <20160128145348-mutt-send-email-mst@redhat.com> <20160129121359.17842fef@nial.brq.redhat.com> <20160131170118-mutt-send-email-mst@redhat.com> <20160202105953.476a05bd@nial.brq.redhat.com> <20160202123756-mutt-send-email-mst@redhat.com> <20160209114608.4f89b528@nial.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209114608.4f89b528@nial.brq.redhat.com> Subject: Re: [Qemu-devel] [PATCH v19 3/9] pc: add a Virtual Machine Generation ID device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Xiao Guangrong , ehabkost@redhat.com, ghammer@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, lersek@redhat.com On Tue, Feb 09, 2016 at 11:46:08AM +0100, Igor Mammedov wrote: > > > > > 2. ACPI approach consumes guest usable RAM to allocate buffer > > > > > and then makes device to DMA data in that RAM. > > > > > That's a design point I don't agree with. > > > > > > > > Blame the broken VM GEN ID spec. > > > > > > > > For VM GEN ID, instead of DMA we could make ACPI code read PCI BAR and > > > > copy data over, this would fix rebalancing but there is a problem with > > > > this approach: it can not be done atomically (while VM is not yet > > > > running and accessing RAM). So you can have guest read a partially > > > > corrupted ID from memory. > > > > > > Yep, VM GEN ID spec is broken and we can't do anything about it as > > > it's absolutely impossible to guaranty atomic update as guest OS > > > has address of the buffer and can read it any time. Nothing could be > > > done here. > > > > Hmm I thought we can stop VM while we are changing the ID. > > But of course VM could be accessing it at the same time. > > So I take this back, ACPI code reading PCI BAR and > > writing data out to the buffer would be fine > > from this point of view. > spec is broken regardless of who reads BAR or RAM as read > isn't atomic and UUID could be updated in the middle. > So MS will have to live with that, unless they have a secret > way to tell guest stop reading from that ADDR, do update and > signal guest that it can read it. And really, that the issue that's driving this up to v19. There's no good way to implement a bad spec. It feels more like a failed experiment than like a thought through interface. So maybe we should leave this alone, wait until we see an actual user - this way we can figure out the implementation constraints better. -- MST