From patchwork Mon Sep 21 08:20:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 49000 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8L8L0hh024132 for ; Mon, 21 Sep 2009 08:21:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755026AbZIUIU3 (ORCPT ); Mon, 21 Sep 2009 04:20:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754994AbZIUIU2 (ORCPT ); Mon, 21 Sep 2009 04:20:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48272 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754953AbZIUIU0 (ORCPT ); Mon, 21 Sep 2009 04:20:26 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8L8KUuq015530 for ; Mon, 21 Sep 2009 04:20:30 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8L8K9dc003933; Mon, 21 Sep 2009 04:20:29 -0400 From: Juan Quintela To: kvm@vger.kernel.org Subject: [PATCH 2/2] vga: move back dirty_log functions to vga.c Date: Mon, 21 Sep 2009 10:20:01 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Juan Quintela --- hw/vga-pci.c | 43 ------------------------------------------- hw/vga.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/hw/vga-pci.c b/hw/vga-pci.c index c49858c..9bb2d81 100644 --- a/hw/vga-pci.c +++ b/hw/vga-pci.c @@ -28,7 +28,6 @@ #include "vga_int.h" #include "pixel_ops.h" #include "qemu-timer.h" -#include "kvm.h" typedef struct PCIVGAState { PCIDevice dev; @@ -59,48 +58,6 @@ static int pci_vga_load(QEMUFile *f, void *opaque, int version_id) return vga_common_load(f, &s->vga, version_id); } -static int s1, s2; - -static void mark_dirty(target_phys_addr_t start, target_phys_addr_t len) -{ - target_phys_addr_t end = start + len; - - while (start < end) { - cpu_physical_memory_set_dirty(cpu_get_physical_page_desc(start)); - start += TARGET_PAGE_SIZE; - } -} - -void vga_dirty_log_start(VGACommonState *s) -{ - if (kvm_enabled() && s->map_addr) - if (!s1) { - kvm_log_start(s->map_addr, s->map_end - s->map_addr); - mark_dirty(s->map_addr, s->map_end - s->map_addr); - s1 = 1; - } - if (kvm_enabled() && s->lfb_vram_mapped) { - if (!s2) { - kvm_log_start(isa_mem_base + 0xa0000, 0x8000); - kvm_log_start(isa_mem_base + 0xa8000, 0x8000); - mark_dirty(isa_mem_base + 0xa0000, 0x10000); - } - s2 = 1; - } -} - -void vga_dirty_log_stop(VGACommonState *s) -{ - if (kvm_enabled() && s->map_addr && s1) - kvm_log_stop(s->map_addr, s->map_end - s->map_addr); - - if (kvm_enabled() && s->lfb_vram_mapped && s2) { - kvm_log_stop(isa_mem_base + 0xa0000, 0x8000); - kvm_log_stop(isa_mem_base + 0xa8000, 0x8000); - } - s1 = s2 = 0; -} - static void vga_map(PCIDevice *pci_dev, int region_num, uint32_t addr, uint32_t size, int type) { diff --git a/hw/vga.c b/hw/vga.c index df4c063..29a9f81 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -28,6 +28,7 @@ #include "vga_int.h" #include "pixel_ops.h" #include "qemu-timer.h" +#include "kvm.h" //#define DEBUG_VGA //#define DEBUG_VGA_MEM @@ -1579,6 +1580,48 @@ static void vga_sync_dirty_bitmap(VGACommonState *s) vga_dirty_log_start(s); } +static int s1, s2; + +static void mark_dirty(target_phys_addr_t start, target_phys_addr_t len) +{ + target_phys_addr_t end = start + len; + + while (start < end) { + cpu_physical_memory_set_dirty(cpu_get_physical_page_desc(start)); + start += TARGET_PAGE_SIZE; + } +} + +void vga_dirty_log_start(VGACommonState *s) +{ + if (kvm_enabled() && s->map_addr) + if (!s1) { + kvm_log_start(s->map_addr, s->map_end - s->map_addr); + mark_dirty(s->map_addr, s->map_end - s->map_addr); + s1 = 1; + } + if (kvm_enabled() && s->lfb_vram_mapped) { + if (!s2) { + kvm_log_start(isa_mem_base + 0xa0000, 0x8000); + kvm_log_start(isa_mem_base + 0xa8000, 0x8000); + mark_dirty(isa_mem_base + 0xa0000, 0x10000); + } + s2 = 1; + } +} + +void vga_dirty_log_stop(VGACommonState *s) +{ + if (kvm_enabled() && s->map_addr && s1) + kvm_log_stop(s->map_addr, s->map_end - s->map_addr); + + if (kvm_enabled() && s->lfb_vram_mapped && s2) { + kvm_log_stop(isa_mem_base + 0xa0000, 0x8000); + kvm_log_stop(isa_mem_base + 0xa8000, 0x8000); + } + s1 = s2 = 0; +} + /* * graphic modes */