Re: [RFC PATCH 2/3] KVM: x86: use memory_prepare in fetch helper function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Il 06/05/2014 02:40, Bandan Das ha scritto:
+		ret = ctxt->ops->memory_prepare(ctxt, addr, toread,
+						exception, false,
+						NULL, &uaddr);
+		if (ret != X86EMUL_CONTINUE)
+			return ret;
+
+		if (unlikely(kvm_is_error_hva(uaddr))) {
+			r = X86EMUL_PROPAGATE_FAULT;
+			return r;
+		}

What you are doing here is basically optimizing kvm_read_guest_virt_helper because you know that all reads will be single-page and you do not need the "next_segment" in kvm_read_guest. Good catch, but you can use kvm_read_guest_page instead of going through ctxt->ops->memory_prepare. :)

Paolo

+		ret = __copy_from_user(data, (void __user *)uaddr, toread);

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux