From patchwork Wed Aug 3 02:40:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Boyoun Park X-Patchwork-Id: 12935134 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B90ECC00140 for ; Wed, 3 Aug 2022 02:41:23 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.379505.612989 (Exim 4.92) (envelope-from ) id 1oJ4Jq-0000sV-Av; Wed, 03 Aug 2022 02:41:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 379505.612989; Wed, 03 Aug 2022 02:41:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oJ4Jq-0000sO-88; Wed, 03 Aug 2022 02:41:10 +0000 Received: by outflank-mailman (input) for mailman id 379505; Wed, 03 Aug 2022 02:41:08 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oJ4Jo-0000sB-4C for xen-devel@lists.xenproject.org; Wed, 03 Aug 2022 02:41:08 +0000 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b60dbab2-12d5-11ed-924f-1f966e50362f; Wed, 03 Aug 2022 04:41:04 +0200 (CEST) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20220803024100epoutp0365f3f40a2adf17f0bee0caf06ae9f059~HtWtK_3sH1449614496epoutp03N for ; Wed, 3 Aug 2022 02:41:00 +0000 (GMT) Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20220803024059epcas2p23b711231673480d9d164f17c98094ba1~HtWslRurq2641226412epcas2p2l; Wed, 3 Aug 2022 02:40:59 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.88]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4LyGLy47Brz4x9Pw; Wed, 3 Aug 2022 02:40:58 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 14.3F.09662.A30E9E26; Wed, 3 Aug 2022 11:40:58 +0900 (KST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list X-Inumbo-ID: b60dbab2-12d5-11ed-924f-1f966e50362f DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20220803024100epoutp0365f3f40a2adf17f0bee0caf06ae9f059~HtWtK_3sH1449614496epoutp03N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1659494460; bh=vCZJVKX58LWE4JO96MPUCDYJhKq/SaJiyKAKpj+bR7Q=; h=Date:Subject:Reply-To:From:To:CC:In-Reply-To:References:From; b=vfTcKvd4E0uxYMKzurZna1wGatEz/4hSfd2MiJg53QsDefBqdAz9mNcBra69RCwGw La1/Ijm+TkNOLRB3gwVKpt4nq65HU8x0D/GWht/r8URqFb35h4Bz+tDaOa1TwcFDMF 7RaeAxSIL+zHvj8FAUXJLYyIBrhek5KI/vxEHeDg= X-AuditID: b6c32a48-9f7ff700000025be-e7-62e9e03a92e9 Date: Wed, 03 Aug 2022 11:40:57 +0900 Message-ID: <1470588578.9967963.1659494457934@mail-kr2-1> Mime-Version: 1.0 Subject: [PATCH v2 1/2] xen: add late init call in start_xen Reply-To: boyoun.park@samsung.com Sender: Boyoun Park From: Boyoun Park To: Stefano Stabellini CC: "xen-devel@lists.xenproject.org" , Jan Beulich , "julien@xen.org" , "bertrand.marquis@arm.com" , "Volodymyr_Babchuk@epam.com" , "andrew.cooper3@citrix.com" , "george.dunlap@citrix.com" , "wl@xen.org" , "roger.pau@citrix.com" , Chungwoo Park , Gang Li , Lei Wang , SoungKwan Kimn , DongJin PARK , Joonjae Lee X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N X-CMS-MailID: 20220803024057epcms2p8023b3e48176f0dcbb3f2ecdb08c0c92c X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDJsWRmVeSWpSXmKPExsWy7bCmua7Vg5dJBisWyFgsfryL3WLpks1M FqdmdTJZLDt8j93iwse9LBbzOw4xWfzc85DNorPrC6vF59mT2SzadlxmtZhxfjGrRePCeIvV 6+It/i2NsPi4Rtzi+5bJTA4CHmvmrWH0eD15AqPHnaU7GT02repk8zj84QqLR9+WVYwe67dc ZfE4fWsWWwBHVLZNRmpiSmqRQmpecn5KZl66rZJ3cLxzvKmZgaGuoaWFuZJCXmJuqq2Si0+A rltmDtD9SgpliTmlQKGAxOJiJX07m6L80pJUhYz84hJbpdSClJwC8wK94sTc4tK8dL281BIr QwMDI1OgwoTsjJ8rVzEXrKur2LzrAlMD456qLkYODgkBE4npB2W6GLk4hAR2MEqsnPmRsYuR k4NFQFVi0p8b7CA2r4ClxK7GZkaQel4BQYm/O4RBwsICNhKXV+wDKxESUJRoPbOQHSKuK9HT tZcNxGYT0JZ4cfMWC4gtIqAvsel2I1gNs8AyVomVL3lBbAkBXokZ7U9ZIGxpie3Lt4KdwCkQ IPHs+yRGiLiGxI9lvcwQtqjEzdVv2WHs98fmQ9WISLTeOwtVIyjx4OduqLiUROOnQ1D1xRJz +tazg/wrIdDAKHHz4kUmiIS+xJSWOawQtovEvinLGCEODZO4fvM+OySslCWOQPzCLMAn0XH4 LzvM/TvmPYEaoyrxq+kFI8wve862Q9keEodfPGGBhHMjs8SeP4vZJjAqzEIE6Swk2yBsbYll C18zg5QwC2hKrN+lDxFWk5jS/4UNwo6VaO04BVWuKDGl+yH7Akb2VYxiqQXFuempxUYFJvDE kJyfu4kRnPS1PHYwzn77Qe8QIxMH4yFGFaDeRxtWX2CUYsnLz0tVEuG94/I8SYg3JbGyKrUo P76oNCe1+BCjKTBNTGSWEk3OB+ajvJJ4QxNLAxMzM0NzI1MDcyVxXq+UDYlCAumJJanZqakF qUUwfUwcnFINTMfXiNh1zWBSfb/EXNHGStR//S2n+hKnntrSxoh3r94IzvbUSoz0VdjNl71V U81wilDfRbmbH3ofvfQ7Mr+Vq/NAZLPptu4FeydfvKt3YtL52HsqX0secZzaP9mJ7foU3SKf JVUtVSdvG5y4n9z+z+7x65O9XixH4hUd/58ICXY806GUdv4fczPr92MnlonOnm8cz7zNYcmM YI935gYtXn/PRinLZbz5xqy7tuzitECh+jxtD1fbqr+v1F53es3Z4x608lFi1nsRnw8tD1Y/ jwrpd2lbtn+z1d3ZMabf7xWu0vhgO7/8l1Zzn0PXfLnfDWELQ+S2H922rHSVxmFjWR435eRr y2/kHe9/suZBlhJLcUaioRZzUXEiAICJgOOPBAAA DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220728092237epcms2p53821bba31388763f45b5204d56520c20 References: <97499212.9948800.1659000157467@mail-kr2-3> <88025800-66e2-4fb4-facf-5989e75ba08f@suse.com> <20220729110313epcms2p5f9b24d5a65b98c220a6e99675298560f@epcms2p5> Thank you for your reply. I will seriously consider contributing platform specific drivers. Currently, I make a sample usage by applying this to a function in start_xen. I think functions in start_xen could be reduced for readability and understandability. These patches are just one of my suggestion. So feel free to reject it. On Sat, 30 Jul 2022, Stefano Stabellini wrote: > On Fri, 29 Jul 2022, Boyoun Park wrote: >> I really appreciate all the comments and reviews. >> I understand that it is hard to add this patch without any usage. >>  >> On Fri, 29 Jul 2022, Stefano Stabellini: >>> On Thu, 28 Jul 2022, Jan Beulich wrote: >>>> On 28.07.2022 11:22, Boyoun Park wrote: >>>>> Subject: [PATCH v1] xen: add late init call in start_xen >>>>>  >>>>> This patch added late_initcall section in init.data. >>>>>  >>>>> The late initcall would be called after initcall >>>>>  >>>>> in the start_xen function. >>>>>  >>>>> Some initializing works on priority should be run >>>>>  >>>>> in do_initcalls and other non-prioritized works >>>>>  >>>>> would be run in do_late_initcalls. >>>>>  >>>>> To call some functions by late_initcall, >>>>>  >>>>> then it is possible by using >>>>>  >>>>> __late_initcall(/*Function Name*/); >>>>>  >>>>> Signed-off-by: Boyoun Park  >>>>  >>>> So I could imagine this patch to be in a series where a subsequent >>>> patch then adds an actual use of the new functionality. Without >>>> that what you're proposing is to add dead code. >>>  >>> Yeah, I think it would be cool to have late initcalls but it makes sense >>> to add them if we have someone that makes use of them. >>  >> I totally agree with your comments. Some drivers that I'm developing now and use this function are specific to my hardware environment. >> Thus, it seems difficult to arrange them in the near future. >> I will update patches if I can suggest an actual use. > > I totally understand custom setups and non-upstreamable configurations > and I have certainly some of them myself. > > However, I just wanted to let you know that we are fine with accepting > platform specific drivers in Xen where it makes sense, for instance: > > - Renesas IPMMU-VMSA found in R-Car Gen3/Gen4 SoCs (an IOMMU driver) > xen/drivers/passthrough/arm/ipmmu-vmsa.c > > - Xilinx EEMI firmware interface "mediator" in Xen (power management) > xen/arch/arm/platforms/xilinx-zynqmp-eemi.c From: Boyoun Park Date: Tue, 15 Mar 2022 12:57:59 +0900 Subject: [PATCH v2 1/2] xen: add late init call in start_xen This patch added late_initcall section in init.data. The late initcall would be called after initcall in the start_xen function. Some initializing works on priority should be run in do_initcalls and other non-prioritized works would be run in do_late_initcalls. To call some functions by late_initcall, then it is possible by using __late_initcall(/*Function Name*/); Signed-off-by: Boyoun Park --- xen/arch/arm/setup.c | 2 ++ xen/arch/arm/xen.lds.S | 2 ++ xen/arch/x86/setup.c | 2 ++ xen/arch/x86/xen.lds.S | 2 ++ xen/common/kernel.c | 9 ++++++++- xen/include/xen/init.h | 3 +++ 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 85ff956..332a207 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -1063,6 +1063,8 @@ void __init start_xen(unsigned long boot_phys_offset, /* Hide UART from DOM0 if we're using it */ serial_endboot(); + do_late_initcalls(); + if ( (rc = xsm_set_system_active()) != 0 ) panic("xsm: unable to switch to SYSTEM_ACTIVE privilege: %d\n", rc); diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index 1e986e2..215e2c3 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -163,6 +163,8 @@ SECTIONS __presmp_initcall_end = .; *(.initcall1.init) __initcall_end = .; + *(.initcalllate.init) + __late_initcall_end = .; . = ALIGN(4); __alt_instructions = .; diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index f08b07b..5dc6654 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1952,6 +1952,8 @@ void __init noreturn __start_xen(unsigned long mbi_p) setup_io_bitmap(dom0); + do_late_initcalls(); + if ( bsp_delay_spec_ctrl ) { info->spec_ctrl_flags &= ~SCF_use_shadow; diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 8930e14..c90c7b0 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -250,6 +250,8 @@ SECTIONS __presmp_initcall_end = .; *(.initcall1.init) __initcall_end = .; + *(.initcalllate.init) + __late_initcall_end = .; *(.init.data) *(.init.data.rel) diff --git a/xen/common/kernel.c b/xen/common/kernel.c index f8134d3..5a3d037 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -369,7 +369,7 @@ void add_taint(unsigned int flag) } extern const initcall_t __initcall_start[], __presmp_initcall_end[], - __initcall_end[]; + __initcall_end[], __late_initcall_end[]; void __init do_presmp_initcalls(void) { @@ -385,6 +385,13 @@ void __init do_initcalls(void) (*call)(); } +void __init do_late_initcalls(void) +{ + const initcall_t *call; + for ( call = __initcall_end; call < __late_initcall_end; call++ ) + (*call)(); +} + #ifdef CONFIG_HYPFS static unsigned int __read_mostly major_version; static unsigned int __read_mostly minor_version; diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h index 0af0e23..48210ee 100644 --- a/xen/include/xen/init.h +++ b/xen/include/xen/init.h @@ -68,11 +68,14 @@ typedef void (*exitcall_t)(void); const static initcall_t __initcall_##fn __init_call("presmp") = fn #define __initcall(fn) \ const static initcall_t __initcall_##fn __init_call("1") = fn +#define __late_initcall(fn) \ + const static initcall_t __initcall_##fn __init_call("late") = fn #define __exitcall(fn) \ static exitcall_t __exitcall_##fn __exit_call = fn void do_presmp_initcalls(void); void do_initcalls(void); +void do_late_initcalls(void); #endif /* __ASSEMBLY__ */ From patchwork Wed Aug 3 02:44:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boyoun Park X-Patchwork-Id: 12935135 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14E06C00140 for ; Wed, 3 Aug 2022 02:44:31 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.379512.613000 (Exim 4.92) (envelope-from ) id 1oJ4Mp-0001TP-Pw; Wed, 03 Aug 2022 02:44:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 379512.613000; Wed, 03 Aug 2022 02:44:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oJ4Mp-0001TI-N8; Wed, 03 Aug 2022 02:44:15 +0000 Received: by outflank-mailman (input) for mailman id 379512; Wed, 03 Aug 2022 02:44:14 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oJ4Mo-0001TC-8Y for xen-devel@lists.xenproject.org; Wed, 03 Aug 2022 02:44:14 +0000 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 271a6174-12d6-11ed-bd2d-47488cf2e6aa; Wed, 03 Aug 2022 04:44:12 +0200 (CEST) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20220803024409epoutp0162dc1b2e5e54efe5e11ddc4642c05194~HtZdzF9zr0796607966epoutp01R for ; Wed, 3 Aug 2022 02:44:09 +0000 (GMT) Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20220803024409epcas2p26103aa155034409ab6a66920bfb00c03~HtZdM5PLa3089130891epcas2p26; Wed, 3 Aug 2022 02:44:09 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.70]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4LyGQc2hZnz4x9Q0; Wed, 3 Aug 2022 02:44:08 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id F5.63.09650.8F0E9E26; Wed, 3 Aug 2022 11:44:08 +0900 (KST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list X-Inumbo-ID: 271a6174-12d6-11ed-bd2d-47488cf2e6aa DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20220803024409epoutp0162dc1b2e5e54efe5e11ddc4642c05194~HtZdzF9zr0796607966epoutp01R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1659494649; bh=vSLU8kXF3mDoua1yVqGRtcIV/QdQxoaJke5YWxbr2Pk=; h=Date:Subject:Reply-To:From:To:CC:In-Reply-To:References:From; b=E5AKdE7ZjBqqLg69GJv8pB/pYJyR5KW2jwWtoTkblp4A57yj5Vi2EZNY41ZGIuy1g 6VNoNfklkYUqCr0bYMSiKapzoubAuEKjHX/ry47+axdGUwB4ypx4knyYkhQs4m+jeE +Ubfe87XZIWgcFWUUQNubDRmUOeKC4yPnmyNsVjU= X-AuditID: b6c32a46-0b9ff700000025b2-6d-62e9e0f8dbc7 Date: Wed, 03 Aug 2022 11:44:07 +0900 Message-ID: <1238367271.9969045.1659494647714@mail-kr2-1> Mime-Version: 1.0 Subject: [PATCH v2 2/2] xen: remove init_constructors out of start_xen Reply-To: boyoun.park@samsung.com Sender: Boyoun Park From: Boyoun Park To: Stefano Stabellini CC: "xen-devel@lists.xenproject.org" , Jan Beulich , "julien@xen.org" , "bertrand.marquis@arm.com" , "Volodymyr_Babchuk@epam.com" , "andrew.cooper3@citrix.com" , "george.dunlap@citrix.com" , "wl@xen.org" , "roger.pau@citrix.com" , Chungwoo Park , Gang Li , Lei Wang , SoungKwan Kimn , DongJin PARK , Joonjae Lee X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <1470588578.9967963.1659494457934@mail-kr2-1> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N X-CMS-MailID: 20220803024407epcms2p208a983abf94dd9d5732d85b715c6b95a X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDJsWRmVeSWpSXmKPExsWy7bCmue6PBy+TDB4vELBY/HgXu8XSJZuZ LE7N6mSyWHb4HrvFhY97WSzmdxxisvi55yGbRWfXF1aLz7Mns1m07bjMajHj/GJWi8aF8Rar 18Vb/FsaYfFxjbjF9y2TmRwEPNbMW8Po8XryBEaPO0t3MnpsWtXJ5nH4wxUWj74tqxg91m+5 yuJx+tYstgCOqGybjNTElNQihdS85PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFslF58A XbfMHKD7lRTKEnNKgUIBicXFSvp2NkX5pSWpChn5xSW2SqkFKTkF5gV6xYm5xaV56Xp5qSVW hgYGRqZAhQnZGWvudDEWrDevmLlmBUsD40ajLkZODgkBE4mJi7czdTFycQgJ7GCU+Pp+GhtI gkVAVeL/zb0sIDavgKXElZPX2bsYOYBsQYm/O4RBwsICbhLfJ39mArGFBBQlWs8sZIeI60r0 dO0FG8MmoC3x4uYtsDEiAvoSm243gtUwCyxjlVj5khfiBl6JGe1PWSBsaYnty7cygticAlYS 6z80QMU1JH4s62WGsEUlbq5+yw5jvz82nxHCFpFovXcWqkZQ4sHP3VBxKYnGT4eg6osl5vSt Zwf5V0KggVHi5sWLTBAJfYkpLXNYIWwXia8bPzBCHBou8frUcWaQ3yUElCWOQPzCLMAn0XH4 LzvM/TvmPYEaoyrxq+kFI8wve862Q9keEodfPGGBhPNGZom1t6axT2BUmIUI0llItkHY8hLb 385hBilhFtCUWL9LHyKsJjGl/wsbRDhd4vc6Z4iwosSU7ofsCxjZVzGKpRYU56anFhsVGMET Q3J+7iZGcNLXctvBOOXtB71DjEwcjIcYVYB6H21YfYFRiiUvPy9VSYT3jsvzJCHelMTKqtSi /Pii0pzU4kOMpsAkMZFZSjQ5H5iP8kriDU0sDUzMzAzNjUwNzJXEeb1SNiQKCaQnlqRmp6YW pBbB9DFxcEo1MB0LDn3mPmHvjaQlO9n15fcLmJ+IkeTQLPngyPNvpUj78yWLVqXJru59arlY zW0Pr2Py65d9H7xbp+6wnDU77e7M6X/elHVPTnp6c9a+mLaZc7ocE63kbgdWW8jcyf0n/zTC etG/8M5V6xc/3/60bG3N97ssT7fnrzjFKlrSXs96w10oMK/sX/7Nn3lqinfX/b7K1rOtXlxu Q/l18UYni+Yr1vHhcQXTfCzNXNTLD0Z4O0pUmEw74pRiH+bWae9jwDHp4+1wrviT32bKt79u 3LLpqQLDITklpdXTzx+Y172sJfLcTfFpijvryh18V4Rql+oUB/m389xOPPpW6N7l+addo67N cn9Z6HpE8NrTdCWW4oxEQy3mouJEAE1sPC2PBAAA DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220728092237epcms2p53821bba31388763f45b5204d56520c20 References: <1470588578.9967963.1659494457934@mail-kr2-1> <97499212.9948800.1659000157467@mail-kr2-3> <88025800-66e2-4fb4-facf-5989e75ba08f@suse.com> <20220729110313epcms2p5f9b24d5a65b98c220a6e99675298560f@epcms2p5> From: Boyoun Park 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 --- 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