All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boyoun Park <boyoun.park@samsung.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Jan Beulich <jbeulich@suse.com>,
	"julien@xen.org" <julien@xen.org>,
	"bertrand.marquis@arm.com" <bertrand.marquis@arm.com>,
	"Volodymyr_Babchuk@epam.com" <Volodymyr_Babchuk@epam.com>,
	"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"george.dunlap@citrix.com" <george.dunlap@citrix.com>,
	"wl@xen.org" <wl@xen.org>,
	"roger.pau@citrix.com" <roger.pau@citrix.com>,
	Chungwoo Park <cww.park@samsung.com>,
	Gang Li <gang30.li@samsung.com>,
	Lei Wang <lei19.wang@samsung.com>,
	SoungKwan Kimn <sk.kimn@samsung.com>,
	DongJin PARK <djpax.park@samsung.com>,
	Joonjae Lee <joonjae7.lee@samsung.com>
Subject: [PATCH v2 2/2] xen: remove init_constructors out of start_xen
Date: Wed, 03 Aug 2022 11:44:07 +0900	[thread overview]
Message-ID: <1238367271.9969045.1659494647714@mail-kr2-1> (raw)
In-Reply-To: <1470588578.9967963.1659494457934@mail-kr2-1>

[-- Attachment #1: Type: text/plain, Size: 2576 bytes --]

From: Boyoun Park <boyoun.park@samsung.com>
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@samsung.com>
---
 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 #2: v2-0002-xen-remove-init_constructors-out-of-start_xen.patch --]
[-- Type: application/octet-stream, Size: 2932 bytes --]

From 825a304d45c80b816b30fcbc81e1d3dab4f8c81a Mon Sep 17 00:00:00 2001
Message-Id: <825a304d45c80b816b30fcbc81e1d3dab4f8c81a.1659492818.git.boyoun.park@samsung.com>
In-Reply-To: <5fd58ac8679189a878609e45b4bce1e78dee4848.1659492818.git.boyoun.park@samsung.com>
References: <5fd58ac8679189a878609e45b4bce1e78dee4848.1659492818.git.boyoun.park@samsung.com>
From: Boyoun Park <boyoun.park@samsung.com>
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@samsung.com>
---
 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


  parent reply	other threads:[~2022-08-03  2:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220728092237epcms2p53821bba31388763f45b5204d56520c20@epcms2p5>
2022-07-28  9:22 ` [PATCH v1] xen: add late init call in start_xen Boyoun Park
2022-07-28 11:48   ` Jan Beulich
2022-07-28 19:55     ` Stefano Stabellini
2022-07-29 11:03 ` Boyoun Park
2022-07-29 21:51   ` Stefano Stabellini
     [not found]   ` <CGME20220728092237epcms2p53821bba31388763f45b5204d56520c20@epcms2p8>
2022-08-03  2:40     ` [PATCH v2 1/2] " Boyoun Park
2022-08-03  8:14       ` Julien Grall
     [not found]   ` <CGME20220728092237epcms2p53821bba31388763f45b5204d56520c20@epcms2p2>
2022-08-03  2:44     ` Boyoun Park [this message]
2022-08-03  7:10       ` [PATCH v2 2/2] xen: remove init_constructors out of start_xen Jan Beulich
2022-08-04 11:42 ` [PATCH v2 1/2] xen: add late init call in start_xen Boyoun Park

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1238367271.9969045.1659494647714@mail-kr2-1 \
    --to=boyoun.park@samsung.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=cww.park@samsung.com \
    --cc=djpax.park@samsung.com \
    --cc=gang30.li@samsung.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=joonjae7.lee@samsung.com \
    --cc=julien@xen.org \
    --cc=lei19.wang@samsung.com \
    --cc=roger.pau@citrix.com \
    --cc=sk.kimn@samsung.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.