public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] KVM: MMU: update 'root_hpa' out of loop in PAE shadow path
@ 2010-09-27 10:02 Xiao Guangrong
  2010-09-27 10:03 ` [PATCH 2/7] KVM: MMU: cleanup for error mask set while walk guest page table Xiao Guangrong
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Xiao Guangrong @ 2010-09-27 10:02 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Marcelo Tosatti, LKML, KVM

The value of 'vcpu->arch.mmu.pae_root' is not modified, so we can update 'root_hpa'
out of the loop

Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
 arch/x86/kvm/mmu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index c94c432..3630046 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2393,8 +2393,8 @@ static int mmu_alloc_direct_roots(struct kvm_vcpu *vcpu)
 			++sp->root_count;
 			spin_unlock(&vcpu->kvm->mmu_lock);
 			vcpu->arch.mmu.pae_root[i] = root | PT_PRESENT_MASK;
-			vcpu->arch.mmu.root_hpa = __pa(vcpu->arch.mmu.pae_root);
 		}
+		vcpu->arch.mmu.root_hpa = __pa(vcpu->arch.mmu.pae_root);
 	} else
 		BUG();
 
@@ -2466,8 +2466,8 @@ static int mmu_alloc_shadow_roots(struct kvm_vcpu *vcpu)
 		spin_unlock(&vcpu->kvm->mmu_lock);
 
 		vcpu->arch.mmu.pae_root[i] = root | pm_mask;
-		vcpu->arch.mmu.root_hpa = __pa(vcpu->arch.mmu.pae_root);
 	}
+	vcpu->arch.mmu.root_hpa = __pa(vcpu->arch.mmu.pae_root);
 
 	/*
 	 * If we shadow a 32 bit page table with a long mode page
-- 
1.7.0.4

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

end of thread, other threads:[~2010-09-28  9:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-27 10:02 [PATCH 1/7] KVM: MMU: update 'root_hpa' out of loop in PAE shadow path Xiao Guangrong
2010-09-27 10:03 ` [PATCH 2/7] KVM: MMU: cleanup for error mask set while walk guest page table Xiao Guangrong
2010-09-27 14:30   ` Avi Kivity
2010-09-28  8:58     ` Xiao Guangrong
2010-09-28  9:00       ` Avi Kivity
2010-09-27 10:05 ` [PATCH 3/7] KVM: MMU: set access bit for direct mapping Xiao Guangrong
2010-09-27 10:07 ` [PATCH 5/7] KVM: MMU: audit: unregister audit tracepoints before module unloaded Xiao Guangrong
2010-09-27 10:07 ` [PATCH 6/7] KVM: MMU: audit: introduce audit_printk to cleanup audit code Xiao Guangrong
2010-09-27 10:09 ` [PATCH 7/7] KVM: MMU: audit: check whether have unsync sps after root sync Xiao Guangrong
2010-09-27 10:14 ` [PATCH 1/7] KVM: MMU: update 'root_hpa' out of loop in PAE shadow path Xiao Guangrong
2010-09-27 10:16   ` Avi Kivity
2010-09-27 14:39   ` Avi Kivity
2010-09-28  2:43     ` Xiao Guangrong
2010-09-28  9:03       ` Avi Kivity

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