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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Luca Fancellu <luca.fancellu@xxxxxxx>
  • Date: Fri, 8 Oct 2021 14:38:03 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Sv2ml6lyyNW+SNI4IoANswTuv0imJQXHfHwkQibWpDU=; b=E04vHmkFYR72N67u+wAdYqDOPvrLnMFrby+736oMQcWHr2IIqkPrSqgr1Me48VFzNuDdSE7r91C1uh4fRRMk1LM2iOqQ+8WEfmBv87Uz6dAn8rFL0oFhTzA2Clo/VlSJ5PByN/XwplfcLxGuCvWWal3OkWD+MnFZpe4OvF0F69JrR8m74IYdXkVBt0nLT3TEWFHH9at9Xb5LkY6iZpupu6SK2SJCVFYB32HwFDrj9go48CZKCVNmgWs8MCj5VKN4egCLXmeyKagGxYlN0wZihwPNGA4nncABHqzKSDZzaa85xGXeXgkd28LlHVCFCc6Q2PhYb8kHHiIvgxVwrtNl/w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JN8x+5uepIMKiUci7EW0JeFdBIVGfX0VMzq7sIa9HXUp4vk2fBwPhunvzqTAttNOfKa0UdsFq7PvCIkoywLt4D9zYZL7NEcs1e5IseyZUK4fPytxXTkgkhHloCp1Jp0u4nSUgy5yVefKKIFA+m9wxNeszx2dE1qqD/MdFAWljW13kNLe9nGx7HO4mbO3GpAEIaEBY4SZIkI4dcmzFwLPo1e13NslmOjj5Ym7n+sBie6QIMypyiALK70PNPItEjUr7o35A6KrIWYZ3fr88vtIp1XUap4pDvIptzP4PCFKnYUHiZJ2mJax4sY7SK5AUYpA0AWmQ6Pwzmai6bjlcTUczA==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>, wei.chen@xxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 08 Oct 2021 13:38:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;


> On 7 Oct 2021, at 08:15, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 01.10.2021 17:13, Luca Fancellu wrote:
>> 
>> 
>>> On 1 Oct 2021, at 15:22, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>> 
>>> On 01.10.2021 15:55, Luca Fancellu wrote:
>>>>> On 1 Oct 2021, at 12:02, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>>>> On 30.09.2021 16:28, Luca Fancellu wrote:
>>>>>> @@ -1361,12 +1361,30 @@ efi_start(EFI_HANDLE ImageHandle, 
>>>>>> EFI_SYSTEM_TABLE *SystemTable)
>>>>>>       efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
>>>>>>       cfg.addr = 0;
>>>>>> 
>>>>>> -        dir_handle->Close(dir_handle);
>>>>>> -
>>>>>>       if ( gop && !base_video )
>>>>>>           gop_mode = efi_find_gop_mode(gop, cols, rows, depth);
>>>>>>   }
>>>>>> 
>>>>>> +#ifdef CONFIG_HAS_DEVICE_TREE
>>>>>> +    /* Get the number of boot modules specified on the DT or an error 
>>>>>> (<0) */
>>>>>> +    dt_modules_found = efi_arch_check_dt_boot(dir_handle);
>>>>>> +#endif
>>>>> 
>>>>> So I had asked to add a stub enclosed in such an #ifdef, to avoid the
>>>>> #ifdef here. I may be willing to let you keep things as you have them
>>>>> now, but I'd like to understand why you've picked that different
>>>>> approach despite the prior discussion.
>>>> 
>>>> There must be a misunderstanding, your message in the v3 was:
>>>> 
>>>> "Every time I see this addition I'm getting puzzled. As a result I'm
>>>> afraid I now need to finally ask you to do something about this (and
>>>> I'm sorry for doing so only now). There would better be no notion of
>>>> DT in x86 code, and there would better also not be a need for
>>>> architectures not supporting DT to each supply such a stub. Instead
>>>> I think you want to put this stub in xen/common/efi/boot.c, inside a
>>>> suitable #ifdef.”
>>>> 
>>>> So I thought you wanted me to remove the stub in x86 (since it doesn’t 
>>>> support DT)
>>>> and put this call under #ifdef so it won’t be compiled for arch not 
>>>> supporting DT.
>>> 
>>> So FTAOD I'll repeat the crucial part: "I think you want to put this
>>> stub in xen/common/efi/boot.c". There was nothing about removing the
>>> stub altogether.
>> 
>> Oh ok, now I see, so in your opinion this is a better idea:
>> 
>> #ifndef CONFIG_HAS_DEVICE_TREE
>> static inline int __init efi_arch_check_dt_boot(EFI_FILE_HANDLE dir_handle)
>> {
>>    return 0;
>> }
>> #endif
>> 
>> But I would like to understand the advantage respect of my approach, could 
>> you
>> explain me?
> 
> Well, to a degree it's a matter of taste. Your approach may lead to a long
> series of various #ifdef sections in a single function, harming readability.
> Having stubs instead (usually placed in headers, albeit not in this case)
> allows the main bodies of code to remain more tidy.

Yes right, in this case I did in another way because declaring the stub in the 
.c file
was (in my opinion) not the right thing to do, since also the name (efi_arch_*) 
recalls
something arch oriented and so not to be put in the common code.

In this way any future architecture supporting DT, can just provide the 
function (or a 
stub) and we don’t have stubs in architectures that won’t ever support DT.

In your opinion that solution could be acceptable?

Cheers,
Luca

> 
> Jan




 


Rackspace

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