Commit 2b4b5af8 authored by Xiao Guangrong's avatar Xiao Guangrong Committed by Avi Kivity

KVM: use kvm_release_page_clean to release the page

In kvm_async_pf_wakeup_all, it uses bad_page to generate broadcast wakeup,
and uses put_page to release bad_page, the work depends on the fact that
bad_page is the normal page. But we will use the error code instead of
bad_page, so use kvm_release_page_clean to release the page which will
release the error code properly
Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 3b2bd2f8
...@@ -112,7 +112,7 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu) ...@@ -112,7 +112,7 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu)
typeof(*work), link); typeof(*work), link);
list_del(&work->link); list_del(&work->link);
if (work->page) if (work->page)
put_page(work->page); kvm_release_page_clean(work->page);
kmem_cache_free(async_pf_cache, work); kmem_cache_free(async_pf_cache, work);
} }
spin_unlock(&vcpu->async_pf.lock); spin_unlock(&vcpu->async_pf.lock);
...@@ -139,7 +139,7 @@ void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu) ...@@ -139,7 +139,7 @@ void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu)
list_del(&work->queue); list_del(&work->queue);
vcpu->async_pf.queued--; vcpu->async_pf.queued--;
if (work->page) if (work->page)
put_page(work->page); kvm_release_page_clean(work->page);
kmem_cache_free(async_pf_cache, work); kmem_cache_free(async_pf_cache, work);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment