From patchwork Wed Jun 15 16:29:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 100554 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D6755B6F88 for ; Thu, 16 Jun 2011 03:32:35 +1000 (EST) Received: from localhost ([::1]:33586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWtx8-0000sl-8V for incoming@patchwork.ozlabs.org; Wed, 15 Jun 2011 13:32:30 -0400 Received: from eggs.gnu.org ([140.186.70.92]:36977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWsvA-0000xU-60 for qemu-devel@nongnu.org; Wed, 15 Jun 2011 12:26:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWsv7-0005Zs-M6 for qemu-devel@nongnu.org; Wed, 15 Jun 2011 12:26:23 -0400 Received: from smtp.ctxuk.citrix.com ([62.200.22.115]:21514 helo=SMTP.EU.CITRIX.COM) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWsv6-0005XT-Oe for qemu-devel@nongnu.org; Wed, 15 Jun 2011 12:26:21 -0400 X-IronPort-AV: E=Sophos;i="4.65,370,1304294400"; d="scan'208";a="6291892" Received: from lonpmailmx01.citrite.net ([10.30.224.162]) by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5; 15 Jun 2011 16:25:52 +0000 Received: from kaball.uk.xensource.com (10.80.2.59) by LONPMAILMX01.citrite.net (10.30.224.162) with Microsoft SMTP Server id 8.3.137.0; Wed, 15 Jun 2011 17:25:51 +0100 Date: Wed, 15 Jun 2011 17:29:27 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball-desktop To: Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 62.200.22.115 Cc: xen-devel@lists.xensource.com, Anthony PERARD , Alexander Graf Subject: [Qemu-devel] [PATCH] xen: only track the linear framebuffer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Xen can only do dirty bit tracking for one memory region, so we should explicitly avoid trying to track anything but the vga vram region. Signed-off-by: Stefano Stabellini diff --git a/xen-all.c b/xen-all.c index 9a5c3ec..fa1d2e1 100644 --- a/xen-all.c +++ b/xen-all.c @@ -214,6 +214,7 @@ static int xen_add_to_physmap(XenIOState *state, unsigned long i = 0; int rc = 0; XenPhysmap *physmap = NULL; + RAMBlock *block; if (get_physmapping(state, start_addr, size)) { return 0; @@ -221,7 +222,19 @@ static int xen_add_to_physmap(XenIOState *state, if (size <= 0) { return -1; } + /* Xen can only handle a single dirty log region for now and we want + * the linear framebuffer to be that region. + * Avoid tracking any regions that is not videoram and avoid tracking + * the legacy vga region. */ + QLIST_FOREACH(block, &ram_list.blocks, next) { + if (!strcmp(block->idstr, "vga.vram") && block->offset == phys_offset + && start_addr > 0xbffff) { + goto go_physmap; + } + } + return -1; +go_physmap: DPRINTF("mapping vram to %llx - %llx, from %llx\n", start_addr, start_addr + size, phys_offset); for (i = 0; i < size >> TARGET_PAGE_BITS; i++) { unsigned long idx = (phys_offset >> TARGET_PAGE_BITS) + i;