From patchwork Fri Feb 19 18:22:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 80787 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1JIMxCK028946 for ; Fri, 19 Feb 2010 18:23:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755420Ab0BSSWx (ORCPT ); Fri, 19 Feb 2010 13:22:53 -0500 Received: from david.siemens.de ([192.35.17.14]:15220 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755288Ab0BSSWu (ORCPT ); Fri, 19 Feb 2010 13:22:50 -0500 Received: from mail3.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o1JIMSIV017242; Fri, 19 Feb 2010 19:22:28 +0100 Received: from localhost.localdomain (mchn012c.ww002.siemens.net [139.25.109.167] (may be forged)) by mail3.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o1JIMRG9025400; Fri, 19 Feb 2010 19:22:28 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, Anthony Liguori , Gleb Natapov Subject: [PATCH 4/9] qemu-kvm: Use upstream kvm_setup_guest_memory Date: Fri, 19 Feb 2010 19:22:22 +0100 Message-Id: <2dcac8a5adb7bcb3bbf65185309fee3e0fea48ef.1266603744.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: References: In-Reply-To: References: Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 19 Feb 2010 18:23:01 +0000 (UTC) diff --git a/kvm-all.c b/kvm-all.c index 9f1808f..b9c1553 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -932,7 +932,6 @@ int kvm_has_vcpu_events(void) return kvm_state->vcpu_events; } -#ifdef KVM_UPSTREAM void kvm_setup_guest_memory(void *start, size_t size) { if (!kvm_has_sync_mmu()) { @@ -951,8 +950,6 @@ void kvm_setup_guest_memory(void *start, size_t size) } } -#endif /* KVM_UPSTREAM */ - #ifdef KVM_CAP_SET_GUEST_DEBUG #ifdef KVM_UPSTREAM diff --git a/kvm.h b/kvm.h index f97efa3..724914d 100644 --- a/kvm.h +++ b/kvm.h @@ -48,10 +48,9 @@ int kvm_get_vcpu_events(CPUState *env); void kvm_cpu_register_phys_memory_client(void); -#ifdef KVM_UPSTREAM - void kvm_setup_guest_memory(void *start, size_t size); +#ifdef KVM_UPSTREAM int kvm_coalesce_mmio_region(target_phys_addr_t start, ram_addr_t size); int kvm_uncoalesce_mmio_region(target_phys_addr_t start, ram_addr_t size); void kvm_flush_coalesced_mmio_buffer(void); diff --git a/qemu-kvm.c b/qemu-kvm.c index 555d959..17a8080 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -2315,21 +2315,6 @@ void kvm_set_phys_mem(target_phys_addr_t start_addr, ram_addr_t size, return; } -int kvm_setup_guest_memory(void *area, unsigned long size) -{ - int ret = 0; - -#ifdef MADV_DONTFORK - if (kvm_enabled() && !kvm_has_sync_mmu()) - ret = madvise(area, size, MADV_DONTFORK); -#endif - - if (ret) - perror("madvise"); - - return ret; -} - #ifdef KVM_CAP_SET_GUEST_DEBUG struct kvm_set_guest_debug_data { diff --git a/qemu-kvm.h b/qemu-kvm.h index 069d2c6..f9c797f 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -923,7 +923,6 @@ void kvm_cpu_destroy_phys_mem(target_phys_addr_t start_addr, unsigned long size); void kvm_qemu_log_memory(target_phys_addr_t start, target_phys_addr_t size, int log); -int kvm_setup_guest_memory(void *area, unsigned long size); int kvm_qemu_create_memory_alias(uint64_t phys_start, uint64_t len, uint64_t target_phys); int kvm_qemu_destroy_memory_alias(uint64_t phys_start);