From patchwork Wed Jul 20 21:43:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 993142 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6KLhgR4013154 for ; Wed, 20 Jul 2011 21:43:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751661Ab1GTVnj (ORCPT ); Wed, 20 Jul 2011 17:43:39 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:34572 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751460Ab1GTVnj (ORCPT ); Wed, 20 Jul 2011 17:43:39 -0400 Received: from smtp03.web.de ( [172.20.0.65]) by fmmailgate03.web.de (Postfix) with ESMTP id E07CD195DEB13; Wed, 20 Jul 2011 23:43:37 +0200 (CEST) Received: from [88.64.2.82] (helo=mchn199C.mchp.siemens.de) by smtp03.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1QjeYL-0003S0-00; Wed, 20 Jul 2011 23:43:37 +0200 Message-ID: <4E274C06.40902@web.de> Date: Wed, 20 Jul 2011 23:43:34 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Avi Kivity CC: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: Re: [RFC v5 00/86] Memory API References: <1311180636-17012-1-git-send-email-avi@redhat.com> <4E27132E.6080504@siemens.com> <4E2713C9.1030604@redhat.com> In-Reply-To: <4E2713C9.1030604@redhat.com> X-Enigmail-Version: 1.2 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX19znQY4OXkOFjOHkLFklb5afGi8U8y315JIknzF QHjunKTH3lfDvVcQgUyeGDL+alKObGq6jI7s43X9j4JH218x9O IsJRPGNNY= Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 20 Jul 2011 21:43:43 +0000 (UTC) On 2011-07-20 19:43, Avi Kivity wrote: > On 07/20/2011 08:41 PM, Jan Kiszka wrote: >> On 2011-07-20 18:49, Avi Kivity wrote: >> > New in this version: >> > - more mindless conversions; I believe there are no longer any >> destructive >> > operations in the tree (IO_MEM_UNASSIGNED) >> > - fix memory map generation bug (patch 13) >> > - proper 440FX PAM/SMRAM and PCI holes >> > >> >> This on top fixes standard VGA dirty logging: > > Both work for me without any patches. Impossible! ;) VGA frame buffer cannot work as no one enabled dirty logging for that range so far. Try -vga std with vga=0x314 in the guest. > > Maybe the F15 window manager is polling the display? > Only if that continuously enforces a full window refresh. As expected, there were dirty logging issues around removing a subregion on cirrus bank pointer updates. This makes linear vram mappings work again: Debugging provided some more insights: - address_space_update_topology is not very successful in avoiding needless mapping updates. kvm_client_set_memory is called much more frequently than with the old code. - The region update pattern delete old / add new, e.g. to move the cirrus bank pointer, will never allow an optimal number of memory client calls. We either need some memory_region_update or a transaction API. I would favor the former, should also simplify the usage. - memory_region_update_topology should take a hint if all or just a specific address space need updating. - Something makes the startup of graphical grub under cirrus horribly slow, likely some bug that prevents linear vram mode during the screen setup. But once it is fully painted for the first time, grub feels as fast as with the old code. Jan diff --git a/memory.c b/memory.c index a8d4295..14fac8a 100644 --- a/memory.c +++ b/memory.c @@ -1093,9 +1093,26 @@ void memory_region_add_subregion_overlap(MemoryRegion *mr, void memory_region_del_subregion(MemoryRegion *mr, MemoryRegion *subregion) { + MemoryRegion *target_region; + ram_addr_t base, offs; + assert(subregion->parent == mr); subregion->parent = NULL; QTAILQ_REMOVE(&mr->subregions, subregion, subregions_link); + + if (subregion->alias) { + base = subregion->alias_offset; + target_region = subregion->alias; + } else { + base = 0; + target_region = subregion; + } + if (target_region->dirty_log_mask) { + for (offs = 0; offs < subregion->size; offs += TARGET_PAGE_SIZE) { + memory_region_set_dirty(target_region, base + offs); + } + } + memory_region_update_topology(); }