From patchwork Fri Jul 24 17:46:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 37160 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6OHkV85004833 for ; Fri, 24 Jul 2009 17:46:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752885AbZGXRq3 (ORCPT ); Fri, 24 Jul 2009 13:46:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752833AbZGXRq3 (ORCPT ); Fri, 24 Jul 2009 13:46:29 -0400 Received: from mx2.redhat.com ([66.187.237.31]:51576 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752813AbZGXRq2 (ORCPT ); Fri, 24 Jul 2009 13:46:28 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6OHkSEG009495 for ; Fri, 24 Jul 2009 13:46:28 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6OHkQxl017119; Fri, 24 Jul 2009 13:46:27 -0400 Received: from localhost.localdomain (virtlab1.virt.bos.redhat.com [10.16.72.21]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6OHkQPI019614; Fri, 24 Jul 2009 13:46:26 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH] use kvm_has_sync_mmu from upstream. Date: Fri, 24 Jul 2009 13:46:26 -0400 Message-Id: <1248457586-405-1-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org they have it, and it does the same as we do. Signed-off-by: Glauber Costa --- kvm-all.c | 3 +++ qemu-kvm.c | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index b4b5a35..157b968 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -848,6 +848,8 @@ int kvm_vcpu_ioctl(CPUState *env, int type, ...) return ret; } +#endif + int kvm_has_sync_mmu(void) { #ifdef KVM_CAP_SYNC_MMU @@ -859,6 +861,7 @@ int kvm_has_sync_mmu(void) #endif } +#ifdef KVM_UPSTREAM void kvm_setup_guest_memory(void *start, size_t size) { if (!kvm_has_sync_mmu()) { diff --git a/qemu-kvm.c b/qemu-kvm.c index bca256c..fdf71a8 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1152,15 +1152,6 @@ int kvm_pit_in_kernel(kvm_context_t kvm) return kvm->pit_in_kernel; } -int kvm_has_sync_mmu(void) -{ - int r = 0; -#ifdef KVM_CAP_SYNC_MMU - r = kvm_ioctl(kvm_state, KVM_CHECK_EXTENSION, KVM_CAP_SYNC_MMU); -#endif - return r; -} - int kvm_inject_nmi(kvm_vcpu_context_t vcpu) { #ifdef KVM_CAP_USER_NMI