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

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


  • To: Luca Fancellu <luca.fancellu@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 3 Nov 2021 12:28:12 +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=ZBxnABk5/5EXAAR1dzC6HeqRbPLljn2VRahWR608SN0=; b=kGzvx5p99yLMqXV5WDdDnwVoCZXEB/MWLw8Il4F+K/z+tEUvZ9USnnYP8gp8eJy7AMHazmGOHYm1SRqCOBTNOmw9iYGbnuX1+y/D/cwGe/XBqz27SgHX8z8NhqwGFJrRCqPD6yDlNRY8pdq07oF/fJawy/KgHgFmcqN8G8QFSF/gwFv0C7INiu5y/plP5JXubCDHWXVGJzSVp7f4GfEmOCqF57PK2mKIIUbE17DEpAx18An46dbvvisd8MDjmWZHj4KMqfRoIZcL1GH2/mKObmQk0Q0C9nxN0uTLI09xA44QWmnOKfhQGe6L9onwGzTAi8MuqA0QueOJ4cYOQ6Pyjg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nuwVs+GW+ZfJQhoJsjzVEDapq+d8s479Oam4vmBIiPnGrgZqSaH5M/R4vvHORrJdfvf53+dt1eep3031XAFGoCEjhNpIKFX0WlloQUVv92XMhTpxT8tr6cvuDRic/IB9ufWyMn/qqw4BbF+K1i8ZYHbRztYeIY1awo0dEn8XjU5FnyzMafd7SnwF7zI9PksutT3V9+LMa6FBmfa/uClL+GLkiDrk91hYaROhBi5pEiDKNhcy/uvT1SPjIdD510Bobp7Itj8GSA2oY6hwz+Na6kc1rg3q3g0rdS1G3tr0a7V1aeNa1BQG27VDXZD4jHzLkNxiIObul07SXbQsp4RXiw==
  • 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, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • Delivery-date: Wed, 03 Nov 2021 11:28:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.11.2021 11:20, Luca Fancellu wrote:
> 
> 
>> On 3 Nov 2021, at 08:20, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>
>> On 02.11.2021 18:12, Luca Fancellu wrote:
>>>> On 2 Nov 2021, at 14:45, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>>> On 02.11.2021 15:05, Luca Fancellu wrote:
>>>>> The code introduced by commit a1743fc3a9fe9b68c265c45264dddf214fd9b882
>>>>> ("arm/efi: Use dom0less configuration when using EFI boot") is
>>>>> introducing a problem to boot Xen using Grub2 on ARM machine using EDK2.
>>>>>
>>>>> The problem comes from the function get_parent_handle(...) that inside
>>>>> uses the HandleProtocol on loaded_image->DeviceHandle, but the last
>>>>> is NULL, making Xen stop the UEFI boot.
>>>>
>>>> According to my reading the UEFI spec doesn't (explicitly) allow for
>>>> this to be NULL. Could you clarify why this is the case? What other
>>>> information may end up being invalid / absent? Is e.g. read_section()
>>>> safe to use?
>>>
>>> My test on an arm machine running Grub2 on top of EDK2 showed that
>>> when Xen is started, the get_parent_handle(…) call was failing and stopping
>>> the boot because the efi_bs->HandleProtocol(…) was called with the
>>> loaded_image->DeviceHandle argument NULL and the call was returning
>>> a EFI_INVALID_PARAMETER.
>>> So the parent handle can’t be requested and the filesystem can’t be used,
>>> but any other code that doesn’t use the handle provided by 
>>> get_parent_handle(…)
>>> can be used without problem like read_section(...).
>>
>> I understand this. My question was for the reason of ->DeviceHandle
>> being NULL. IOW I'm wondering whether we're actually talking about a
>> firmware or GrUB bug, in which case your change is a workaround for
>> that rather than (primarily) a fix for the earlier Xen change.
> 
> The issue was found only when using EDK2+Grub2, no issue when booting
> directly from EDK2.
> This is a fix for the regression, because without the EFI changes, Grub2 was
> booting successfully Xen. Using grub2 to boot Xen on arm is a very common
> solution so not supporting this anymore could lead to lots of people having
> issues if they update to Xen 4.16.

I'm not objecting to addressing the issue. But the description needs
to make clear where the origin of the problem lies, and afaict that's
not the earlier Xen change. That one merely uncovered what, according
to your reply, might then be a GrUB bug. Unless, as said earlier, I
merely haven't been able to spot provisions in the spec for the field
in question to be NULL.

Jan




 


Rackspace

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