KVM: MMU: use kvm_release_pfn_clean to release pfn
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Thu, 26 Jul 2012 03:57:43 +0000 (11:57 +0800)
committerAvi Kivity <avi@redhat.com>
Thu, 26 Jul 2012 08:55:30 +0000 (11:55 +0300)
The current code depends on the fact that fault_page is the normal page,
however, we will use the error code instead of these dummy pages in the
later patch, so we use kvm_release_pfn_clean to release pfn which will
release the error code properly

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/mmu.c

index 241993443599f4f83dc91df46e0442974b0fd10c..a9a20528e7001f085e1a141da6efaeef1a9fa854 100644 (file)
@@ -3275,7 +3275,7 @@ static bool try_async_pf(struct kvm_vcpu *vcpu, bool prefault, gfn_t gfn,
        if (!async)
                return false; /* *pfn has correct page already */
 
-       put_page(pfn_to_page(*pfn));
+       kvm_release_pfn_clean(*pfn);
 
        if (!prefault && can_do_async_pf(vcpu)) {
                trace_kvm_try_async_get_page(gva, gfn);