From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TayXa-0002En-Eh for qemu-devel@nongnu.org; Tue, 20 Nov 2012 19:51:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TayXY-00030D-Vz for qemu-devel@nongnu.org; Tue, 20 Nov 2012 19:51:46 -0500 Received: from ozlabs.org ([2402:b800:7003:1:1::1]:56658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TayXY-0002zs-HD for qemu-devel@nongnu.org; Tue, 20 Nov 2012 19:51:44 -0500 Date: Wed, 21 Nov 2012 11:51:41 +1100 From: David Gibson Message-ID: <20121121005141.GL18362@truffula.fritz.box> References: <1353375647-31268-1-git-send-email-aik@ozlabs.ru> <62DCE571-A625-4961-973E-420B53571580@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <62DCE571-A625-4961-973E-420B53571580@suse.de> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] kvm: fix incorrect length in a loop over kvm dirty pages map List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Tue, Nov 20, 2012 at 10:06:02AM +0100, Alexander Graf wrote: > > On 20.11.2012, at 02:40, Alexey Kardashevskiy wrote: > > > QEMU allocates a map enough for 4k pages. However the system page size > > can be 64K (for example on POWER) and the host kernel uses only a small > > part of it as one big stores a dirty flag for 16 pages 4K each, > > the hpratio variable stores this ratio and > > the kvm_get_dirty_pages_log_range function handles it correctly. > > > > However kvm_get_dirty_pages_log_range still goes beyond the data > > provided by the host kernel which is not correct. It does not cause > > errors at the moment as the whole bitmap is zeroed before doing KVM ioctl. > > > > The patch reduces number of iterations over the map. > > > > Signed-off-by: Alexey Kardashevskiy > > While at at, could you please also double-check whether the > coalesced mmio code does the right thing? It also uses > TARGET_PAGE_SIZE, which looks bogus to me. Since we don't support > coalesced mmio (yet), it's not too big of a deal, but it'd be nice > to get right. Hrm. I'd really prefer to leave that until we do implement coalesced mmio and so have something to test against. Otherwise we're likely to just make whatever's there more subtly wrong than it is now. > Thanks, applied to ppc-next. However, ther is another change that should definitely go with this one; the called of kvm_get_dirty_pages_log_range() has the same error when calculating the size of the bitmap to allocate. In this case it's harmless (it will always overallocate), but we should fix it too. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson