diff mbox series

xen/arm: Don't call process_shm_chosen() during ACPI boot

Message ID 20250402084233.114604-1-michal.orzel@amd.com (mailing list archive)
State New
Headers show
Series xen/arm: Don't call process_shm_chosen() during ACPI boot | expand

Commit Message

Michal Orzel April 2, 2025, 8:42 a.m. UTC
Static shared memory requires device-tree boot. At the moment, booting
with ACPI enabled and CONFIG_STATIC_SHM=y results in a data abort when
dereferencing node in process_shm() because dt_host is always NULL.

Fixes: 09c0a8976acf ("xen/arm: enable statically shared memory on Dom0")
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain_build.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Bertrand Marquis April 2, 2025, 8:58 a.m. UTC | #1
Hi Michal,

> On 2 Apr 2025, at 10:42, Michal Orzel <michal.orzel@amd.com> wrote:
> 
> Static shared memory requires device-tree boot. At the moment, booting
> with ACPI enabled and CONFIG_STATIC_SHM=y results in a data abort when
> dereferencing node in process_shm() because dt_host is always NULL.
> 
> Fixes: 09c0a8976acf ("xen/arm: enable statically shared memory on Dom0")
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/domain_build.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 2b5b4331834f..85f423214a44 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -2325,9 +2325,12 @@ int __init construct_hwdom(struct kernel_info *kinfo)
>     else
>         allocate_memory(d, kinfo);
> 
> -    rc = process_shm_chosen(d, kinfo);
> -    if ( rc < 0 )
> -        return rc;
> +    if ( acpi_disabled )
> +    {
> +        rc = process_shm_chosen(d, kinfo);
> +        if ( rc < 0 )
> +            return rc;
> +    }
> 
>     /* Map extra GIC MMIO, irqs and other hw stuffs to dom0. */
>     rc = gic_map_hwdom_extra_mappings(d);
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 2b5b4331834f..85f423214a44 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2325,9 +2325,12 @@  int __init construct_hwdom(struct kernel_info *kinfo)
     else
         allocate_memory(d, kinfo);
 
-    rc = process_shm_chosen(d, kinfo);
-    if ( rc < 0 )
-        return rc;
+    if ( acpi_disabled )
+    {
+        rc = process_shm_chosen(d, kinfo);
+        if ( rc < 0 )
+            return rc;
+    }
 
     /* Map extra GIC MMIO, irqs and other hw stuffs to dom0. */
     rc = gic_map_hwdom_extra_mappings(d);