|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/5] xen/arm: copy dtb fragment to guest dtb
(+ Wei and Ian) Hi Stefano, On 12/5/18 5:28 PM, Stefano Stabellini wrote: Read the dtb fragment corresponding to a passthrough device from memory at the location referred to by the "multiboot,dtb" compatible node. Copy the fragment to the guest dtb. Add a dtb_bootmodule field to struct kernel_info to find the dtb fragment for a guest. The code below is basically a copy from libxl, right? If so, this should be specified in the commit message. Also, the license is different in libxl compare to the hypervisor (LGPLv2.1 vs GPLv2). So is there any issue to copy that code in the hypervisor? Signed-off-by: Stefano Stabellini <stefanos@xxxxxxxxxx> --- xen/arch/arm/domain_build.c | 77 ++++++++++++++++++++++++++++++++++++++++++++ xen/include/asm-arm/kernel.h | 2 +- 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index b0ec3f0..cc6b464 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -14,6 +14,7 @@ #include <xen/guest_access.h> #include <xen/iocap.h> #include <xen/acpi.h> +#include <xen/vmap.h> #include <xen/warning.h> #include <acpi/actables.h> #include <asm/device.h> @@ -1669,6 +1670,59 @@ static int __init make_vpl011_uart_node(const struct domain *d, void *fdt) } #endif+static int __init copy_properties(void *fdt, void *pfdt, int nodeoff)
Coding style:
for ( ... )
{
Same here.
This suggests the DTB fragment should be cacheable. Can this be written in the documentation? + if ( pfdt == NULL ) + return -EFAULT; + + if ( fdt_magic(pfdt) != FDT_MAGIC ) + return -EINVAL; + + nodeoff = fdt_path_offset(pfdt, "/passthrough"); + if (nodeoff < 0) + return nodeoff; + + res = copy_node(kinfo->fdt, pfdt, nodeoff, 0); + if ( res ) + return res; I would also copy /aliases as it may be used by the users to refer easily a node.
Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |