From patchwork Tue Jun 9 13:13:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 29009 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 n59DG9GE004583 for ; Tue, 9 Jun 2009 13:16:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759268AbZFINP4 (ORCPT ); Tue, 9 Jun 2009 09:15:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759085AbZFINP4 (ORCPT ); Tue, 9 Jun 2009 09:15:56 -0400 Received: from mx2.redhat.com ([66.187.237.31]:42146 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757077AbZFINPz (ORCPT ); Tue, 9 Jun 2009 09:15:55 -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 n59DFwBd009266 for ; Tue, 9 Jun 2009 09:15:58 -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 n59DFvBN032569; Tue, 9 Jun 2009 09:15:57 -0400 Received: from amt.cnet (vpn-10-7.str.redhat.com [10.32.10.7]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n59DFsRw026733; Tue, 9 Jun 2009 09:15:55 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 68993274FD5; Tue, 9 Jun 2009 10:15:25 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id n59DFOjV007474; Tue, 9 Jun 2009 10:15:24 -0300 Message-Id: <20090609131405.993541433@localhost.localdomain> References: <20090609131303.446673264@localhost.localdomain> User-Agent: quilt/0.46-1 Date: Tue, 09 Jun 2009 10:13:06 -0300 From: Marcelo Tosatti To: kvm@vger.kernel.org Cc: avi@redhat.com, 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 @@ -3084,12 +3084,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);