From patchwork Thu Jan 7 15:56:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 71598 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 o07FrYnH028318 for ; Thu, 7 Jan 2010 15:53:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753018Ab0AGPxD (ORCPT ); Thu, 7 Jan 2010 10:53:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752382Ab0AGPxB (ORCPT ); Thu, 7 Jan 2010 10:53:01 -0500 Received: from mail-ew0-f219.google.com ([209.85.219.219]:59622 "EHLO mail-ew0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752079Ab0AGPxA (ORCPT ); Thu, 7 Jan 2010 10:53:00 -0500 Received: by ewy19 with SMTP id 19so10916403ewy.21 for ; Thu, 07 Jan 2010 07:52:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=rJJlTM8bMgi/1NGaG1st+p4AbUe3O/uvq7TQ/KSzCjo=; b=V+DBnM6etaBMkvtrhdTfIiU9yHeprHrw0SbqYgiw2hsCNqb8yG12yLWGFXmFgoQg1/ 2JJdUIEnqnWCLrvaSuh6ssinLIjF3PJZcbaueSE9fZvmCFKtdqcW3eAQOJm9RyXORQ0a HMT0UgZD/E0Cs3EQndKG3LbvNn2dI+S5dU9y8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=RZiCsAVaRGht7AZUHB/5WIRc3QqTHAm0s10Fyi1IIjLrJCFnKVK/rI8nruzuC6Ffn7 6uVibhFkD2O2+SQr6YNzSXqRiNEXNKp5Dk6+mV6nvXKoqtbZBWERryHD7YfJreuE1Hv4 HxZBfCej2HGejD3uJbgyQ+JjzP1PBropx0KJM= Received: by 10.213.107.65 with SMTP id a1mr2948701ebp.85.1262879577989; Thu, 07 Jan 2010 07:52:57 -0800 (PST) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 7sm43863547eyg.25.2010.01.07.07.52.56 (version=SSLv3 cipher=RC4-MD5); Thu, 07 Jan 2010 07:52:56 -0800 (PST) Message-ID: <4B460441.6090602@gmail.com> Date: Thu, 07 Jan 2010 16:56:49 +0100 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0 MIME-Version: 1.0 To: Avi Kivity , Marcelo Tosatti , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kvm: don't treat NULL parent_pte as multimapped in mmu_parent_walk() Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 4c3e5b2..eb17287 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -1031,10 +1031,12 @@ static void mmu_parent_walk(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp, struct kvm_mmu_page *parent_sp; int i; - if (!sp->multimapped && sp->parent_pte) { - parent_sp = page_header(__pa(sp->parent_pte)); - fn(vcpu, parent_sp); - mmu_parent_walk(vcpu, parent_sp, fn); + if (!sp->multimapped) { + if (sp->parent_pte) { + parent_sp = page_header(__pa(sp->parent_pte)); + fn(vcpu, parent_sp); + mmu_parent_walk(vcpu, parent_sp, fn); + } return; } hlist_for_each_entry(pte_chain, node, &sp->parent_ptes, link)