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

Re: [PATCH] xen/device-tree: Allow exact match for overlapping regions


  • To: Julien Grall <julien@xxxxxxx>, Luca Fancellu <luca.fancellu@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 13 Nov 2024 15:19:15 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=PJKqeXrAls+ee3wBlGOtBpvFHik+dM3ypnTBD2/+KGM=; b=Nbk0qxqvRLYPdpDuZKPfYVek2dj2hVihTDC5Q90m+m11ZzA1k6jlo4dTxuBNP+DnprbQdbBLlYbfOCvAIqbJ/0jkZ4JBxl47WdPhJeDPwHtatKSJZ43pz2C43bGCHDHjiIyFauuTpyfR5PLreKSZO8iiRr24/IDb51nzW9kDb5Xu7M9qZAdpyQV/Ff52IJkpiqvAaGJYcLCrq7a4PmlEJqteZlBM2cVuz1THVEFDeF2hjrIHFkdA+E/oSamJI4/amqwwes1gBbcmlSfvWuuH9goj1HQ6pKDzAr58uJTQMm2vHYHt7P/KScwGZAj6OQaa2BPZAEzgQ4+26LGODM8PvQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kjysmUE9YCGNONQ51p2RiSM9sgPVpjNySdmz+mcqCBp5mA5MF4nvU5LaeFMo5jK3bDMk20L3hpPQlRxTmBjzAWK1guc3chLW4vAY50oWpfKu4BzcddnaAdTV+fdRzG4hveN4ZReoulFwSmlNEJ3jA1isiHexOCf+wv9XGPSa3s0hqOMerSB26ZKZwJkJBPn5Sv4NdpZg3fa2WqhT/JJE1LGzeEXSvRqpmWd8hSrlu6Y2lNAmPqj6d+slnSS/ZAGxW+zoZfoBevm7uQIjZwC8eSOCOhMgLs5zIGdH9DYCC1298JnRReaRz7iUrJV8j/f+KLGLXGNL1kOnKHfZvUqwrA==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Delivery-date: Wed, 13 Nov 2024 14:19:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 13/11/2024 14:50, Julien Grall wrote:
> 
> 
> Hi Michal,
> 
> On 06/11/2024 15:07, Michal Orzel wrote:
>>
>>
>> On 06/11/2024 14:41, Luca Fancellu wrote:
>>>
>>>
>>> There are some cases where the device tree exposes a memory range
>>> in both /memreserve/ and reserved-memory node, in this case the
>>> current code will stop Xen to boot since it will find that the
>>> latter range is clashing with the already recorded /memreserve/
>>> ranges.
>>>
>>> Furthermore, u-boot lists boot modules ranges, such as ramdisk,
>>> in the /memreserve/ part and even in this case this will prevent
>>> Xen to boot since it will see that the module memory range that
>>> it is going to add in 'add_boot_module' clashes with a /memreserve/
>>> range.
>>>
>>> When Xen populate the data structure that tracks the memory ranges,
>>> it also adds a memory type described in 'enum membank_type', so
>>> in order to fix this behavior, allow the 'check_reserved_regions_overlap'
>>> function to check for exact memory range match given a specific memory
>>> type; allowing reserved-memory node ranges and boot modules to have an
>>> exact match with ranges from /memreserve/.
>>>
>>> While there, set a type for the memory recorded during ACPI boot.
>>>
>>> Fixes: 53dc37829c31 ("xen/arm: Add DT reserve map regions to 
>>> bootinfo.reserved_mem")
>>> Reported-by: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
>>> Reported-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
>>> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
>>> ---
>>> I tested this patch adding the same range in a /memreserve/ entry and
>>> /reserved-memory node, and by letting u-boot pass a ramdisk.
>>> I've also tested that a configuration running static shared memory still 
>>> works
>>> fine.
>>> ---
>> So we have 2 separate issues. I don't particularly like the concept of 
>> introducing MEMBANK_NONE
>> and the changes below look a bit too much for me, given that for boot 
>> modules we can only have
>> /memreserve/ matching initrd.
> 
> How so? Is this an observation or part of a specification?
Not sure what specification you would want to see. It's all part of U-Boot and 
Linux behavior that is not documented (except for code comments).
My statement is based on the U-Boot and Linux behavior. U-Boot part only 
present for initrd:
https://github.com/u-boot/u-boot/blob/master/boot/fdt_support.c#L249

For things that Xen can be interested in, only region for ramdisk for dom0 can 
match the /memreserve/ region.
Providing a generic solution (like Luca did) would want providing an example of 
sth else that can match which I'm not aware of.

~Michal



 


Rackspace

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