From patchwork Thu Jan 21 08:20:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 74302 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0L8Kf1n025201 for ; Thu, 21 Jan 2010 08:20:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752889Ab0AUIUi (ORCPT ); Thu, 21 Jan 2010 03:20:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754612Ab0AUIUi (ORCPT ); Thu, 21 Jan 2010 03:20:38 -0500 Received: from mga11.intel.com ([192.55.52.93]:41535 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751702Ab0AUIUh (ORCPT ); Thu, 21 Jan 2010 03:20:37 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 21 Jan 2010 00:20:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.49,316,1262592000"; d="scan'208";a="766067862" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.36.165]) by fmsmga001.fm.intel.com with ESMTP; 21 Jan 2010 00:20:35 -0800 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1NXsGs-0006Qa-4O; Thu, 21 Jan 2010 16:20:06 +0800 From: Sheng Yang To: Marcelo Tosatti Cc: Avi Kivity , kvm@vger.kernel.org, Sheng Yang Subject: [PATCH] KVM: Fix kvm_coalesced_mmio_ring duplicate allocation Date: Thu, 21 Jan 2010 16:20:04 +0800 Message-Id: <1264062004-24682-1-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.6.3.3 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 7c5c873..2b0974a 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -371,9 +371,6 @@ static struct kvm *kvm_create_vm(void) { int r = 0, i; struct kvm *kvm = kvm_arch_create_vm(); -#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET - struct page *page; -#endif if (IS_ERR(kvm)) goto out; @@ -402,23 +399,9 @@ static struct kvm *kvm_create_vm(void) } } -#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET - page = alloc_page(GFP_KERNEL | __GFP_ZERO); - if (!page) { - cleanup_srcu_struct(&kvm->srcu); - goto out_err; - } - - kvm->coalesced_mmio_ring = - (struct kvm_coalesced_mmio_ring *)page_address(page); -#endif - r = kvm_init_mmu_notifier(kvm); if (r) { cleanup_srcu_struct(&kvm->srcu); -#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET - put_page(page); -#endif goto out_err; }