Patchwork [v2,01/13] spice: Use cpu_register_physical_memory_log for dirty log enabling

login
register
mail settings
Submitter Jan Kiszka
Date June 15, 2011, 7:23 a.m.
Message ID <4DF85E09.50808@siemens.com>
Download mbox | patch
Permalink /patch/100490/
State New
Headers show

Comments

Jan Kiszka - June 15, 2011, 7:23 a.m.
Drop outdated dirty log disable/enable around PCI remapping and register
the BAR for dirty logging via cpu_register_physical_memory_log. That
allows to remove all vga_dirty_log_start/stop references from qxl.

CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Changes in v2:
 - don't enable logging for secondary adapter

 hw/qxl.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
Gerd Hoffmann - June 15, 2011, 8:50 a.m.
On 06/15/11 09:23, Jan Kiszka wrote:
> Drop outdated dirty log disable/enable around PCI remapping and register
> the BAR for dirty logging via cpu_register_physical_memory_log. That
> allows to remove all vga_dirty_log_start/stop references from qxl.

Acked-by: Gerd Hoffmann <kraxel@redhat.com>

cheers,
   Gerd

Patch

diff --git a/hw/qxl.c b/hw/qxl.c
index 1906e84..01149ae 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -619,12 +619,10 @@  static void qxl_write_config(PCIDevice *d, uint32_t address,
     PCIQXLDevice *qxl = DO_UPCAST(PCIQXLDevice, pci, d);
     VGACommonState *vga = &qxl->vga;
 
-    vga_dirty_log_stop(vga);
     pci_default_write_config(d, address, val, len);
     if (vga->map_addr && qxl->pci.io_regions[0].addr == -1) {
         vga->map_addr = 0;
     }
-    vga_dirty_log_start(vga);
 }
 
 static void qxl_check_state(PCIQXLDevice *d)
@@ -1037,12 +1035,11 @@  static void qxl_map(PCIDevice *pci, int region_num,
         qxl->io_base = addr;
         break;
     case QXL_RAM_RANGE_INDEX:
-        cpu_register_physical_memory(addr, size, qxl->vga.vram_offset | IO_MEM_RAM);
+        cpu_register_physical_memory_log(addr, size,
+                                         qxl->vga.vram_offset | IO_MEM_RAM,
+                                         0, qxl->id == 0);
         qxl->vga.map_addr = addr;
         qxl->vga.map_end = addr + size;
-        if (qxl->id == 0) {
-            vga_dirty_log_start(&qxl->vga);
-        }
         break;
     case QXL_ROM_RANGE_INDEX:
         cpu_register_physical_memory(addr, size, qxl->rom_offset | IO_MEM_ROM);