diff mbox series

[v3,6/7] xen/arm: dom0less use has_dtb local variable

Message ID 20250403214608.152954-7-jason.andryuk@amd.com (mailing list archive)
State Superseded
Headers show
Series ARM split hardware and control domains | expand

Commit Message

Jason Andryuk April 3, 2025, 9:46 p.m. UTC
Store the result of finding a "multiboot,device-tree" node.  This will
simplity adding hardware domain checks.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
---
v3:
New

Could be squashed into the next patch, but this helps make the next one
cleaner.
---
 xen/arch/arm/dom0less-build.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Stefano Stabellini April 4, 2025, 1:12 a.m. UTC | #1
On Thu, 3 Apr 2025, Jason Andryuk wrote:
> Store the result of finding a "multiboot,device-tree" node.  This will
> simplity adding hardware domain checks.
> 
> Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
> v3:
> New
> 
> Could be squashed into the next patch, but this helps make the next one
> cleaner.
> ---
>  xen/arch/arm/dom0less-build.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
> index 284190d54f..a72961dfb4 100644
> --- a/xen/arch/arm/dom0less-build.c
> +++ b/xen/arch/arm/dom0less-build.c
> @@ -1031,6 +1031,7 @@ void __init create_domUs(void)
>              .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
>          };
>          unsigned int flags = 0U;
> +        bool has_dtb = false;
>          uint32_t val;
>          int rc;
>  
> @@ -1065,9 +1066,10 @@ void __init create_domUs(void)
>               !strcmp(dom0less_iommu, "enabled") )
>              iommu = true;
>  
> -        if ( iommu_enabled &&
> -             (iommu || dt_find_compatible_node(node, NULL,
> -                                               "multiboot,device-tree")) )
> +        if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") )
> +            has_dtb = true;
> +
> +        if ( iommu_enabled && (iommu || has_dtb) )
>              d_cfg.flags |= XEN_DOMCTL_CDF_iommu;
>  
>          if ( !dt_property_read_u32(node, "nr_spis", &d_cfg.arch.nr_spis) )
> -- 
> 2.49.0
>
diff mbox series

Patch

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 284190d54f..a72961dfb4 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -1031,6 +1031,7 @@  void __init create_domUs(void)
             .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
         };
         unsigned int flags = 0U;
+        bool has_dtb = false;
         uint32_t val;
         int rc;
 
@@ -1065,9 +1066,10 @@  void __init create_domUs(void)
              !strcmp(dom0less_iommu, "enabled") )
             iommu = true;
 
-        if ( iommu_enabled &&
-             (iommu || dt_find_compatible_node(node, NULL,
-                                               "multiboot,device-tree")) )
+        if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") )
+            has_dtb = true;
+
+        if ( iommu_enabled && (iommu || has_dtb) )
             d_cfg.flags |= XEN_DOMCTL_CDF_iommu;
 
         if ( !dt_property_read_u32(node, "nr_spis", &d_cfg.arch.nr_spis) )