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

[PATCH v2 2/2] xen: remove init_constructors out of start_xen



From: Boyoun Park <boyoun.park@xxxxxxxxxxx>
Date: Wed, 3 Aug 2022 10:31:55 +0900
Subject: [PATCH v2 2/2] xen: remove init_constructors out of start_xen

This patch removed init_constructors from start_xen
by using __late_initcall.
It can be applied to other init functions in start_xen
so that only main init functions are included in there.

To use __late_initcall, the format of a function should
be changed according to initcall. Thus, the return type
of init_constructors function is changed in this patch.

Change-Id: Ife13484d346cff15983aacbfefde21d508f4690a
Signed-off-by: Boyoun Park <boyoun.park@xxxxxxxxxxx>
---
 xen/arch/arm/setup.c  | 2 --
 xen/arch/x86/setup.c  | 2 --
 xen/include/xen/lib.h | 2 +-
 xen/lib/ctors.c       | 6 +++++-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 332a207..6c88b31 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -1056,8 +1056,6 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     init_trace_bufs();
 
-    init_constructors();
-
     console_endboot();
 
     /* Hide UART from DOM0 if we're using it */
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 5dc6654..603100c 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1941,8 +1941,6 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     init_trace_bufs();
 
-    init_constructors();
-
     console_endboot();
 
     /* Hide UART from DOM0 if we're using it */
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 05ee1e1..8e08c29 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -211,7 +211,7 @@ extern void add_taint(unsigned int taint);
 struct cpu_user_regs;
 void cf_check dump_execstate(struct cpu_user_regs *);
 
-void init_constructors(void);
+int init_constructors(void);
 
 /*
  * bsearch - binary search an array of elements
diff --git a/xen/lib/ctors.c b/xen/lib/ctors.c
index 5bdc591..b54144b 100644
--- a/xen/lib/ctors.c
+++ b/xen/lib/ctors.c
@@ -4,7 +4,7 @@
 typedef void (*ctor_func_t)(void);
 extern const ctor_func_t __ctors_start[], __ctors_end[];
 
-void __init init_constructors(void)
+int __init init_constructors(void)
 {
     const ctor_func_t *f;
     for ( f = __ctors_start; f < __ctors_end; ++f )
@@ -12,8 +12,12 @@ void __init init_constructors(void)
 
     /* Putting this here seems as good (or bad) as any other place. */
     BUILD_BUG_ON(sizeof(size_t) != sizeof(ssize_t));
+
+    return 0;
 }
 
+__late_initcall(init_constructors);
+
 /*
  * Local variables:
  * mode: C
-- 
2.7.4

Attachment: v2-0002-xen-remove-init_constructors-out-of-start_xen.patch
Description: Binary data


 


Rackspace

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