Commit 4b16eb9d9570c9b311d514b840eb51b25fcc21a1

Authored by aliguori
1 parent e7f3dcc4

vga: Cleanup dirty logging (Jan Kiszka)

In theory, there are no more quirks in the KVM slot management that
requires dirty log start/stop all over the place. We just have to start
the logging each time the mapping may have changed. This patch drops
vga_dirty_log_stop for both standard and cirrus VGA. It also reverts
#6851 as it was obviously a tribute to the old slot system.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7141 c046a42c-6fe2-441c-8c8c-71466251a162
hw/cirrus_vga.c
@@ -2618,8 +2618,6 @@ static CPUWriteMemoryFunc *cirrus_linear_bitblt_write[3] = { @@ -2618,8 +2618,6 @@ static CPUWriteMemoryFunc *cirrus_linear_bitblt_write[3] = {
2618 2618
2619 static void map_linear_vram(CirrusVGAState *s) 2619 static void map_linear_vram(CirrusVGAState *s)
2620 { 2620 {
2621 - vga_dirty_log_stop((VGAState *)s);  
2622 -  
2623 if (!s->map_addr && s->lfb_addr && s->lfb_end) { 2621 if (!s->map_addr && s->lfb_addr && s->lfb_end) {
2624 s->map_addr = s->lfb_addr; 2622 s->map_addr = s->lfb_addr;
2625 s->map_end = s->lfb_end; 2623 s->map_end = s->lfb_end;
@@ -2631,16 +2629,11 @@ static void map_linear_vram(CirrusVGAState *s) @@ -2631,16 +2629,11 @@ static void map_linear_vram(CirrusVGAState *s)
2631 2629
2632 s->lfb_vram_mapped = 0; 2630 s->lfb_vram_mapped = 0;
2633 2631
2634 - cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x8000,  
2635 - (s->vram_offset + s->cirrus_bank_base[0]) | IO_MEM_UNASSIGNED);  
2636 - cpu_register_physical_memory(isa_mem_base + 0xa8000, 0x8000,  
2637 - (s->vram_offset + s->cirrus_bank_base[1]) | IO_MEM_UNASSIGNED);  
2638 if (!(s->cirrus_srcptr != s->cirrus_srcptr_end) 2632 if (!(s->cirrus_srcptr != s->cirrus_srcptr_end)
2639 && !((s->sr[0x07] & 0x01) == 0) 2633 && !((s->sr[0x07] & 0x01) == 0)
2640 && !((s->gr[0x0B] & 0x14) == 0x14) 2634 && !((s->gr[0x0B] & 0x14) == 0x14)
2641 && !(s->gr[0x0B] & 0x02)) { 2635 && !(s->gr[0x0B] & 0x02)) {
2642 2636
2643 - vga_dirty_log_stop((VGAState *)s);  
2644 cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x8000, 2637 cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x8000,
2645 (s->vram_offset + s->cirrus_bank_base[0]) | IO_MEM_RAM); 2638 (s->vram_offset + s->cirrus_bank_base[0]) | IO_MEM_RAM);
2646 cpu_register_physical_memory(isa_mem_base + 0xa8000, 0x8000, 2639 cpu_register_physical_memory(isa_mem_base + 0xa8000, 0x8000,
@@ -2658,15 +2651,11 @@ static void map_linear_vram(CirrusVGAState *s) @@ -2658,15 +2651,11 @@ static void map_linear_vram(CirrusVGAState *s)
2658 2651
2659 static void unmap_linear_vram(CirrusVGAState *s) 2652 static void unmap_linear_vram(CirrusVGAState *s)
2660 { 2653 {
2661 - vga_dirty_log_stop((VGAState *)s);  
2662 -  
2663 if (s->map_addr && s->lfb_addr && s->lfb_end) 2654 if (s->map_addr && s->lfb_addr && s->lfb_end)
2664 s->map_addr = s->map_end = 0; 2655 s->map_addr = s->map_end = 0;
2665 2656
2666 cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x20000, 2657 cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x20000,
2667 s->vga_io_memory); 2658 s->vga_io_memory);
2668 -  
2669 - vga_dirty_log_start((VGAState *)s);  
2670 } 2659 }
2671 2660
2672 /* Compute the memory access functions */ 2661 /* Compute the memory access functions */
@@ -3313,8 +3302,6 @@ static void cirrus_pci_lfb_map(PCIDevice *d, int region_num, @@ -3313,8 +3302,6 @@ static void cirrus_pci_lfb_map(PCIDevice *d, int region_num,
3313 { 3302 {
3314 CirrusVGAState *s = &((PCICirrusVGAState *)d)->cirrus_vga; 3303 CirrusVGAState *s = &((PCICirrusVGAState *)d)->cirrus_vga;
3315 3304
3316 - vga_dirty_log_stop((VGAState *)s);  
3317 -  
3318 /* XXX: add byte swapping apertures */ 3305 /* XXX: add byte swapping apertures */
3319 cpu_register_physical_memory(addr, s->vram_size, 3306 cpu_register_physical_memory(addr, s->vram_size,
3320 s->cirrus_linear_io_addr); 3307 s->cirrus_linear_io_addr);
@@ -3346,14 +3333,10 @@ static void pci_cirrus_write_config(PCIDevice *d, @@ -3346,14 +3333,10 @@ static void pci_cirrus_write_config(PCIDevice *d,
3346 PCICirrusVGAState *pvs = container_of(d, PCICirrusVGAState, dev); 3333 PCICirrusVGAState *pvs = container_of(d, PCICirrusVGAState, dev);
3347 CirrusVGAState *s = &pvs->cirrus_vga; 3334 CirrusVGAState *s = &pvs->cirrus_vga;
3348 3335
3349 - vga_dirty_log_stop((VGAState *)s);  
3350 -  
3351 pci_default_write_config(d, address, val, len); 3336 pci_default_write_config(d, address, val, len);
3352 if (s->map_addr && pvs->dev.io_regions[0].addr == -1) 3337 if (s->map_addr && pvs->dev.io_regions[0].addr == -1)
3353 s->map_addr = 0; 3338 s->map_addr = 0;
3354 cirrus_update_memory_access(s); 3339 cirrus_update_memory_access(s);
3355 -  
3356 - vga_dirty_log_start((VGAState *)s);  
3357 } 3340 }
3358 3341
3359 void pci_cirrus_vga_init(PCIBus *bus, int vga_ram_size) 3342 void pci_cirrus_vga_init(PCIBus *bus, int vga_ram_size)
hw/vga.c
@@ -1279,8 +1279,6 @@ static void vga_draw_text(VGAState *s, int full_update) @@ -1279,8 +1279,6 @@ static void vga_draw_text(VGAState *s, int full_update)
1279 vga_draw_glyph8_func *vga_draw_glyph8; 1279 vga_draw_glyph8_func *vga_draw_glyph8;
1280 vga_draw_glyph9_func *vga_draw_glyph9; 1280 vga_draw_glyph9_func *vga_draw_glyph9;
1281 1281
1282 - vga_dirty_log_stop(s);  
1283 -  
1284 /* compute font data address (in plane 2) */ 1282 /* compute font data address (in plane 2) */
1285 v = s->sr[3]; 1283 v = s->sr[3];
1286 offset = (((v >> 4) & 1) | ((v << 1) & 6)) * 8192 * 4 + 2; 1284 offset = (((v >> 4) & 1) | ((v << 1) & 6)) * 8192 * 4 + 2;
@@ -1579,7 +1577,6 @@ static void vga_sync_dirty_bitmap(VGAState *s) @@ -1579,7 +1577,6 @@ static void vga_sync_dirty_bitmap(VGAState *s)
1579 cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa0000, 0xa8000); 1577 cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa0000, 0xa8000);
1580 cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa8000, 0xb0000); 1578 cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa8000, 0xb0000);
1581 } 1579 }
1582 - vga_dirty_log_start(s);  
1583 } 1580 }
1584 1581
1585 /* 1582 /*
@@ -1810,7 +1807,6 @@ static void vga_draw_blank(VGAState *s, int full_update) @@ -1810,7 +1807,6 @@ static void vga_draw_blank(VGAState *s, int full_update)
1810 return; 1807 return;
1811 if (s->last_scr_width <= 0 || s->last_scr_height <= 0) 1808 if (s->last_scr_width <= 0 || s->last_scr_height <= 0)
1812 return; 1809 return;
1813 - vga_dirty_log_stop(s);  
1814 1810
1815 s->rgb_to_pixel = 1811 s->rgb_to_pixel =
1816 rgb_to_pixel_dup_table[get_depth_index(s->ds)]; 1812 rgb_to_pixel_dup_table[get_depth_index(s->ds)];
@@ -2238,17 +2234,6 @@ void vga_dirty_log_start(VGAState *s) @@ -2238,17 +2234,6 @@ void vga_dirty_log_start(VGAState *s)
2238 } 2234 }
2239 } 2235 }
2240 2236
2241 -void vga_dirty_log_stop(VGAState *s)  
2242 -{  
2243 - if (kvm_enabled() && s->map_addr)  
2244 - kvm_log_stop(s->map_addr, s->map_end - s->map_addr);  
2245 -  
2246 - if (kvm_enabled() && s->lfb_vram_mapped) {  
2247 - kvm_log_stop(isa_mem_base + 0xa0000, 0x8000);  
2248 - kvm_log_stop(isa_mem_base + 0xa8000, 0x8000);  
2249 - }  
2250 -}  
2251 -  
2252 static void vga_map(PCIDevice *pci_dev, int region_num, 2237 static void vga_map(PCIDevice *pci_dev, int region_num,
2253 uint32_t addr, uint32_t size, int type) 2238 uint32_t addr, uint32_t size, int type)
2254 { 2239 {
@@ -2489,11 +2474,9 @@ static void pci_vga_write_config(PCIDevice *d, @@ -2489,11 +2474,9 @@ static void pci_vga_write_config(PCIDevice *d,
2489 PCIVGAState *pvs = container_of(d, PCIVGAState, dev); 2474 PCIVGAState *pvs = container_of(d, PCIVGAState, dev);
2490 VGAState *s = &pvs->vga_state; 2475 VGAState *s = &pvs->vga_state;
2491 2476
2492 - vga_dirty_log_stop(s);  
2493 pci_default_write_config(d, address, val, len); 2477 pci_default_write_config(d, address, val, len);
2494 if (s->map_addr && pvs->dev.io_regions[0].addr == -1) 2478 if (s->map_addr && pvs->dev.io_regions[0].addr == -1)
2495 s->map_addr = 0; 2479 s->map_addr = 0;
2496 - vga_dirty_log_start(s);  
2497 } 2480 }
2498 2481
2499 int pci_vga_init(PCIBus *bus, int vga_ram_size, 2482 int pci_vga_init(PCIBus *bus, int vga_ram_size,
hw/vga_int.h
@@ -196,7 +196,6 @@ void vga_init(VGAState *s); @@ -196,7 +196,6 @@ void vga_init(VGAState *s);
196 void vga_reset(void *s); 196 void vga_reset(void *s);
197 197
198 void vga_dirty_log_start(VGAState *s); 198 void vga_dirty_log_start(VGAState *s);
199 -void vga_dirty_log_stop(VGAState *s);  
200 199
201 uint32_t vga_mem_readb(void *opaque, target_phys_addr_t addr); 200 uint32_t vga_mem_readb(void *opaque, target_phys_addr_t addr);
202 void vga_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val); 201 void vga_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val);