From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Arcangeli Subject: [PATCH 6/6] kvm.git allow reserved pages to be used as guest phys ram Date: Fri, 25 Jul 2008 16:44:03 +0200 Message-ID: <20080725144403.GF8217@duo.random> References: <20080725142452.GA8217@duo.random> <20080725142639.GB8217@duo.random> <20080725143203.GC8217@duo.random> <20080725143834.GD8217@duo.random> <20080725144043.GE8217@duo.random> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from host36-195-149-62.serverdedicati.aruba.it ([62.149.195.36]:57409 "EHLO mx.cpushare.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbYGYOoE (ORCPT ); Fri, 25 Jul 2008 10:44:04 -0400 Content-Disposition: inline In-Reply-To: <20080725144043.GE8217@duo.random> Sender: kvm-owner@vger.kernel.org List-ID: This is an incremental fix on top of Ben-Ami reserved-pages-mmio patch. I need this for the reserved-ram 1:1 patch because I must allow to map reserved pages with a valid pfn in the user address space of the kvm task. This is because those reserved pages aren't mmio regions for me but the real backing of the guest physical ram. Reserved pages can be mapped through the ->fault api just fine, as long as a pfn exists for them, and the reserved-ram patch ensures that a pfn exists for them and that they're marked reserved as expected by special ram reserved at boot time. Signed-off-by: Andrea Arcangeli kvm_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Index: virt/kvm/kvm_main.c --- virt/kvm/kvm_main.c.orig 2008-06-25 02:39:51.000000000 +0200 +++ a/virt/kvm/kvm_main.c 2008-06-25 02:40:35.000000000 +0200 @@ -604,10 +604,9 @@ struct page *gfn_to_page(struct kvm *kvm pfn_t pfn; pfn = gfn_to_pfn(kvm, gfn); - if (!is_mmio_pfn(pfn)) + if (pfn_valid(pfn)) return pfn_to_page(pfn); - - WARN_ON(is_mmio_pfn(pfn)); + WARN_ON(1); get_page(bad_page); return bad_page;