From patchwork Thu Jun 23 11:09:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 101609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 32703B6F87 for ; Thu, 23 Jun 2011 21:20:30 +1000 (EST) Received: from localhost ([::1]:35750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZhxS-0000sS-Ct for incoming@patchwork.ozlabs.org; Thu, 23 Jun 2011 07:20:26 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZhme-0007CC-5I for qemu-devel@nongnu.org; Thu, 23 Jun 2011 07:09:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZhmc-0007v8-2L for qemu-devel@nongnu.org; Thu, 23 Jun 2011 07:09:15 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:39372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZhmb-0007ur-9R for qemu-devel@nongnu.org; Thu, 23 Jun 2011 07:09:13 -0400 Received: from smtp02.web.de ( [172.20.0.184]) by fmmailgate02.web.de (Postfix) with ESMTP id 91D191A392355; Thu, 23 Jun 2011 13:09:11 +0200 (CEST) Received: from [88.65.252.133] (helo=mchn199C.mchp.siemens.de) by smtp02.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1QZhmZ-0003VR-00; Thu, 23 Jun 2011 13:09:11 +0200 Message-ID: <4E031ED6.1050804@web.de> Date: Thu, 23 Jun 2011 13:09:10 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Anthony Liguori , qemu-devel References: <7e392169046f7464027d3916b9cb081abd1f984d.1308070416.git.jan.kiszka@siemens.com> In-Reply-To: <7e392169046f7464027d3916b9cb081abd1f984d.1308070416.git.jan.kiszka@siemens.com> X-Enigmail-Version: 1.1.2 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX180Snv0QaveXVKXzE0oUFR/cwlc6Ydat9+e7Bjk 9fcyzAPHG+ZciITXp7+tsGJu3MiEg9QrRB+yBuAiRwbdPN1jOk V9Jxdaqc0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.227 Cc: Anthony PERARD , Avi Kivity , "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH v2 10/13] Drop dirty log start/stop infrastructure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka No more users of vga_dirty_log_start/start, thus also no use anymore for the log_start/stop CPUPhysMemoryClient callbacks. Drop the whole infrastructure. CC: Anthony PERARD CC: Michael S. Tsirkin CC: Avi Kivity Signed-off-by: Jan Kiszka --- Changes in v2: - rebased over master, removing the freshly added Xen hooks Avi, does this match your plans for a new memory API? Or would be end up reintroducing such callbacks after the refactoring? --- cpu-all.h | 6 ------ cpu-common.h | 4 ---- exec.c | 30 ------------------------------ hw/vga.c | 36 ------------------------------------ hw/vga_int.h | 3 --- hw/vhost.c | 2 -- kvm-all.c | 47 ----------------------------------------------- xen-all.c | 18 ------------------ 8 files changed, 0 insertions(+), 146 deletions(-) diff --git a/cpu-all.h b/cpu-all.h index 880f570..ac81a07 100644 --- a/cpu-all.h +++ b/cpu-all.h @@ -1015,12 +1015,6 @@ int cpu_physical_memory_get_dirty_tracking(void); int cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr, target_phys_addr_t end_addr); -int cpu_physical_log_start(target_phys_addr_t start_addr, - ram_addr_t size); - -int cpu_physical_log_stop(target_phys_addr_t start_addr, - ram_addr_t size); - void dump_exec_info(FILE *f, fprintf_function cpu_fprintf); #endif /* !CONFIG_USER_ONLY */ diff --git a/cpu-common.h b/cpu-common.h index b027e43..07379c5 100644 --- a/cpu-common.h +++ b/cpu-common.h @@ -112,10 +112,6 @@ struct CPUPhysMemoryClient { target_phys_addr_t end_addr); int (*migration_log)(struct CPUPhysMemoryClient *client, int enable); - int (*log_start)(struct CPUPhysMemoryClient *client, - target_phys_addr_t phys_addr, ram_addr_t size); - int (*log_stop)(struct CPUPhysMemoryClient *client, - target_phys_addr_t phys_addr, ram_addr_t size); QLIST_ENTRY(CPUPhysMemoryClient) list; }; diff --git a/exec.c b/exec.c index b03b5be..56b95ab 100644 --- a/exec.c +++ b/exec.c @@ -2127,36 +2127,6 @@ int cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr, return ret; } -int cpu_physical_log_start(target_phys_addr_t start_addr, - ram_addr_t size) -{ - CPUPhysMemoryClient *client; - QLIST_FOREACH(client, &memory_client_list, list) { - if (client->log_start) { - int r = client->log_start(client, start_addr, size); - if (r < 0) { - return r; - } - } - } - return 0; -} - -int cpu_physical_log_stop(target_phys_addr_t start_addr, - ram_addr_t size) -{ - CPUPhysMemoryClient *client; - QLIST_FOREACH(client, &memory_client_list, list) { - if (client->log_stop) { - int r = client->log_stop(client, start_addr, size); - if (r < 0) { - return r; - } - } - } - return 0; -} - static inline void tlb_update_dirty(CPUTLBEntry *tlb_entry) { ram_addr_t ram_addr; diff --git a/hw/vga.c b/hw/vga.c index fdfa3c4..a74f581 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -1570,42 +1570,6 @@ static void vga_sync_dirty_bitmap(VGACommonState *s) } -void vga_dirty_log_start(VGACommonState *s) -{ - if (s->map_addr) { - cpu_physical_log_start(s->map_addr, s->map_end - s->map_addr); - } - - if (s->lfb_vram_mapped) { - cpu_physical_log_start(isa_mem_base + 0xa0000, 0x8000); - cpu_physical_log_start(isa_mem_base + 0xa8000, 0x8000); - } - -#ifdef CONFIG_BOCHS_VBE - if (s->vbe_mapped) { - cpu_physical_log_start(VBE_DISPI_LFB_PHYSICAL_ADDRESS, s->vram_size); - } -#endif -} - -void vga_dirty_log_stop(VGACommonState *s) -{ - if (s->map_addr) { - cpu_physical_log_stop(s->map_addr, s->map_end - s->map_addr); - } - - if (s->lfb_vram_mapped) { - cpu_physical_log_stop(isa_mem_base + 0xa0000, 0x8000); - cpu_physical_log_stop(isa_mem_base + 0xa8000, 0x8000); - } - -#ifdef CONFIG_BOCHS_VBE - if (s->vbe_mapped) { - cpu_physical_log_stop(VBE_DISPI_LFB_PHYSICAL_ADDRESS, s->vram_size); - } -#endif -} - /* * graphic modes */ diff --git a/hw/vga_int.h b/hw/vga_int.h index 5cd9a6e..73328c2 100644 --- a/hw/vga_int.h +++ b/hw/vga_int.h @@ -194,9 +194,6 @@ void vga_init(VGACommonState *s); int vga_init_io(VGACommonState *s); void vga_common_reset(VGACommonState *s); -void vga_dirty_log_start(VGACommonState *s); -void vga_dirty_log_stop(VGACommonState *s); - extern const VMStateDescription vmstate_vga_common; uint32_t vga_ioport_read(void *opaque, uint32_t addr); void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val); diff --git a/hw/vhost.c b/hw/vhost.c index 80f771e..b7e6284 100644 --- a/hw/vhost.c +++ b/hw/vhost.c @@ -668,8 +668,6 @@ int vhost_dev_init(struct vhost_dev *hdev, int devfd, bool force) hdev->client.set_memory = vhost_client_set_memory; hdev->client.sync_dirty_bitmap = vhost_client_sync_dirty_bitmap; hdev->client.migration_log = vhost_client_migration_log; - hdev->client.log_start = NULL; - hdev->client.log_stop = NULL; hdev->mem = qemu_mallocz(offsetof(struct vhost_memory, regions)); hdev->log = NULL; hdev->log_size = 0; diff --git a/kvm-all.c b/kvm-all.c index cbc2532..c95a64d 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -100,24 +100,6 @@ static KVMSlot *kvm_alloc_slot(KVMState *s) abort(); } -static KVMSlot *kvm_lookup_matching_slot(KVMState *s, - target_phys_addr_t start_addr, - target_phys_addr_t end_addr) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(s->slots); i++) { - KVMSlot *mem = &s->slots[i]; - - if (start_addr == mem->start_addr && - end_addr == mem->start_addr + mem->memory_size) { - return mem; - } - } - - return NULL; -} - /* * Find overlapping slot with lowest start address */ @@ -274,33 +256,6 @@ static int kvm_slot_dirty_pages_log_change(KVMSlot *mem, bool log_dirty) return kvm_set_user_memory_region(s, mem); } -static int kvm_dirty_pages_log_change(target_phys_addr_t phys_addr, - ram_addr_t size, bool log_dirty) -{ - KVMState *s = kvm_state; - KVMSlot *mem = kvm_lookup_matching_slot(s, phys_addr, phys_addr + size); - - if (mem == NULL) { - fprintf(stderr, "BUG: %s: invalid parameters " TARGET_FMT_plx "-" - TARGET_FMT_plx "\n", __func__, phys_addr, - (target_phys_addr_t)(phys_addr + size - 1)); - return -EINVAL; - } - return kvm_slot_dirty_pages_log_change(mem, log_dirty); -} - -static int kvm_log_start(CPUPhysMemoryClient *client, - target_phys_addr_t phys_addr, ram_addr_t size) -{ - return kvm_dirty_pages_log_change(phys_addr, size, true); -} - -static int kvm_log_stop(CPUPhysMemoryClient *client, - target_phys_addr_t phys_addr, ram_addr_t size) -{ - return kvm_dirty_pages_log_change(phys_addr, size, false); -} - static int kvm_set_migration_log(int enable) { KVMState *s = kvm_state; @@ -679,8 +634,6 @@ static CPUPhysMemoryClient kvm_cpu_phys_memory_client = { .set_memory = kvm_client_set_memory, .sync_dirty_bitmap = kvm_client_sync_dirty_bitmap, .migration_log = kvm_client_migration_log, - .log_start = kvm_log_start, - .log_stop = kvm_log_stop, }; static void kvm_handle_interrupt(CPUState *env, int mask) diff --git a/xen-all.c b/xen-all.c index fcb106f..3c87b36 100644 --- a/xen-all.c +++ b/xen-all.c @@ -416,22 +416,6 @@ static int xen_sync_dirty_bitmap(XenIOState *state, return 0; } -static int xen_log_start(CPUPhysMemoryClient *client, target_phys_addr_t phys_addr, ram_addr_t size) -{ - XenIOState *state = container_of(client, XenIOState, client); - - return xen_sync_dirty_bitmap(state, phys_addr, size); -} - -static int xen_log_stop(CPUPhysMemoryClient *client, target_phys_addr_t phys_addr, ram_addr_t size) -{ - XenIOState *state = container_of(client, XenIOState, client); - - state->log_for_dirtybit = NULL; - /* Disable dirty bit tracking */ - return xc_hvm_track_dirty_vram(xen_xc, xen_domid, 0, 0, NULL); -} - static int xen_client_sync_dirty_bitmap(struct CPUPhysMemoryClient *client, target_phys_addr_t start_addr, target_phys_addr_t end_addr) @@ -451,8 +435,6 @@ static CPUPhysMemoryClient xen_cpu_phys_memory_client = { .set_memory = xen_client_set_memory, .sync_dirty_bitmap = xen_client_sync_dirty_bitmap, .migration_log = xen_client_migration_log, - .log_start = xen_log_start, - .log_stop = xen_log_stop, }; /* VCPU Operations, MMIO, IO ring ... */