[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 07/10] xen/arm: gate make_gicv3_domU_node with CONFIG_GICV3



Hi Penny,

On 16/11/2021 06:31, Penny Zheng wrote:
This commit gates function make_gicv3_domU_node with CONFIG_GICV3, and
also adds ASSERT_UNREACHABLE to catch any misuse.

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

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index c419a4b2cc..24f3edf069 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2279,6 +2279,7 @@ static int __init make_gicv2_domU_node(struct kernel_info 
*kinfo)
      return res;
  }
+#ifdef CONFIG_GICV3
  static int __init make_gicv3_domU_node(struct kernel_info *kinfo)
  {
      void *fdt = kinfo->fdt;
@@ -2328,6 +2329,12 @@ static int __init make_gicv3_domU_node(struct 
kernel_info *kinfo)
return res;
  }
+#else
+static int __init make_gicv3_domU_node(struct kernel_info *kinfo)
+{
+    ASSERT_UNREACHABLE();

This will break compilation on at least prod build with CONFIG_GICV3=n. However...

+}
+#endif

... I would prefer to #ifdef the case (as you did in the previous version). That said, if you strongly prefer this approach then I am OK with it.

static int __init make_gic_domU_node(struct kernel_info *kinfo)
  {


Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.