xen/arm: domain_build: Rework initrd_load to use the generic copy helper
authorJulien Grall <julien.grall@linaro.org>
Tue, 12 Dec 2017 19:02:05 +0000 (19:02 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 12 Dec 2017 20:11:36 +0000 (12:11 -0800)
commitbb7e6d565d928a6be92a62edb7b6a6b9ed56dfbc
tree5092704803e2266f55d27240d74b891b49214b5a
parentd8972aa9645f7c64f86a0c8a83f99643ee09b53f
xen/arm: domain_build: Rework initrd_load to use the generic copy helper

The function initrd_load is dealing with IPA but uses gvirt_to_maddr to
do the translation. This is currently working fine because the stage-1 MMU
is disabled.

Furthermore, the function is implementing its own copy to guest resulting
in code duplication and making more difficult to update the logic in
page-tables (such support for Populate On Demand).

The new copy_to_guest_phys_flush_dcache could be used here by temporarily
mapping the full initrd in the virtual space.

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