Avi Kivity wrote:
On 05/23/2010 03:16 PM, Xiao Guangrong wrote:We only handle unsync pages here, and 'role.direct' or 'role.invalid'
Allow more page become asynchronous at getting sp time, if need createrole.direct, role.invalid?
new
shadow page for gfn but it not allow unsync(level> 1), we should
unsync all
gfn's unsync page
+/* @gfn should be write-protected at the call site */
+static void kvm_sync_pages(struct kvm_vcpu *vcpu, gfn_t gfn)
+{
+ struct hlist_head *bucket;
+ struct kvm_mmu_page *s;
+ struct hlist_node *node, *n;
+ unsigned index;
+ bool flush = false;
+
+ index = kvm_page_table_hashfn(gfn);
+ bucket =&vcpu->kvm->arch.mmu_page_hash[index];
+ hlist_for_each_entry_safe(s, node, n, bucket, hash_link) {
pages can't become unsync.
Well, role.direct cannot be unsync. But that's not something we want toWhile we mark the unsync page, we have filtered out the 'role.direct' pages,
rely on.
so, i think we not need worry 'role.direct' here. :-)