dom0less: Reinitialise all variables on each loop iteration

Reduce the scope of dom0less_iommu, iommu and cpupool_node. iommu, in
particular, wasn't being cleared, so the wrong flags may make it to
domains that should not have them.

Fixes: 1d2b4f3049fd("xen/arm, doc: Add a DT property to specify...")
Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Alejandro Vallejo authored and Stefano Stabellini committed 2025-07-23 13:37:57 -07:00
1 parent 3743746459
commit cddc790705
1 file changed
+4 -4
+4 -4
View File
@@ -826,14 +826,14 @@ static int __init construct_domU(struct kernel_info *kinfo,
void __init create_domUs(void)
{
struct dt_device_node *node;
const char *dom0less_iommu;
bool iommu = false;
const struct dt_device_node *cpupool_node,
*chosen = dt_find_node_by_path("/chosen");
const struct dt_device_node *chosen = dt_find_node_by_path("/chosen");
BUG_ON(chosen == NULL);
dt_for_each_child_node(chosen, node)
{
const char *dom0less_iommu;
bool iommu = false;
const struct dt_device_node *cpupool_node;
struct kernel_info ki = KERNEL_INFO_INIT;
struct xen_domctl_createdomain *d_cfg = &ki.bd.create_cfg;
unsigned int *flags = &ki.bd.create_flags;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.