Revision e5896b12

b/cpu-all.h
959 959
int cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
960 960
                                   target_phys_addr_t end_addr);
961 961

  
962
int cpu_physical_log_start(target_phys_addr_t start_addr,
963
                           ram_addr_t size);
964

  
965
int cpu_physical_log_stop(target_phys_addr_t start_addr,
966
                          ram_addr_t size);
967

  
962 968
void dump_exec_info(FILE *f, fprintf_function cpu_fprintf);
963 969
#endif /* !CONFIG_USER_ONLY */
964 970

  
b/cpu-common.h
96 96
                             target_phys_addr_t end_addr);
97 97
    int (*migration_log)(struct CPUPhysMemoryClient *client,
98 98
                         int enable);
99
    int (*log_start)(struct CPUPhysMemoryClient *client,
100
                     target_phys_addr_t phys_addr, ram_addr_t size);
101
    int (*log_stop)(struct CPUPhysMemoryClient *client,
102
                    target_phys_addr_t phys_addr, ram_addr_t size);
99 103
    QLIST_ENTRY(CPUPhysMemoryClient) list;
100 104
};
101 105

  
b/exec.c
2078 2078
    return ret;
2079 2079
}
2080 2080

  
2081
int cpu_physical_log_start(target_phys_addr_t start_addr,
2082
                           ram_addr_t size)
2083
{
2084
    CPUPhysMemoryClient *client;
2085
    QLIST_FOREACH(client, &memory_client_list, list) {
2086
        if (client->log_start) {
2087
            int r = client->log_start(client, start_addr, size);
2088
            if (r < 0) {
2089
                return r;
2090
            }
2091
        }
2092
    }
2093
    return 0;
2094
}
2095

  
2096
int cpu_physical_log_stop(target_phys_addr_t start_addr,
2097
                          ram_addr_t size)
2098
{
2099
    CPUPhysMemoryClient *client;
2100
    QLIST_FOREACH(client, &memory_client_list, list) {
2101
        if (client->log_stop) {
2102
            int r = client->log_stop(client, start_addr, size);
2103
            if (r < 0) {
2104
                return r;
2105
            }
2106
        }
2107
    }
2108
    return 0;
2109
}
2110

  
2081 2111
static inline void tlb_update_dirty(CPUTLBEntry *tlb_entry)
2082 2112
{
2083 2113
    ram_addr_t ram_addr;
b/hw/vga.c
28 28
#include "vga_int.h"
29 29
#include "pixel_ops.h"
30 30
#include "qemu-timer.h"
31
#include "kvm.h"
32 31

  
33 32
//#define DEBUG_VGA
34 33
//#define DEBUG_VGA_MEM
......
1573 1572

  
1574 1573
void vga_dirty_log_start(VGACommonState *s)
1575 1574
{
1576
    if (kvm_enabled() && s->map_addr)
1577
        kvm_log_start(s->map_addr, s->map_end - s->map_addr);
1575
    if (s->map_addr) {
1576
        cpu_physical_log_start(s->map_addr, s->map_end - s->map_addr);
1577
    }
1578 1578

  
1579
    if (kvm_enabled() && s->lfb_vram_mapped) {
1580
        kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
1581
        kvm_log_start(isa_mem_base + 0xa8000, 0x8000);
1579
    if (s->lfb_vram_mapped) {
1580
        cpu_physical_log_start(isa_mem_base + 0xa0000, 0x8000);
1581
        cpu_physical_log_start(isa_mem_base + 0xa8000, 0x8000);
1582 1582
    }
1583 1583

  
1584 1584
#ifdef CONFIG_BOCHS_VBE
1585
    if (kvm_enabled() && s->vbe_mapped) {
1586
        kvm_log_start(VBE_DISPI_LFB_PHYSICAL_ADDRESS, s->vram_size);
1585
    if (s->vbe_mapped) {
1586
        cpu_physical_log_start(VBE_DISPI_LFB_PHYSICAL_ADDRESS, s->vram_size);
1587 1587
    }
1588 1588
#endif
1589 1589
}
1590 1590

  
1591 1591
void vga_dirty_log_stop(VGACommonState *s)
1592 1592
{
1593
    if (kvm_enabled() && s->map_addr)
1594
	kvm_log_stop(s->map_addr, s->map_end - s->map_addr);
1593
    if (s->map_addr) {
1594
        cpu_physical_log_stop(s->map_addr, s->map_end - s->map_addr);
1595
    }
1595 1596

  
1596
    if (kvm_enabled() && s->lfb_vram_mapped) {
1597
	kvm_log_stop(isa_mem_base + 0xa0000, 0x8000);
1598
	kvm_log_stop(isa_mem_base + 0xa8000, 0x8000);
1597
    if (s->lfb_vram_mapped) {
1598
        cpu_physical_log_stop(isa_mem_base + 0xa0000, 0x8000);
1599
        cpu_physical_log_stop(isa_mem_base + 0xa8000, 0x8000);
1599 1600
    }
1600 1601

  
1601 1602
#ifdef CONFIG_BOCHS_VBE
1602
    if (kvm_enabled() && s->vbe_mapped) {
1603
	kvm_log_stop(VBE_DISPI_LFB_PHYSICAL_ADDRESS, s->vram_size);
1603
    if (s->vbe_mapped) {
1604
        cpu_physical_log_stop(VBE_DISPI_LFB_PHYSICAL_ADDRESS, s->vram_size);
1604 1605
    }
1605 1606
#endif
1606 1607
}
b/hw/vhost.c
607 607
    hdev->client.set_memory = vhost_client_set_memory;
608 608
    hdev->client.sync_dirty_bitmap = vhost_client_sync_dirty_bitmap;
609 609
    hdev->client.migration_log = vhost_client_migration_log;
610
    hdev->client.log_start = NULL;
611
    hdev->client.log_stop = NULL;
610 612
    hdev->mem = qemu_mallocz(offsetof(struct vhost_memory, regions));
611 613
    hdev->log = NULL;
612 614
    hdev->log_size = 0;
b/kvm-all.c
274 274
    return kvm_set_user_memory_region(s, mem);
275 275
}
276 276

  
277
int kvm_log_start(target_phys_addr_t phys_addr, ram_addr_t size)
277
static int kvm_log_start(CPUPhysMemoryClient *client,
278
                         target_phys_addr_t phys_addr, ram_addr_t size)
278 279
{
279 280
    return kvm_dirty_pages_log_change(phys_addr, size, KVM_MEM_LOG_DIRTY_PAGES,
280 281
                                      KVM_MEM_LOG_DIRTY_PAGES);
281 282
}
282 283

  
283
int kvm_log_stop(target_phys_addr_t phys_addr, ram_addr_t size)
284
static int kvm_log_stop(CPUPhysMemoryClient *client,
285
                        target_phys_addr_t phys_addr, ram_addr_t size)
284 286
{
285 287
    return kvm_dirty_pages_log_change(phys_addr, size, 0,
286 288
                                      KVM_MEM_LOG_DIRTY_PAGES);
......
644 646
    .set_memory = kvm_client_set_memory,
645 647
    .sync_dirty_bitmap = kvm_client_sync_dirty_bitmap,
646 648
    .migration_log = kvm_client_migration_log,
649
    .log_start = kvm_log_start,
650
    .log_stop = kvm_log_stop,
647 651
};
648 652

  
649 653
int kvm_init(void)
b/kvm-stub.c
33 33
    return -ENOSYS;
34 34
}
35 35

  
36
int kvm_log_start(target_phys_addr_t phys_addr, ram_addr_t size)
37
{
38
    return -ENOSYS;
39
}
40

  
41
int kvm_log_stop(target_phys_addr_t phys_addr, ram_addr_t size)
42
{
43
    return -ENOSYS;
44
}
45

  
46 36
int kvm_coalesce_mmio_region(target_phys_addr_t start, ram_addr_t size)
47 37
{
48 38
    return -ENOSYS;
b/kvm.h
58 58
int kvm_cpu_exec(CPUState *env);
59 59

  
60 60
#if !defined(CONFIG_USER_ONLY)
61
int kvm_log_start(target_phys_addr_t phys_addr, ram_addr_t size);
62
int kvm_log_stop(target_phys_addr_t phys_addr, ram_addr_t size);
63

  
64 61
void kvm_setup_guest_memory(void *start, size_t size);
65 62

  
66 63
int kvm_coalesce_mmio_region(target_phys_addr_t start, ram_addr_t size);

Also available in: Unified diff