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 linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to