From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxCqX-0000YO-VE for qemu-devel@nongnu.org; Tue, 26 May 2015 07:16:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxCqU-0004gp-PS for qemu-devel@nongnu.org; Tue, 26 May 2015 07:16:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxCqU-0004gV-J9 for qemu-devel@nongnu.org; Tue, 26 May 2015 07:16:30 -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 (8.14.4/8.14.4) with ESMTP id t4QBGTw8031486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 26 May 2015 07:16:30 -0400 Message-ID: <5564560A.5030200@redhat.com> Date: Tue, 26 May 2015 13:16:26 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1430152117-100558-1-git-send-email-pbonzini@redhat.com> <1430152117-100558-8-git-send-email-pbonzini@redhat.com> <20150526080208.GH13749@ad.nay.redhat.com> In-Reply-To: <20150526080208.GH13749@ad.nay.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/29] framebuffer: check memory_region_is_logging 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:02, Fam Zheng wrote: > On Mon, 04/27 18:28, Paolo Bonzini wrote: >> framebuffer.c expects DIRTY_MEMORY_VGA logging to be always on, but that >> will not be the case soon. Because framebuffer.c computes the memory >> region on the fly for every update (with memory_region_find), it cannot >> enable/disable logging by itself. >> >> Instead, always treat updates as invalidations if dirty logging is >> not enabled, assuming that the board will enable logging on the >> RAM region that includes the framebuffer. >> >> To simplify the code, replace memory_region_get_dirty with >> memory_region_test_and_clear_dirty. Then memory_region_reset_dirty >> is only needed in the invalidate case. > > The commit message seems out-of-date, but I think it's better to keep the v1 > hunks which skip memory_region_get_dirty if invalidate == true, otherwise use > memory_region_test_and_clear_dirty. Unfortunately that is wrong. See the first paragraph of the commit message: "because framebuffer.c computes the memory region on the fly for every update (with memory_region_find), it cannot enable/disable logging by itself". Only the last paragraph of the commit message is out-of-date, and I will remove it. Paolo