From patchwork Wed Feb 3 08:53:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 44352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3B134B7D4F for ; Wed, 3 Feb 2010 20:05:03 +1100 (EST) Received: from localhost ([127.0.0.1]:53978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcbAS-0002dQ-EZ for incoming@patchwork.ozlabs.org; Wed, 03 Feb 2010 04:05:00 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ncazn-0001uY-9R for qemu-devel@nongnu.org; Wed, 03 Feb 2010 03:53:59 -0500 Received: from [199.232.76.173] (port=56375 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ncazm-0001tb-Gb for qemu-devel@nongnu.org; Wed, 03 Feb 2010 03:53:58 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ncazk-000780-5L for qemu-devel@nongnu.org; Wed, 03 Feb 2010 03:53:57 -0500 Received: from thoth.sbs.de ([192.35.17.2]:20947) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ncazg-00076e-OP for qemu-devel@nongnu.org; Wed, 03 Feb 2010 03:53:53 -0500 Received: from mail3.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id o138roIX025898; Wed, 3 Feb 2010 09:53:50 +0100 Received: from localhost.localdomain ([139.25.173.28]) by mail3.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o138rkC7012112; Wed, 3 Feb 2010 09:53:50 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Wed, 3 Feb 2010 09:53:31 +0100 Message-Id: X-Mailer: git-send-email 1.6.0.2 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Cc: Anthony Liguori , Glauber Costa , Alexander Graf , kvm@vger.kernel.org, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH v2 06/21] qemu-kvm: Use upstream kvm_setup_guest_memory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Nothing missing in upstream kvm_setup_guest_memory, it is even more careful about error handling. Signed-off-by: Jan Kiszka --- kvm-all.c | 3 --- kvm.h | 3 +-- qemu-kvm.c | 15 --------------- qemu-kvm.h | 1 - 4 files changed, 1 insertions(+), 21 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 0423fff..e7fa605 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -886,7 +886,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()) { @@ -905,8 +904,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 d0f4bbe..05ee540 100644 --- a/kvm.h +++ b/kvm.h @@ -54,10 +54,9 @@ int kvm_has_vcpu_events(void); int kvm_put_vcpu_events(CPUState *env); int kvm_get_vcpu_events(CPUState *env); -#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); diff --git a/qemu-kvm.c b/qemu-kvm.c index 32e2873..b153ee1 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -2321,21 +2321,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 a6e3271..de00763 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);