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

Re: [PATCH-4.16 v2] xen/efi: Fix Grub2 boot on arm64


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 5 Nov 2021 08:35:04 +0100
  • 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W/GzU/QGWQHeMxRn5F2BXlpmwnLwWlVaERfJKAxfqYk=; b=WDtCnVHfwNnuTf7arEMrrbyY2AAPdnpIN9n2+onroXhS12wcLYRRknRgpg0nbDAsh7oUogIxFn4E4QYRSJJk0c0SGEH0//YzAPyVsSEwDRIYB3cIIux8VOBvZCfwjd+b++FJB+ebB/nfV6thndGuCtcC7zgNjPvc9l/HfVNdG65zSb3u6KQ+zsrwOFvso0Yzy0DxIWGWsBhFgT5AvkAX/xrzFV4ISOYVf/3/0HE3o6zIdTy7A2osMfMJl7WxXTuNm9oiu96O/lXC7Uj/eB9sP1/a1NU2ozFvGdh9MHTuIEVePTglqtaUAuqohYh/2OKPm+05DglE2qs/4VymJh3mVA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NIiIWPUwXAx2qyDeTt3eTwun1jwZyZ1EqA81Rz300EJW3gtdQWqLfWgcuwvoRYNh9k2+OuOiGPjz7edYst2hqEF4foA+uOS3+9CwWGug5CoO+OQGePIGM98/h1UmWfrpgkXUu6LqW6y7vow+vUGKr3cfFFmM46to86WYEQ5jdcxmHTQ2YP+BJX5gbi7YVGD8vaFeBZFTjbms4+jdnDdTc6v4KkizjYqFbCIRYukSNr4gqQnhQkxNmpS0I3BvaorE8AXYzyB29SQZU6xCvZ5jcfu9qNveyu37LGJu2KZu61Oq//zsGmbeYvWzVWnTZ9eBDpLNLJQ7yeMz76O+1IeZ6w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>, wei.chen@xxxxxxx, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Luca Fancellu <luca.fancellu@xxxxxxx>
  • Delivery-date: Fri, 05 Nov 2021 07:35:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.11.2021 22:50, Stefano Stabellini wrote:
> On Thu, 4 Nov 2021, Luca Fancellu wrote:
>>> On 4 Nov 2021, at 21:35, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
>>> On Thu, 4 Nov 2021, Luca Fancellu wrote:
>>>>> On 4 Nov 2021, at 20:56, Stefano Stabellini <sstabellini@xxxxxxxxxx> 
>>>>> wrote:
>>>>> @@ -851,10 +853,14 @@ static int __init 
>>>>> handle_dom0less_domain_node(EFI_FILE_HANDLE dir_handle,
>>>>> * dom0 and domU guests to be loaded.
>>>>> * Returns the number of multiboot modules found or a negative number for 
>>>>> error.
>>>>> */
>>>>> -static int __init efi_check_dt_boot(EFI_FILE_HANDLE dir_handle)
>>>>> +static int __init efi_check_dt_boot(EFI_LOADED_IMAGE *loaded_image)
>>>>> {
>>>>>    int chosen, node, addr_len, size_len;
>>>>>    unsigned int i = 0, modules_found = 0;
>>>>> +    EFI_FILE_HANDLE dir_handle;
>>>>> +    CHAR16 *file_name;
>>>>> +
>>>>> +    dir_handle = get_parent_handle(loaded_image, &file_name);
>>>>
>>>> We can’t use get_parent_handle here because we will end up with the same 
>>>> problem,
>>>> we would need to use the filesystem if and only if we need to use it, 
>>>
>>> Understood, but it would work the same way as this version of the patch:
>>> if we end up calling read_file with dir_handle == NULL, then read_file
>>> would do:
>>>
>>>  blexit(L"Error: No access to the filesystem");
>>>
>>> If we don't end up calling read_file, then everything works even if
>>> dir_handle == NULL. Right?
>>
>> Oh yes sorry my bad Stefano! Having this version of the patch, it will work.
>>
>> My understanding was instead that the Jan suggestion is to revert the place
>> of call of get_parent_handle (like in your code diff), but also to remove the
>> changes to get_parent_handle and read_file.
>> I guess Jan will specify his preference, but if he meant the last one, then
>> the only way I see...
> 
> I think we should keep the changes to get_parent_handle and read_file,
> otherwise it will make it awkward, and those changes are good in their
> own right anyway.

As a maintainer of this code I'm afraid I have to say that I disagree.
These changes were actually part of the reason why I went and looked
how things could (and imo ought to be) done differently.

Jan




 


Rackspace

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