KVM: Avoid guest virtual addresses in string pio userspace interface
[deliverable/linux.git] / drivers / kvm / mmu.c
index 2d905770fd88a3bc23e75968a6084640ee310f2c..4843e95e54e14ddcb2d4cd0b5c92fb9aa357866d 100644 (file)
@@ -735,6 +735,15 @@ hpa_t gva_to_hpa(struct kvm_vcpu *vcpu, gva_t gva)
        return gpa_to_hpa(vcpu, gpa);
 }
 
+struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva)
+{
+       gpa_t gpa = vcpu->mmu.gva_to_gpa(vcpu, gva);
+
+       if (gpa == UNMAPPED_GVA)
+               return NULL;
+       return pfn_to_page(gpa_to_hpa(vcpu, gpa) >> PAGE_SHIFT);
+}
+
 static void nonpaging_new_cr3(struct kvm_vcpu *vcpu)
 {
 }
This page took 0.024899 seconds and 5 git commands to generate.