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

Re: [PATCH v2] xen/arm, xen/common: Add Kconfig option to control Dom0 boot


  • To: "dmkhn@xxxxxxxxx" <dmkhn@xxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Date: Mon, 4 Aug 2025 14:04:20 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9vu6MddREgGAtSNktMQMMOvj4GGfmyBeAArmHW3YLlE=; b=dqt9Z7LZcgoTG+FMv4FXJpc+GFPLiotl5AjEVfpz28jf/Pyhq1+uUc/Slu/xWIzRoqQI9Z6JybyknOmtTFHraFQft3ETOF4OqlOdbI1iQT0kXwne7vmtu1Cj9SI9b1Y4F+FjcA3h3l99qUKBBiwowRGGOYzzAAvTGxxjCTP2HWDdM/tb22xD8vsl0alK/KKn6QNaFrMkiYbF9iMgjlAx7v/qrCmGYneY5Rg9k/5WI/wY4I8iMmmCfWgcZAfLPU2+BGMoNDkwWZJbcLPX46c0+kzxuXyv16My6x35/qap4p0NoROP07ydH0WF9c2/YImEYsBGqE2NyITJ2Tnn1WFnRw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YIQG6JtOMuN8liyCgsZDg5tr7V/M+LQiDFdoSsBQr1KmrdXcsJ1H7lnjB9yprpMRpdyfthQiNgQNnZiF7mwjjLXLVhO7dreS1JD24wHiFDB6bYB5fQihXLBQD7Q3telfwHDyWx7GwY28u3CycrlytgkXS5UD5csNUb5p986fF9Mnrt9cNqMsVv4AdJLHXvyPWlDQ1XXc73QDN58cUl8X3US4lr3Lzml84pmgkMKo2lF6S5OcGh3NhY3lJ3+AycEoewIbqWnHFpBsOOh9FB8FGbtKdApl9iQ7HPoM04GNIktXzNG+EoEpGnjDlCMCcuqMg+3jfXh9UbOu2QwHJ8FCzw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>
  • Delivery-date: Mon, 04 Aug 2025 14:04:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb/+IacHiE2y5puk2LQertSkS3OrRIDWwAgAC2NwCAAOeoAIAI5joA
  • Thread-topic: [PATCH v2] xen/arm, xen/common: Add Kconfig option to control Dom0 boot


On 30/07/2025 01:10, dmkhn@xxxxxxxxx wrote:
> On Tue, Jul 29, 2025 at 10:20:54AM +0200, Jan Beulich wrote:
>> On 28.07.2025 23:28, dmkhn@xxxxxxxxx wrote:
>>> On Mon, Jul 28, 2025 at 05:07:30PM +0000, Oleksii Moisieiev wrote:
>>>> This commit introduces a new Kconfig option, `CONFIG_DOM0_BOOT`, to
>>>> allow for building Xen without support for booting a regular domain (Dom0).
>>>> This functionality is primarily intended for the ARM architecture.
>>>>
>>>> A new Kconfig symbol, `HAS_DOM0`, has been added and is selected by
>>>> default for ARM and X86 architecture. This symbol signifies that an
>>>> architecture has the capability to support a Dom0.
>>>>
>>>> The `DOM0_BOOT` option depends on `HAS_DOM0` and defaults to 'y'. For
>>>> expert users, this option can be disabled (`CONFIG_EXPERT=y` and no
>>>> `CONFIG_DOM0_BOOT` in the config), which will compile out the Dom0
>>>> creation code on ARM. This is useful for embedded or dom0less-only
>>>> scenarios to reduce binary size and complexity.
>>>>
>>>> The ARM boot path has been updated to panic if it detects a non-dom0less
>>>> configuration while `CONFIG_DOM0_BOOT` is disabled, preventing an invalid
>>>> boot.
>>>>
>>>> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@xxxxxxxx>
>>>>
>>>> ---
>>>>
>>>> ---
>>>>   xen/arch/arm/Kconfig        |  1 +
>>>>   xen/arch/arm/domain_build.c |  8 ++++++++
>>>>   xen/arch/arm/setup.c        | 14 ++++++++++----
>>>>   xen/arch/x86/Kconfig        |  1 +
>>>>   xen/common/Kconfig          | 11 +++++++++++
>>>>   5 files changed, 31 insertions(+), 4 deletions(-)
>>> I think there should be changes in
>>>    include/xen/domain.h
>>> and
>>>    arch/arm/include/asm/setup.h
>>> to compile out declarations of dom0_max_vcpus() and create_dom0() under new
>>> CONFIG_DOM0_BOOT.
>> Adding #ifdef-ary just to hide declarations is often merely adding clutter,
>> without providing a clear benefit. I didn't check in this case, but I think
>> when making such a request you want to clarify what the gains would be of
>> adding more #ifdef.
> re: clutter: fully agree.
>
> I was thinking about this following code where ifdef-ery may be needed:
>
> +    if ( IS_ENABLED(CONFIG_DOM0_BOOT) && !is_dom0less_mode() )
> +    {
> +        /* Create initial domain 0. */
>           create_dom0();
> +    }
>
> But looks like compiler is correctly throwing away create_dom0() call.
Yes, it is. It is preferable to use IS_ENABLED in if statements whenever 
possible.
>> Jan

 


Rackspace

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