From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxA2d-0003PQ-Br for qemu-devel@nongnu.org; Tue, 26 May 2015 04:16:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxA2a-0007Py-7T for qemu-devel@nongnu.org; Tue, 26 May 2015 04:16:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxA2a-0007Pm-0n for qemu-devel@nongnu.org; Tue, 26 May 2015 04:16:48 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4Q8Glgf003871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 26 May 2015 04:16:47 -0400 Message-ID: <55642BEA.4020908@redhat.com> Date: Tue, 26 May 2015 10:16:42 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1430152117-100558-1-git-send-email-pbonzini@redhat.com> <1430152117-100558-11-git-send-email-pbonzini@redhat.com> <20150526081040.GK13749@ad.nay.redhat.com> In-Reply-To: <20150526081040.GK13749@ad.nay.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 10/29] kvm: accept non-mapped memory in kvm_dirty_pages_log_change List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org, stefanha@redhat.com, mst@redhat.com On 26/05/2015 10:10, Fam Zheng wrote: > > It is okay if memory is not mapped into the guest but has dirty logging > > enabled. When this happens, KVM will not do anything and only accesses > > from the host will be logged. > > > > Signed-off-by: Paolo Bonzini > > Could you explain where this change is needed? I received a report of this error, obtained via iofuzz. Paolo > Fam > >> > --- >> > kvm-all.c | 8 +++----- >> > 1 file changed, 3 insertions(+), 5 deletions(-) >> > >> > diff --git a/kvm-all.c b/kvm-all.c >> > index 989fdd9..616bf04 100644 >> > --- a/kvm-all.c >> > +++ b/kvm-all.c >> > @@ -335,12 +335,10 @@ static int kvm_dirty_pages_log_change(hwaddr phys_addr, >> > KVMSlot *mem = kvm_lookup_matching_slot(s, phys_addr, phys_addr + size); >> > >> > if (mem == NULL) { >> > - fprintf(stderr, "BUG: %s: invalid parameters " TARGET_FMT_plx "-" >> > - TARGET_FMT_plx "\n", __func__, phys_addr, >> > - (hwaddr)(phys_addr + size - 1)); >> > - return -EINVAL; >> > + return 0; >> > + } else { >> > + return kvm_slot_dirty_pages_log_change(mem, log_dirty); >> > } >> > - return kvm_slot_dirty_pages_log_change(mem, log_dirty); >> > }