public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 rebased] KVM: MMU: Avoid dropping accessed bit while removing write access
@ 2010-12-05 16:11 Takuya Yoshikawa
  2010-12-05 16:13 ` [PATCH 2/2 rebased] KVM: MMU: Introduce a helper to access lpage_info Takuya Yoshikawa
  0 siblings, 1 reply; 8+ messages in thread
From: Takuya Yoshikawa @ 2010-12-05 16:11 UTC (permalink / raw)
  To: avi, mtosatti; +Cc: kvm, yoshikawa.takuya

From: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>

One more "KVM: MMU: Don't drop accessed bit while updating an spte."

Sptes are accessed by both kvm and hardware.
This patch uses update_spte() to fix the way of removing write access.

Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
---
 arch/x86/kvm/mmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 04c49b9..d75ba1e 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3446,7 +3446,7 @@ void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot)
 		for (i = 0; i < PT64_ENT_PER_PAGE; ++i)
 			/* avoid RMW */
 			if (is_writable_pte(pt[i]))
-				pt[i] &= ~PT_WRITABLE_MASK;
+				update_spte(&pt[i], pt[i] & ~PT_WRITABLE_MASK);
 	}
 	kvm_flush_remote_tlbs(kvm);
 }
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-12-07 13:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-05 16:11 [PATCH 1/2 rebased] KVM: MMU: Avoid dropping accessed bit while removing write access Takuya Yoshikawa
2010-12-05 16:13 ` [PATCH 2/2 rebased] KVM: MMU: Introduce a helper to access lpage_info Takuya Yoshikawa
2010-12-06  6:37   ` Xiao Guangrong
2010-12-06  7:55     ` Takuya Yoshikawa
2010-12-06  8:57       ` Takuya Yoshikawa
2010-12-06 13:07         ` Avi Kivity
2010-12-07  3:59           ` [PATCH 2/2 v2] KVM: MMU: Make the way of accessing lpage_info more generic Takuya Yoshikawa
2010-12-07 13:55             ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox