Commit 92a3ecda6735ca9d15cd739ca5973e006bb2cf7a

Authored by aliguori
1 parent 8a93e519

temporarily disable logging around pci config writes (Avi Kivity)

A pci config write may remap the vga linear frame buffer, confusing the
memory slot dirty logging logic.

Fixed Windows with -vga std.

Signed-off-by: Avi Kivity <avi@redhat.com>
Sigend-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6852 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 12 additions and 1 deletions
hw/vga.c
@@ -2481,6 +2481,17 @@ int isa_vga_mm_init(uint8_t *vga_ram_base, @@ -2481,6 +2481,17 @@ int isa_vga_mm_init(uint8_t *vga_ram_base,
2481 return 0; 2481 return 0;
2482 } 2482 }
2483 2483
  2484 +static void pci_vga_write_config(PCIDevice *d,
  2485 + uint32_t address, uint32_t val, int len)
  2486 +{
  2487 + PCIVGAState *pvs = container_of(d, PCIVGAState, dev);
  2488 + VGAState *s = &pvs->vga_state;
  2489 +
  2490 + vga_dirty_log_stop(s);
  2491 + pci_default_write_config(d, address, val, len);
  2492 + vga_dirty_log_start(s);
  2493 +}
  2494 +
2484 int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base, 2495 int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
2485 unsigned long vga_ram_offset, int vga_ram_size, 2496 unsigned long vga_ram_offset, int vga_ram_size,
2486 unsigned long vga_bios_offset, int vga_bios_size) 2497 unsigned long vga_bios_offset, int vga_bios_size)
@@ -2491,7 +2502,7 @@ int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base, @@ -2491,7 +2502,7 @@ int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
2491 2502
2492 d = (PCIVGAState *)pci_register_device(bus, "VGA", 2503 d = (PCIVGAState *)pci_register_device(bus, "VGA",
2493 sizeof(PCIVGAState), 2504 sizeof(PCIVGAState),
2494 - -1, NULL, NULL); 2505 + -1, NULL, pci_vga_write_config);
2495 if (!d) 2506 if (!d)
2496 return -1; 2507 return -1;
2497 s = &d->vga_state; 2508 s = &d->vga_state;