xen/arm: Extend copy_to_guest to support copying from/to guest physical address
authorJulien Grall <julien.grall@linaro.org>
Tue, 12 Dec 2017 19:02:02 +0000 (19:02 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 12 Dec 2017 20:04:23 +0000 (12:04 -0800)
commit1661158723a66aafb07ac549c468b8c958ed5ddf
tree2d212b443b6964b0d2d7d3cf5c2d0be24b162084
parent2986481b3d9e6d382f0ed9ef3d0be365ccbc309e
xen/arm: Extend copy_to_guest to support copying from/to guest physical address

The only differences between copy_to_guest and access_guest_memory_by_ipa are:
    - The latter does not support copying data crossing page boundary
    - The former is copying from/to guest VA whilst the latter from
    guest PA

copy_to_guest can easily be extended to support copying from/to guest
physical address. For that a new bit is used to tell whether linear
address or ipa is been used.

Lastly access_guest_memory_by_ipa is reimplemented using copy_to_guest.
This also has the benefits to extend the use of it, it is now possible
to copy data crossing page boundary.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/guestcopy.c