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

Re: [PATCH] xen/arm: acpi: Support memory reserve configuration table


  • To: Leo Yan <leo.yan@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 18 Aug 2022 10:52:05 +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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rBBgTfeIwaWlegm8J0ysD718Rr60FxDmu1Ck+c27wcY=; b=bUM16LjqvdY4w1qqGXP+UAn6cU17b0QctrTI+j0ULVX/R0q/3eWU6ckqyPKZbl7j1sSXseLPds5aXcfHFDZQteBBVjdkdmlOeIrxX6Q+yvzrFc98GFjkqHg6jf1hunEha6qV/289y84zj8hnZu8OVtMrX/mW3YBRyOK10A6eQnS23RHSxg8LeWGXHdnTcbsMXuZqah9SNAcU1w7z+/isqwX67K/TxdONHKH3xuieFwl4DegVcuoorn7OJvCeL8GS+D12C3RpCbIpo277MbyM89JeEZOjtCfoBPJzywjvRTt81zVjdj+hrGvKRY3AZ8Rx2ZxSDfKFYjZkXhmKjc8z3A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IJEN6HjgDFvWNM4PkL4jslkD1SLeA/dtAhZbkp/JOuVpSITQbOh+GlytHQAd/Nk+rG0HoVCmSATgWOnkMl5iAfmGCNkK8Re2biZkAYFHaH2HKlLb0sidin41Ljli54ZM13XHwGjkWWoEPTkT/xU5rSf1ozt8gbrIEe4qqwYkL4oxekFv5DFE2dZItySmJbY4h0kX903GfgphxeYBHw3YeID0sfiKaF7jDOYO8MA1PNr3+ojPPDb8Kkv/8APeVE2ZoHW6j/BAWQ7b6XIpOKWvDnlRe/BsqlrWOqqEHas0fOGGOJ05uQS5ZLRsKRvekibfAhvrLUAqivO9HvSGJKFbgw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Ard Biesheuvel <ardb@xxxxxxxxxx>, Marc Zyngier <maz@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>, Peter Griffin <peter.griffin@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>
  • Delivery-date: Thu, 18 Aug 2022 08:52:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.08.2022 10:46, Leo Yan wrote:
> On Thu, Aug 18, 2022 at 09:47:46AM +0200, Jan Beulich wrote:
>> On 18.08.2022 09:34, Leo Yan wrote:
>>> On Wed, Aug 17, 2022 at 03:17:53PM +0200, Jan Beulich wrote:
>>>> Furthermore - what if Linux decided to change their structure? Or
>>>> is there a guarantee that they won't? Generally such structures
>>>> belong in the public interface, guaranteeing forward compatibility
>>>> even if Linux decided to change / extend theirs (at which point
>>>> consuming code there would need to do translation, but maybe using
>>>> a Xen-defined struct [plus translation in Linux] right away would
>>>> be best).
>>>
>>> I saw Ard has helped to answer this question in his email.  As Ard
>>> said, the general way is to rely on Linux EFI stub to allocate the
>>> data structure for MEMRESERVE configuration table.
>>>
>>> Given Xen uses pseudo EFI booting (the ACPI table is passed via DT), in
>>> short term I don't think Xen can support Linux EFI stub, so we need to
>>> maintain this structure in Xen as well.
>>>
>>> This structure eventually will not change frequently, so I assume
>>> later we will have little effort for maintainence it.
>>
>> "Will not change frequently" isn't enough. Imo there needs to be a
>> public interface structure in Xen and translation code in Linux.
>> That's the only way the consuming code in Linux can remain (largely)
>> independent of changes to the structure in Linux (i.e. changes there
>> can be expected to be accompanied by updating of this code, perhaps
>> simply in order to keep things building).
> 
> Yes, actually Xen doesn't care about the structure definition for
> linux_efi_memreserve, it just allocates the table and finally used by
> Linux kernel.  So another way is we can simply allocate a bigger
> memory region (e.g. 64 bytes), which is sufficient than kernel's
> structure linux_efi_memreserve size (only 16 bytes), then we can
> initilize it as all zeros, and this can be helpful if later kernel
> extend the data structure.

Well, no, that's not how one would define a structure which can, in
a backwards compatible manner, be extended down the road.

> But this method is a bit arbitrary, this is why I did't write like this.
> As Julien said, I think the critical thing is to make a call to support
> EFI stub or not.

I don't see how this can be a reasonable option - we'd have to re-
implement an almost complete EFI (to cover everything one can do
via boot or runtime services). But I'm not an Arm maintainer, so my
view here is at best advisory.

Jan



 


Rackspace

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