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

Re: [PATCH V3] xen/dom0less: Calculate guest DTB size based on MAX_VIRT_CPUS


  • To: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Thu, 18 Dec 2025 13:50:44 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com 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=gQz3QSUX2/UoZuzfBtpPoxx5Wtc2heciyCuAKC2cvRs=; b=m5P+U2xirJMvNScLwiXoyVoToioVt1VuvDKtzlDFCfh3rcaYuNIt5N9ek7vWkGPm+MBiqaWl3nZK6flq2rSUCwZqcU2+w1ZLLgL8l0XGuqgor+516065LsFPQzo22SNxlZmBO4tA0vCjZaNrSi36SusVTYzjfovw2zyiuGYJqyf2lGWMZ0hHbg5Q+SGWpXe6IboFntDrl9lrrAl5zGWJGqZguUTn4KtOHdY94bBJz2OkezyWTaZxesiQ6RK2QpZlYfXIvgPvyxiJpMUczz1EwjZtwVEGfqYHsMHNdUIegNN/pQwECjfgGbs5rWH5MRXg06GCZrprIv4i7E5WMG4efQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=p7MJhvof3IlmnHFoU+wf97rlWOs4kwaCS+s6YUaTQi5DjJKCgh0uvKOL2BJCE1OlXITkdFI4futOEA5CDOJ9dy0VrZDBAf4P72zoiwm9BC+yAyPkTIeqHAHtMGKzJA4wM8LPQNA7Q5zyBui35/XAyjiTk+V9CpfMMSYQNEgWljBg41rwF7khWsRhRsBxXZ9v+RvoNxsjG41XBF52B0MA4qqfQWtDbLXPnxKCnfhaXt9oNjrESAtlGw88NnHOh1E0owze9NEb4YzZW/Nul10W2z9lDgd3JTmJ/AWr7vUYmLdTOShyMKv5pjEH/hs8qYRVhIO4A9en2WLAf1hJ1aPOWQ==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Harry Ramsey <harry.ramsey@xxxxxxx>
  • Delivery-date: Thu, 18 Dec 2025 12:51:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 18/12/2025 08:44, Oleksandr Tyshchenko wrote:
> 
> 
> On 18.12.25 02:05, Stefano Stabellini wrote:
> 
> Hello Stefano
> 
>> On Wed, 17 Dec 2025, Oleksandr Tyshchenko wrote:
>>> Creating a dom0less guest with a high vCPU count (e.g., >32) fails
>>> because the fixed 4KiB device tree buffer (DOMU_DTB_SIZE) overflows
>>> during creation.
>>>
>>> The FDT nodes for each vCPU are the primary consumer of space,
>>> and the previous fixed-size buffer was insufficient.
>>>
>>> This patch replaces the fixed size with a formula that calculates
>>> the required buffer size based on a fixed baseline plus a scalable
>>> portion for each potential vCPU up to the MAX_VIRT_CPUS limit.
>>>
>>> Please note, the change to DOMU_DTB_SIZE formula would result in
>>> a smaller buffer size of 3072 bytes compared to the original 4096 bytes
>>> on Arm32 platforms where MAX_VIRT_CPUS is 8.
>>
>> I am OK with this patch I would only ask to retain the minimum size of
>> 4KB due to the possible presence of passthrough device nodes.
> 
> I think there might be cases when even 4KB would not be enough to cover 
> the whole dtb with passthrough device nodes. But the existing code 
> should already handle that, so if a partial device tree is provided, 
> then it will be accounted separately:
> 
>       /* Account for domU passthrough DT size */
>       if ( kinfo->dtb )
>           fdt_size += kinfo->dtb->size;
I agree with Oleksandr:
Acked-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal




 


Rackspace

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