From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0tMH-0002C9-Of for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:16:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0tMG-000856-SQ for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:16:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0tMG-000851-Nm for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:16:32 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 749FE2E1238 for ; Fri, 5 Jun 2015 15:16:32 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-29.ams2.redhat.com [10.36.112.29]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t55FG4kR012808 for ; Fri, 5 Jun 2015 11:16:31 -0400 From: Paolo Bonzini Date: Fri, 5 Jun 2015 17:15:16 +0200 Message-Id: <1433517363-32335-16-git-send-email-pbonzini@redhat.com> In-Reply-To: <1433517363-32335-1-git-send-email-pbonzini@redhat.com> References: <1433517363-32335-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 15/62] kvm: accept non-mapped memory in kvm_dirty_pages_log_change List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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. This can be triggered by iofuzz. Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- kvm-all.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index c713b22..36e8109 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); } static void kvm_log_start(MemoryListener *listener, -- 2.4.1