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

Re: [PATCH 2/2] arm/efi: Use dom0less configuration when using EFI boot


  • To: Luca Fancellu <luca.fancellu@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 16 Sep 2021 14:15:30 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Wwftvcb7mTw2LJsR9vHNEmfugrmfZACJVuXclaSOzqo=; b=Vxs7l50EJdoU7LyBZ3F0iNWZwsyV4bMEKuj47uAvnC3/LberLbyRXYb78WFkrUqiwdUx9qlVAYbO7wxzJYCoydPF5dc4ud6DePkRh7zVAI7oGtnkkNtdgZ5KYbnQ6RhvxzgYDo/Jbx1bQyLdSudtmjPgjhx62DpPCc+Z2o0VMK6s4Ieyx83RjwQ7SxWs++2detmsBzZaNmEo0XJfF1yFJEZfa7IT75JGOA+60CkNrlLCsToLcarvW1uYPvQZQiyaofqKUtedVM7ctWB+lmz5ZLEPWNAWugQ49Mst+K84lTiRpAsM6Xo5EezonzpUILQNDycUC5/4CTRpDIiDdf28gA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XDVOzpsz4uLY2EZcPehdd6W+cPFD1oPWYB/Em4wEV48Gud0YNMD+QYQpLYTPxZWkJ+aWHIWYJeRoravoJz7HVTzJ8jQwzkpE5RE99CrSwb/PgjubAu9MbINlOAeyGzHMEqi4yuNglfLqUmfTNlvr8KLVlyTuJMNFEN/9DB0X1UO+xhnGFa46EUM+tVzOrjUfnzkh0+W6izFZ57VVBJR4G8x7nMYQ7CU2IvVB4DzP6ldvhtecpt1mKJtQ6aZE5FUpQJaN1IY+U//xpc2GOSL+z+6w1rYtq0C+Ud32flIr7IOKpOX2VL9JoS+o872TF3hupvx17i4rTmiiTUDaf5rzJg==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>, wei.chen@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 16 Sep 2021 12:15:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.09.2021 13:28, Luca Fancellu wrote:
>> On 16 Sep 2021, at 09:46, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>> On 15.09.2021 16:26, Luca Fancellu wrote:
>>> --- a/xen/arch/arm/efi/efi-boot.h
>>> +++ b/xen/arch/arm/efi/efi-boot.h
>>> @@ -8,9 +8,39 @@
>>> #include <asm/setup.h>
>>> #include <asm/smp.h>
>>>
>>> +typedef struct {
>>> +    char* name;
>>
>> Misplaced *.
> 
> I was looking in the CODING_STYLE and I didn’t found anything that mandates
> char *name; instead of char* name; but if you prefer I can change it since I 
> have
> to do some modification to the patch.

I don't think it's reasonable to spell out there every little detail.
You should also take adjacent code into consideration, making yours
match. Issues only arise when there's bad code that you happen to
look at.

>>> @@ -1285,14 +1286,21 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE 
>>> *SystemTable)
>>>             efi_bs->FreePool(name.w);
>>>         }
>>>
>>> -        if ( !name.s )
>>> -            blexit(L"No Dom0 kernel image specified.");
>>> -
>>>         efi_arch_cfg_file_early(loaded_image, dir_handle, section.s);
>>>
>>> -        option_str = split_string(name.s);
>>> +#ifdef CONFIG_ARM
>>> +        /* dom0less feature is supported only on ARM */
>>> +        dom0less_found = check_dom0less_efi_boot(dir_handle);
>>> +#endif
>>> +
>>> +        if ( !name.s && !dom0less_found )
>>
>> Here you (properly ) use !name.s,
> 
> This is not my code, I just added && !dom0less

Correct, which is why this is fine.

>>> +            blexit(L"No Dom0 kernel image specified.");
>>> +
>>> +        if ( name.s != NULL )
>>
>> Here you then mean to omit the "!= NULL" for consistency and brevity.
> 
> I usually check explicitely pointers with NULL, is it something to be avoided 
> in Xen?
> There are some industrial coding standards that says to avoid the use of ! 
> operator
> with pointers. Is it important here to do !name.s instead of the solution 
> above?

As you can see from neighboring code, we prefer the shorter forms,
for being easier/shorter to read.

>>> +            option_str = split_string(name.s);
>>>
>>> -        if ( !read_section(loaded_image, L"kernel", &kernel, option_str) )
>>> +        if ( (!read_section(loaded_image, L"kernel", &kernel, option_str)) 
>>> &&
>>
>> Stray parentheses.
> 
> Will fix
> 
>>
>>> +             (name.s != NULL) )
>>
>> See above.
> 
> Will fix
> 
>>
>> I also don't think this logic is quite right: If you're dom0less,
>> why would you want to look for an embedded Dom0 kernel image?
> 
> This is common code, that check is not from my patch.

It is you who is adding the name.s != NULL part, isn't it?

> Before this serie, EFI boot requires that a dom0 module was passed, otherwise
> the boot was stopped.
> 
> This serie instead removes this requirement, letting the boot continue if 
> there is no dom0
> kernel.
> 
> However (as in the old code) if the user embed the dom0 kernel in the image, 
> then it is
> legit to use it and if there are also other domUs specified by DT, then the 
> system will
> start the dom0 kernel and the domUs kernel as well.

This doesn't match what I would expect - if configuration tells
to boot dom0less, why would an embedded Dom0 kernel matter? I can
see that views might differ here; you will want to write down
somewhere what the intended behavior in such a case is.

Jan




 


Rackspace

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