From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxI9B-00050C-SI for qemu-devel@nongnu.org; Tue, 26 May 2015 12:56:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxI9A-0004nM-Fo for qemu-devel@nongnu.org; Tue, 26 May 2015 12:56:09 -0400 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:37615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxI9A-0004n3-8x for qemu-devel@nongnu.org; Tue, 26 May 2015 12:56:08 -0400 Received: by wifw1 with SMTP id w1so38379918wif.0 for ; Tue, 26 May 2015 09:55:42 -0700 (PDT) Received: from 640k.localdomain (dynamic-adsl-94-39-199-114.clienti.tiscali.it. [94.39.199.114]) by mx.google.com with ESMTPSA id x3sm17749309wiy.20.2015.05.26.09.55.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 09:55:41 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 26 May 2015 18:54:46 +0200 Message-Id: <1432659305-54578-11-git-send-email-pbonzini@redhat.com> In-Reply-To: <1432659305-54578-1-git-send-email-pbonzini@redhat.com> References: <1432659305-54578-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH v3 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: 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 b544e95..f4d66d1 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, -- 1.8.3.1