All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: avi@redhat.com
Cc: kvm@vger.kernel.org, Marcelo Tosatti <mtosatti@redhat.com>
Subject: [patch 5/6] KVM: MMU audit: audit_mappings tweaks
Date: Wed, 10 Jun 2009 12:27:07 -0300	[thread overview]
Message-ID: <20090610152747.962751259@localhost.localdomain> (raw)
In-Reply-To: 20090610152702.666650177@localhost.localdomain

[-- Attachment #1: mmu-audit-4 --]
[-- Type: text/plain, Size: 1108 bytes --]

- Fail early in case gfn_to_pfn returns is_error_pfn.
- For the pre pte write case, avoid spurious "gva is valid but spte is notrap" 
  messages (the emulation code does the guest write first, so this particular
  case is OK).

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

Index: kvm/arch/x86/kvm/mmu.c
===================================================================
--- kvm.orig/arch/x86/kvm/mmu.c
+++ kvm/arch/x86/kvm/mmu.c
@@ -3092,6 +3092,11 @@ static void audit_mappings_page(struct k
 			pfn_t pfn = gfn_to_pfn(vcpu->kvm, gfn);
 			hpa_t hpa = (hpa_t)pfn << PAGE_SHIFT;
 
+			if (is_error_pfn(pfn)) {
+				kvm_release_pfn_clean(pfn);
+				continue;
+			}
+
 			if (is_shadow_present_pte(ent)
 			    && (ent & PT64_BASE_ADDR_MASK) != hpa)
 				printk(KERN_ERR "xx audit error: (%s) levels %d"
@@ -3263,7 +3268,8 @@ static void kvm_mmu_audit(struct kvm_vcp
 	audit_msg = msg;
 	audit_rmap(vcpu);
 	audit_write_protection(vcpu);
-	audit_mappings(vcpu);
+	if (strcmp("pre pte write", audit_msg) != 0)
+		audit_mappings(vcpu);
 	audit_writable_sptes_have_rmaps(vcpu);
 	dbg = olddbg;
 }

-- 


  parent reply	other threads:[~2009-06-10 15:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-02 21:36 [patch 0/4] mmu audit update Marcelo Tosatti
2009-06-02 21:36 ` [patch 1/4] KVM: MMU audit: update count_writable_mappings / count_rmaps Marcelo Tosatti
2009-06-08  9:24   ` Avi Kivity
2009-06-09 12:33     ` Marcelo Tosatti
2009-06-09 12:40       ` Avi Kivity
2009-06-02 21:36 ` [patch 2/4] KVM: MMU audit: update audit_write_protection Marcelo Tosatti
2009-06-02 21:36 ` [patch 3/4] KVM: MMU audit: nontrapping ptes in nonleaf level Marcelo Tosatti
2009-06-02 21:36 ` [patch 4/4] KVM: MMU audit: audit_mappings tweaks Marcelo Tosatti
2009-06-08  9:29   ` Avi Kivity
2009-06-07  7:14 ` [patch 0/4] mmu audit update Avi Kivity
2009-06-10 15:27   ` [patch 0/6] mmu audit update v4 Marcelo Tosatti
2009-06-10 15:27     ` [patch 1/6] KVM: MMU: introduce is_last_spte helper Marcelo Tosatti
2009-06-10 15:27     ` [patch 2/6] KVM: MMU audit: update count_writable_mappings / count_rmaps Marcelo Tosatti
2009-06-10 15:27     ` [patch 3/6] KVM: MMU audit: update audit_write_protection Marcelo Tosatti
2009-06-10 15:27     ` [patch 4/6] KVM: MMU audit: nontrapping ptes in nonleaf level Marcelo Tosatti
2009-06-10 15:27     ` Marcelo Tosatti [this message]
2009-06-10 15:27     ` [patch 6/6] KVM: MMU audit: largepage handling Marcelo Tosatti
2009-06-11 14:24     ` [patch 0/6] mmu audit update v4 Avi Kivity
2009-06-09 13:13 ` [patch 0/4] mmu audit update v2 Marcelo Tosatti
2009-06-09 13:13   ` [patch 1/4] KVM: MMU audit: update count_writable_mappings / count_rmaps Marcelo Tosatti
2009-06-09 13:13   ` [patch 2/4] KVM: MMU audit: update audit_write_protection Marcelo Tosatti
2009-06-09 13:13   ` [patch 3/4] KVM: MMU audit: nontrapping ptes in nonleaf level Marcelo Tosatti
2009-06-09 13:13   ` [patch 4/4] KVM: MMU audit: audit_mappings tweaks Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090610152747.962751259@localhost.localdomain \
    --to=mtosatti@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.