mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/arm: dom0less hwdom construction
When creating a hardware domain, have the dom0less code call construct_hwdom() which is shared with the dom0 code. The hardware domain requires building that best matches the dom0 build path. Re-use it to keep them in sync. The device tree node of the dom0less config is now passed into construct_hwdom(). dom0 uses /chosen for process_shm while a hwdom will use the value from its dom0less device tree node. Signed-off-by: Jason Andryuk <jason.andryuk@amd.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
1 parent
b959f3b820
commit
52cb53f181
3 files changed
+39
-28
No files matched your search
@@ -929,36 +929,45 @@ static int __init construct_domU(struct domain *d,
|
||||
/* type must be set before allocate memory */
|
||||
d->arch.type = kinfo.type;
|
||||
#endif
|
||||
if ( !dt_find_property(node, "xen,static-mem", NULL) )
|
||||
allocate_memory(d, &kinfo);
|
||||
else if ( !is_domain_direct_mapped(d) )
|
||||
allocate_static_memory(d, &kinfo, node);
|
||||
else
|
||||
assign_static_memory_11(d, &kinfo, node);
|
||||
|
||||
rc = process_shm(d, &kinfo, node);
|
||||
if ( rc < 0 )
|
||||
return rc;
|
||||
|
||||
/*
|
||||
* Base address and irq number are needed when creating vpl011 device
|
||||
* tree node in prepare_dtb_domU, so initialization on related variables
|
||||
* shall be done first.
|
||||
*/
|
||||
if ( kinfo.vpl011 )
|
||||
if ( is_hardware_domain(d) )
|
||||
{
|
||||
rc = domain_vpl011_init(d, NULL);
|
||||
rc = construct_hwdom(&kinfo, node);
|
||||
if ( rc < 0 )
|
||||
return rc;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !dt_find_property(node, "xen,static-mem", NULL) )
|
||||
allocate_memory(d, &kinfo);
|
||||
else if ( !is_domain_direct_mapped(d) )
|
||||
allocate_static_memory(d, &kinfo, node);
|
||||
else
|
||||
assign_static_memory_11(d, &kinfo, node);
|
||||
|
||||
rc = prepare_dtb_domU(d, &kinfo);
|
||||
if ( rc < 0 )
|
||||
return rc;
|
||||
rc = process_shm(d, &kinfo, node);
|
||||
if ( rc < 0 )
|
||||
return rc;
|
||||
|
||||
rc = construct_domain(d, &kinfo);
|
||||
if ( rc < 0 )
|
||||
return rc;
|
||||
/*
|
||||
* Base address and irq number are needed when creating vpl011 device
|
||||
* tree node in prepare_dtb_domU, so initialization on related variables
|
||||
* shall be done first.
|
||||
*/
|
||||
if ( kinfo.vpl011 )
|
||||
{
|
||||
rc = domain_vpl011_init(d, NULL);
|
||||
if ( rc < 0 )
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = prepare_dtb_domU(d, &kinfo);
|
||||
if ( rc < 0 )
|
||||
return rc;
|
||||
|
||||
rc = construct_domain(d, &kinfo);
|
||||
if ( rc < 0 )
|
||||
return rc;
|
||||
}
|
||||
|
||||
domain_vcpu_affinity(d, node);
|
||||
|
||||
|
||||
@@ -2305,10 +2305,11 @@ static int __init construct_dom0(struct domain *d)
|
||||
if ( rc < 0 )
|
||||
return rc;
|
||||
|
||||
return construct_hwdom(&kinfo);
|
||||
return construct_hwdom(&kinfo, NULL);
|
||||
}
|
||||
|
||||
int __init construct_hwdom(struct kernel_info *kinfo)
|
||||
int __init construct_hwdom(struct kernel_info *kinfo,
|
||||
const struct dt_device_node *node)
|
||||
{
|
||||
struct domain *d = kinfo->d;
|
||||
int rc;
|
||||
@@ -2327,7 +2328,7 @@ int __init construct_hwdom(struct kernel_info *kinfo)
|
||||
|
||||
if ( acpi_disabled )
|
||||
{
|
||||
rc = process_shm(d, kinfo, NULL);
|
||||
rc = process_shm(d, kinfo, node);
|
||||
if ( rc < 0 )
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ bool allocate_bank_memory(struct kernel_info *kinfo, gfn_t sgfn,
|
||||
paddr_t tot_size);
|
||||
void allocate_memory(struct domain *d, struct kernel_info *kinfo);
|
||||
int construct_domain(struct domain *d, struct kernel_info *kinfo);
|
||||
int construct_hwdom(struct kernel_info *kinfo);
|
||||
int construct_hwdom(struct kernel_info *kinfo,
|
||||
const struct dt_device_node *node);
|
||||
int domain_fdt_begin_node(void *fdt, const char *name, uint64_t unit);
|
||||
int make_chosen_node(const struct kernel_info *kinfo);
|
||||
int make_cpus_node(const struct domain *d, void *fdt);
|
||||
|
||||