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

Re: [PATCH V2] xen/arm: Initialize acpi_disabled to true during declaration


  • To: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Wed, 26 Mar 2025 09:57:48 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ktBsZlelN5gjemRMVv0ki2io3eG0mY1p/6TdKDsgq+8=; b=AFJ/pihDNEpiamgeEy9PHFhu7aIcb5HMZfmKpKQVq8ONJSvVUytFnN1lW3tTeHslcZMe+eHRQXnMVQsE05milUjl2eefnKyyvN9JpXLZsgbo6CweoohoRRB7S/RA5b1jTKs46Wvt+gpMYz6qlKq4Y/1aI/yzCiN2AGXb6u/E4BwITda2pRtBabP6hRHa2yJRI7ZVYg6Bl+1pk5V/r+/lmZlGiTyGbSPCiFT16Y5gLT2pAkDYwjZf5yQj7Q/XOHISSEPP9sZAM9A1yAlwY/LrYdw2SOpB/7jT9MSXbJQjIVUy1625ZiuI+tYwCBdplPtepXdcnfOq1tui94VjTl9LZg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jV1EySX+aBE2Ru+VBXLeU1d2FrgEVXw6aW8cGiXq8lSI2Vc0vm7qGM+S2h0XD6EDtYs7Y8nCEXx3n5yqcoPWLGyRBuiM81ydyqGkHKAEmMx6WWOdWvC9QAeWHEa719KEAV9MLMdAzt7rdj6iJzngIGe6/qFg+mQFFssuKAg6EU3OFRX4zwIc+4dqQu1NsVqqo85MKTPxp9ST9W4pi0od2aUWZB6+2X6+DaRkcfxwDqEGfZLwtckIsynbmGAB0zAmIUg1iCQMF7L90/w6+XisAhuobM4gx6ApYHAyAlLqvMogcFmxo6AG2HTsY1jolHqvD3IhvVWkOD1PSVsJXDQaLw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 26 Mar 2025 08:58:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 25/03/2025 17:54, Oleksandr Tyshchenko wrote:
> 
> 
> On 25.03.25 18:09, Julien Grall wrote:
> 
> 
>> Hi Oleksandr,
> 
> Hello Julien
> 
>>
>> On 25/03/2025 16:05, Oleksandr Tyshchenko wrote:
>>>>>> Furthermore, what happen if we decide to use ACPI afterwards? Wouldn't
>>>>>> this mean that the static regions would be reserved even if ACPI
>>>>>> doesn't
>>>>>> use static memory (all the memory is expected to be given to the
>>>>>> allocator)?
>>>>> I don't think such hybrid configuration is valid (booting with ACPI yet
>>>>> declaring reserved regions in DT). See commit:
>>>>> 9c2bc0f24b2ba7082df408b3c33ec9a86bf20cf0
>>>>
>>>> I don't think the commit is preventing hybrid configuration. It is just
>>>> saying that the region (which could be a static region because this is
>>>> not supported) will be unreserved.
>>>>
>>>> IOW, when booting with Device-Tree you may be able to use static memory.
>>>> But if you were booting with ACPI, static memory is not supported and
>>>> therefore the regions should be free for other purpose.
>>>
>>>
>>> Julien, I see your points, but the current patch does not attempt to
>>> make static (reserved) memory properly work on ACPI-based system (if it
>>> is available there), current patch tries to solve the real issue on
>>> device-tree-based system with Xen compiled with CONFIG_ACPI=y (at least
>>> unintentionally).
>>
>> I am not asking to make ACPI work with static memory. I am asking to not
>> break ACPI if the Device-Tree is specifying static memory region.
>>
>>> However, I wonder, why it has not been noticed so far.
>>
>> ACPI is not a supported feature and gated by UNSUPPORTED. So the
>> implication is you have enabled UNSUPPORTED and anything can happen
>> really ;).
> 
> Indeed, this answers the question.
> 
> 
>>
>>>
>>> It took some time to understand why just enabling CONFIG_STATIC_MEMORY=y
>>> triggered a BUG in common code. And it turned out that it was
>>> CONFIG_ACPI=y in my Xen's .config that caused that consequence (I
>>> specially wrote so long description to provide full context).
>>
>> As I wrote above, the only thing I am asking is that memory for static
>> regions should be unreserved when ACPI is enabled like it is already the
>> case today.
> 
> So the concern is that not reserving provided by the device tree static
> memory region is going to be a potential waste of the memory on the real
> ACPI system? Or I missed something?
> 
> I see two options with unreserving the static memory regions on the real
> ACPI system. I assume, that we should unreserve only after we definitely
> know that we are running with ACPI (i.e. after acpi_boot_table_init()
> completes and acpi_disabled reflects the real state of things), right?
> 
> 1. either call acpi_boot_table_init() before setup_mm() in Arm64's
> start_xen().
This cannot be done. acpi_boot_table_init() calls ACPI functions that make use
of VMAP and alloc_boot_pages, so the boot allocator is expected to be populated
at this point.

> 2. or go through reserved_mem->nr_banks and unreserve everything marked
> with MEMBANK_STATIC_DOMAIN after acpi_boot_table_init() completes
What if we split acpi_boot_table_init() into 2 parts, where first is used to
determine the real "acpi_disabled" value, called before setup_mm and second used
to parse the tables? There's one issue with this approach. Today, even after we
evaluate that we should run with ACPI enabled [*], error in ACPI table parsing
is ignored and ACPI is set to disabled. That's not really in the spirit of our
current methodology, where we should panic if user requested something that does
not work. Example: today, even after specifying "acpi=force", error in table
parsing bails out to DT approach which is not what user wanted.

~Michal




 


Rackspace

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