From patchwork Tue Jun 2 21:36:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 27563 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n52Liihh009435 for ; Tue, 2 Jun 2009 21:44:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752912AbZFBVog (ORCPT ); Tue, 2 Jun 2009 17:44:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753068AbZFBVog (ORCPT ); Tue, 2 Jun 2009 17:44:36 -0400 Received: from mx2.redhat.com ([66.187.237.31]:45318 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752912AbZFBVoe (ORCPT ); Tue, 2 Jun 2009 17:44:34 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n52Libhq028067; Tue, 2 Jun 2009 17:44:37 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n52LiYt3021991; Tue, 2 Jun 2009 17:44:34 -0400 Received: from amt.cnet (vpn-10-3.str.redhat.com [10.32.10.3]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n52LiWLe026300; Tue, 2 Jun 2009 17:44:33 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 460D5274E89; Tue, 2 Jun 2009 18:44:08 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id n52Li0bQ009745; Tue, 2 Jun 2009 18:44:00 -0300 Message-Id: <20090602214227.077946265@localhost.localdomain> References: <20090602213655.640083007@localhost.localdomain> User-Agent: quilt/0.46-1 Date: Tue, 02 Jun 2009 18:36:58 -0300 From: Marcelo Tosatti To: avi@redhat.com, sheng@linux.intel.com Cc: kvm@vger.kernel.org, Marcelo Tosatti Subject: [patch 3/4] KVM: MMU audit: nontrapping ptes in nonleaf level Content-Disposition: inline; filename=mmu-audit-3 X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org update_pte sets nonleaf sptes as notrap, so either it or the audit code is broken. Choose the audit code. Signed-off-by: Marcelo Tosatti Index: kvm/arch/x86/kvm/mmu.c =================================================================== --- kvm.orig/arch/x86/kvm/mmu.c +++ kvm/arch/x86/kvm/mmu.c @@ -3081,12 +3081,7 @@ static void audit_mappings_page(struct k va = canonicalize(va); if (level > 1) { - if (ent == shadow_notrap_nonpresent_pte) - printk(KERN_ERR "audit: (%s) nontrapping pte" - " in nonleaf level: levels %d gva %lx" - " level %d pte %llx\n", audit_msg, - vcpu->arch.mmu.root_level, va, level, ent); - else + if (is_shadow_present_pte(ent)) audit_mappings_page(vcpu, ent, va, level - 1); } else { gpa_t gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, va);