[PATCH v3 05/10] xen/arm: add ASSERT_UNREACHABLE in allocate_static_memory

Penny Zheng posted 10 patches 4 years, 2 months ago
There is a newer version of this series
[PATCH v3 05/10] xen/arm: add ASSERT_UNREACHABLE in allocate_static_memory
Posted by Penny Zheng 4 years, 2 months ago
Helper allocate_static_memory is not meant to be reachable when built with
!CONFIG_STATIC_MEMORY, so this commit adds ASSERT_UNREACHABLE in it to catch
potential misuse.

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
---
v3 changes:
- new commit
---
 xen/arch/arm/domain_build.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 97a5b5dedd..b6fde74d74 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -759,6 +759,7 @@ static void __init allocate_static_memory(struct domain *d,
                                           struct kernel_info *kinfo,
                                           const struct dt_device_node *node)
 {
+    ASSERT_UNREACHABLE();
 }
 
 static void __init allocate_static_memory_11(struct domain *d,
-- 
2.25.1


Re: [PATCH v3 05/10] xen/arm: add ASSERT_UNREACHABLE in allocate_static_memory
Posted by Julien Grall 4 years, 2 months ago
Hi Penny,

On 16/11/2021 06:31, Penny Zheng wrote:
> Helper allocate_static_memory is not meant to be reachable when built with

^ The helper...

> !CONFIG_STATIC_MEMORY, so this commit adds ASSERT_UNREACHABLE in it to catch
> potential misuse.
> 
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall