kvm-all.c (9e5319ca52a5b9e84d55ad9c36e2c0b317a122bb) kvm-all.c (038adc2f5850e32019bda06c559d0301be436eae)
1/*
2 * QEMU KVM support
3 *
4 * Copyright IBM, Corp. 2008
5 * Red Hat, Inc. 2008
6 *
7 * Authors:
8 * Anthony Liguori <aliguori@us.ibm.com>

--- 38 unchanged lines hidden (view full) ---

47/* This check must be after config-host.h is included */
48#ifdef CONFIG_EVENTFD
49#include <sys/eventfd.h>
50#endif
51
52/* KVM uses PAGE_SIZE in its definition of KVM_COALESCED_MMIO_MAX. We
53 * need to use the real host PAGE_SIZE, as that's what KVM will use.
54 */
1/*
2 * QEMU KVM support
3 *
4 * Copyright IBM, Corp. 2008
5 * Red Hat, Inc. 2008
6 *
7 * Authors:
8 * Anthony Liguori <aliguori@us.ibm.com>

--- 38 unchanged lines hidden (view full) ---

47/* This check must be after config-host.h is included */
48#ifdef CONFIG_EVENTFD
49#include <sys/eventfd.h>
50#endif
51
52/* KVM uses PAGE_SIZE in its definition of KVM_COALESCED_MMIO_MAX. We
53 * need to use the real host PAGE_SIZE, as that's what KVM will use.
54 */
55#define PAGE_SIZE getpagesize()
55#define PAGE_SIZE qemu_real_host_page_size
56
57//#define DEBUG_KVM
58
59#ifdef DEBUG_KVM
60#define DPRINTF(fmt, ...) \
61 do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
62#else
63#define DPRINTF(fmt, ...) \

--- 438 unchanged lines hidden (view full) ---

502}
503
504/* get kvm's dirty pages bitmap and update qemu's */
505static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section,
506 unsigned long *bitmap)
507{
508 ram_addr_t start = section->offset_within_region +
509 memory_region_get_ram_addr(section->mr);
56
57//#define DEBUG_KVM
58
59#ifdef DEBUG_KVM
60#define DPRINTF(fmt, ...) \
61 do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
62#else
63#define DPRINTF(fmt, ...) \

--- 438 unchanged lines hidden (view full) ---

502}
503
504/* get kvm's dirty pages bitmap and update qemu's */
505static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section,
506 unsigned long *bitmap)
507{
508 ram_addr_t start = section->offset_within_region +
509 memory_region_get_ram_addr(section->mr);
510 ram_addr_t pages = int128_get64(section->size) / getpagesize();
510 ram_addr_t pages = int128_get64(section->size) / qemu_real_host_page_size;
511
512 cpu_physical_memory_set_dirty_lebitmap(bitmap, start, pages);
513 return 0;
514}
515
516#define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1))
517
518/**

--- 1317 unchanged lines hidden (view full) ---

1836 s = KVM_STATE(ms->accelerator);
1837
1838 /*
1839 * On systems where the kernel can support different base page
1840 * sizes, host page size may be different from TARGET_PAGE_SIZE,
1841 * even with KVM. TARGET_PAGE_SIZE is assumed to be the minimum
1842 * page size for the system though.
1843 */
511
512 cpu_physical_memory_set_dirty_lebitmap(bitmap, start, pages);
513 return 0;
514}
515
516#define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1))
517
518/**

--- 1317 unchanged lines hidden (view full) ---

1836 s = KVM_STATE(ms->accelerator);
1837
1838 /*
1839 * On systems where the kernel can support different base page
1840 * sizes, host page size may be different from TARGET_PAGE_SIZE,
1841 * even with KVM. TARGET_PAGE_SIZE is assumed to be the minimum
1842 * page size for the system though.
1843 */
1844 assert(TARGET_PAGE_SIZE <= getpagesize());
1844 assert(TARGET_PAGE_SIZE <= qemu_real_host_page_size);
1845
1846 s->sigmask_len = 8;
1847
1848#ifdef KVM_CAP_SET_GUEST_DEBUG
1849 QTAILQ_INIT(&s->kvm_sw_breakpoints);
1850#endif
1851 QLIST_INIT(&s->kvm_parked_vcpus);
1852 s->vmfd = -1;

--- 1094 unchanged lines hidden ---
1845
1846 s->sigmask_len = 8;
1847
1848#ifdef KVM_CAP_SET_GUEST_DEBUG
1849 QTAILQ_INIT(&s->kvm_sw_breakpoints);
1850#endif
1851 QLIST_INIT(&s->kvm_parked_vcpus);
1852 s->vmfd = -1;

--- 1094 unchanged lines hidden ---