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

Re: Question: Enable LINUX_EFI_MEMRESERVE_TABLE_GUID in EFI


  • To: "leo.yan@xxxxxxxxxx" <leo.yan@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Thu, 11 Aug 2022 14:58:49 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=xpPjzz922B+GbkLI2qbtlyGbTL/cglPwEtotB0ioU2U=; b=df/1rtkDurtUWW8kKbw3/eFkdMFC+Y7gt6UbDHcYG5YvcsU5qLiWbb/bc4I9R3EDcGvweu5btISMi3L8Xrahyxt2hsKwa3FWYWeaYA3C1m6gEHDvbj2Z/5y9qJJtc1SIB9AQjbEMMDdqg/6AZkkuSMQVbLubJJj9jjIYWi/Ae1LgDNmr7k5I3kvmp4EKf0JjwI1haIw6ohWfN0QxacxY772vi251kz5GikjZOsiWVafYqZvYc/GQExtDK753Oy3geYRj1lxcCdwgaUaE7vO4qe5vbwPTPHbLvSiWYThMgY92UNx7Npy25vW03ShrDCMmo2jQkqAMtLen4EIaXErR8g==
  • 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=xpPjzz922B+GbkLI2qbtlyGbTL/cglPwEtotB0ioU2U=; b=eaYVfk9rW7igJ2JqZucDv20WDDltIKK7zu6kkZqS7Ej6Ka5RmLgH4zOOfBe4KdDdNTsHw8zjg9QT7Hpb6ekB8b9t7exdrEJlzsagbMQrk5SSAMbPUQaXigf+TvCEqpo3EEqyOYymdeOdteUgN6JHC+57K7oC/N4mcgkEGyE5ilXnpRpYwTXK+4IceqVkvMceOXvbik8X0qaH9PRuLswViymou/qEi7lYgBuxgQwZdVROP6DR3zLRiF5JBhP+ISfzb4kkjlLm1Uz+lQLcPcaQvYThsFbm166wx/uPskQFFAa64oPJs2GKgCRkYOWGOeaU3oIvQNcq/2Ukl3jweboGaA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=JTCQKXY1+QHUiDAlEWEZudoxuKKadf67fQwK21m92w1nOoIH/7PT6gf5nuMpNPFwm9QyMQZ7nyAi4aZCgdKtm/sJXZt0n0h0/eepTsPqIvoYeqdA1tUyGnpvC8fkzj/mXpPuGNz4KR6Qrx8zdoaaV+uhgbh7AYWg7szMYjAoE7OonJ6lRoYrNLgiV2SW/DeNtA92YFCMPzeNGshYZtU1swZTEoUgvczfLLwWwSQkMw8Q8EY8+VJ58VAmfGxmLFFL2fhaP4D+K8Oc8Thlo3jrm6UquM2giawqQ1AbrCQxp64Ymfl6lqrHAgLRSV3x0O7r6jR3bPLMx/TdVlExKyXktA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jb3why6vW2cJVO5mhLhGxk8jVGhkBhnlyHJ+BnEfJRWDs033h2qp8B7AaAzXTZKbAW8sGGGv/oCXST3f0VI/1gYZHNjEnLymbeZJDh8h/wILK01FOXx5uCHjpxoQUzOhdbLbz/VwiC2vzoywHYuuzaU0EkBLdWZO+lsWQzZgjC5e9m9rFUSe7329PKKHcINFBeSCNnLieSmAZOhqqYUimtnvvj7o6m8Hrw/0WMAtTM4coZcd1gGC7EyYSewYEsJTP0R5xOT88KW9HRSWdnHaixJUTrzNKPNE4gctNFudrtS+RtBnx9hyuSogA3bYgjyD3xmaubZBp+CfrJWo+afLGg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Peter Griffin <peter.griffin@xxxxxxxxxx>, Jerome Forissier <jerome.forissier@xxxxxxxxxx>, Marc Zyngier <maz@xxxxxxxxxx>, Ard Biesheuvel <ardb@xxxxxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>
  • Delivery-date: Thu, 11 Aug 2022 14:59:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYp9oMDnfnppRN40WNR+bqQStYIa2gMcaAgAAFzACACZLNgIAAC6aA
  • Thread-topic: Question: Enable LINUX_EFI_MEMRESERVE_TABLE_GUID in EFI

Hi Leon,

> On 11 Aug 2022, at 15:17, Leo Yan <leo.yan@xxxxxxxxxx> wrote:
> 
> Hi Bertrand, Rahul,
> 
> On Fri, Aug 05, 2022 at 12:05:23PM +0000, Bertrand Marquis wrote:
>>> On 5 Aug 2022, at 12:44, Rahul Singh <Rahul.Singh@xxxxxxx> wrote:
> 
> [...]
> 
>>>> Looked into the code, the GICv3 driver tries to create persistent
>>>> reservations for pending pages, and the persistent reservation table
>>>> can be used by kexec/kdump.  For the persistent reservations, it
>>>> relies on MEMRESERVE EFI configuration table, but this table is not
>>>> supported by xen.efi, I think this is the reason for the above oops.
>>> 
>>> Yes, you are right above warning is observed because Xen does not support 
>>> memreserve efi table. I also observed a similar warning on the N1SDP board.
>>>> 
>>>> I checked that if I boot a host Linux (without Xen), then the EFI has
>>>> provided MEMRESERVE configuration table, I can get below log:
>>>> 
>>>> #  dmesg | grep MEMRESERVE
>>>> [    0.000000] efi: TPMFinalLog=0x807f9ef0000 ACPI 2.0=0x807fa0d0018 ... 
>>>> MEMRESERVE=0x807f8141e98
>>>> 
>>>> Just want to confirm, is anyone working on enabling MEMRESERVE EFI
>>>> configuration table for Xen?  And welcome any comments and
>>>> suggestions!
>>>> 
>> 
>> No I do not think anybody is working on this at the moment.
>> If you want to work on adding support for this in Xen, we can provide support
>> and help on reviewing and testing as we have several targets on which we
>> observe this (N1SDP and Ava).
> 
> Thanks for your quick response.
> 
> I took time to look into the code, below are my conclusions.
> 
> For a normal UEFI boot flow, UEFI will invoke Linux kernel's EFI stub,
> and the EFI stub will install MEMRESERVE EFI configuration table.
> This is accomplished in the Linux function install_memreserve_table().
> 
> Secondly, Xen passes DT to kernel, it synthesizes ACPI compatible
> nodes in the device tree and finally kernel parses DT and create the
> ACPI table.  In this case, Xen doesn't invoke Linux EFI stub.
> 
> To be honest, I have very less knowledge for Xen and APCI; just based on
> reading code, I think it's hard for Xen to invoke Linux kernel's EFI
> stub, this is because Xen needs to provide the EFI runtime services, and
> I don't think it's feasible for Xen to pass through UEFI's runtime
> service to Linux kernel.  If we implement the EFI runtime services for
> Xen, then this would introduce a big implementation.
> 
> So another option is we simply add MEMRESERVE EFI configuration table
> into device tree, just like Xen does for other ACPI tables (e.g.
> RSDP?).  And then in Linux kernel, we need to parse the DT binding and
> initialize the corresponding variables in kernel, so we need to add
> support in the Linux source drivers/firmware/efi/fdtparams.c.
> 
> Before I proceed, just want to check which option would be the right
> way to move forward?  And I am open for any other solution and welcome
> suggestions.

When Xen is started using EFI, Linux is then started purely using device tree
there is a standard way to define reserved memory to linux using the device
tree and Xen should decode the Memreserve entry from EFI and add the
corresponding entry in the device tree that we give to linux.

Regards
Bertrand

> 
> Thanks a lot!
> Leo




 


Rackspace

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