From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] Don't assume struct page for x86 MMU Date: Sun, 06 Apr 2008 14:44:56 +0300 Message-ID: <47F8B7B8.8070605@qumranet.com> References: <1207165616-26818-1-git-send-email-aliguori@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, Andrea Arcangeli , Ben-Ami Yassour To: Anthony Liguori Return-path: In-Reply-To: <1207165616-26818-1-git-send-email-aliguori@us.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Anthony Liguori wrote: > This patch introduces a gfn_to_pfn() function and corresponding functions like > kvm_release_pfn_dirty(). Using these new functions, we can modify the x86 > MMU to no longer assume that it can always get a struct page for any given gfn. > > We don't want to eliminate gfn_to_page() entirely because a number of places > assume they can do gfn_to_page() and then kmap() the results. When we support > IO memory, gfn_to_page() will fail for IO pages although gfn_to_pfn() will > succeed. > > This does not implement support for avoiding reference counting for reserved > RAM or for IO memory. However, it should make those things pretty straight > forward. > > Since we're only introducing new common symbols, I don't think it will break > the non-x86 architectures but I haven't tested those. I've tested Intel, > AMD, NPT, and hugetlbfs with Windows and Linux guests. > > Applied, thanks. > @ -1089,7 +1086,7 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte, > if (largepage) > spte |= PT_PAGE_SIZE_MASK; > > - spte |= page_to_phys(page); > + spte |= (pfn << PAGE_SHIFT); > This overflows on i386 with >=4GB RAM. I fixed it before committing. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone