From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mario Smarduch Subject: Re: [PATCH 3/3] arm, arm64: KVM: handle potential incoherency of readonly memslots Date: Fri, 21 Nov 2014 17:50:43 -0800 Message-ID: <546FEBF3.6030401@samsung.com> References: <1416236333-9378-1-git-send-email-ard.biesheuvel@linaro.org> <1416236333-9378-3-git-send-email-ard.biesheuvel@linaro.org> <546A146E.1020804@redhat.com> <546A1905.6080607@redhat.com> <546D288F.1040107@samsung.com> <20141121111936.GA1785@cbox> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Laszlo Ersek , Paolo Bonzini , Ard Biesheuvel , kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, drjones@redhat.com, wei@redhat.com, kvm@vger.kernel.org To: Christoffer Dall Return-path: Received: from mailout1.w2.samsung.com ([211.189.100.11]:8528 "EHLO usmailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751924AbaKVBuq (ORCPT ); Fri, 21 Nov 2014 20:50:46 -0500 Received: from uscpsbgex1.samsung.com (u122.gpu85.samsung.co.kr [203.254.195.122]) by mailout1.w2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NFF009W93SL8Y10@mailout1.w2.samsung.com> for kvm@vger.kernel.org; Fri, 21 Nov 2014 20:50:45 -0500 (EST) In-reply-to: <20141121111936.GA1785@cbox> Sender: kvm-owner@vger.kernel.org List-ID: On 11/21/2014 03:19 AM, Christoffer Dall wrote: > Hi Mario, > > On Wed, Nov 19, 2014 at 03:32:31PM -0800, Mario Smarduch wrote: >> Hi Laszlo, >> >> couple observations. >> >> I'm wondering if access from qemu and guest won't >> result in mixed memory attributes and if that's acceptable >> to the CPU. >> >> Also is if you update memory from qemu you may break >> dirty page logging/migration. Unless there is some other way >> you keep track. Of course it may not be applicable in your >> case (i.e. flash unused after boot). >> > I'm not concerned about this particular case; dirty page logging exists > so KVM can inform userspace when a page may have been dirtied. If > userspace directly dirties (is that a verb?) a page, I would think so, I rely on software too much :) > then it already knows that it needs to migrate that page and > deal with it accordingly. > > Or did I miss some more subtle point here QEMU has a global migration bitmap for all regions initially set dirty, and it's updated over iterations with KVM's dirty bitmap. Once dirty pages are migrated bits are cleared. If QEMU updates a memory region directly I can't see how it's reflected in that migration bitmap that determines what pages should be migrated as it makes it's passes. On x86 if host updates guest memory it marks that page dirty. But virtio writes to guest memory directly and that appears to work just fine. I read that code sometime back, and will need to revisit. - Mario > > -Christoffer >