On 26.09.2025 12:53, Alejandro Vallejo wrote:
> On Wed Sep 24, 2025 at 6:06 PM CEST, Nicola Vetrini wrote:
>> On 2025-09-24 18:00, Oleksii Moisieiev wrote:
>>> --- a/xen/arch/arm/setup.c
>>> +++ b/xen/arch/arm/setup.c
>>> @@ -481,12 +481,18 @@ void asmlinkage __init noreturn 
>>> start_xen(unsigned long fdt_paddr)
>>>      enable_errata_workarounds();
>>>      enable_cpu_features();
>>>
>>> -    /* Create initial domain 0. */
>>> -    if ( !is_dom0less_mode() )
>>> +    if ( IS_ENABLED(CONFIG_DOM0_BOOT) && !is_dom0less_mode() )
> 
> This probably wants inlining in is_dom0less_mode() so every use gets to be
> resolved statically.
> 
>>> +    {
>>> +        /* Create initial domain 0. */
>>>          create_dom0();
>>> +    }
>>>      else
>>> -        printk(XENLOG_INFO "Xen dom0less mode detected\n");
>>> -
>>> +    {
>>> +        if ( is_dom0less_mode())
>>> +            printk(XENLOG_INFO "Xen dom0less mode detected\n");
>>> +        else
>>> +            panic("Neither dom0 nor dom0less mode was detected, 
> 
> I'd rather have a static check in common code.
> 
> BUILD_BUG_ON(!CONFIG_DOM0_BOOT && !CONFIG_DOM0LESS_BOOT);

I'd recommend against this, not the least because of the randconfig aspect
you mention later. We also allow building (x86) Xen with PV=n and HVM=n,
for example.

Jan

Reply via email to