From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 3/3] kvm mmu: alloc shadow pages with __GFP_ZERO Date: Wed, 18 Feb 2009 14:14:16 +0000 Message-ID: <499C17B8.3030609@redhat.com> References: <1234962540-7131-1-git-send-email-joerg.roedel@amd.com> <1234962540-7131-4-git-send-email-joerg.roedel@amd.com> <499C1158.7020401@redhat.com> <20090218135436.GF8751@amd.com> <499C1536.30302@redhat.com> <20090218141017.GG8751@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Joerg Roedel Return-path: Received: from mx2.redhat.com ([66.187.237.31]:46362 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751692AbZBRONs (ORCPT ); Wed, 18 Feb 2009 09:13:48 -0500 In-Reply-To: <20090218141017.GG8751@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: Joerg Roedel wrote: >> sp->spt is allocated using mmu_memory_cache_alloc(), which zeros the page. How can the assertion fail? >> > > In the code I see (current kvm-git) mmu_memory_cache_alloc() does zero > nothing. It takes the page from the preallocated pool and returns it. > The pool itself is filled with mmu_topup_memory_caches() which calls > mmu_topup_memory_cache_page() to fill the mmu_page_cache (from which the > sp->spt page is allocated later). And the mmu_topup_memory_cache_page() > function calls alloc_page() and does not zero the result. This let the > assertion trigger. > Right, I was looking at the 2.6.29 tree. The patch is correct (and the others look good as well). As usual, I'd like Marcelo to take a look as well. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.