[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: Stefano Stabellini <sstabellini@xxxxxxxxxx>
- From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>
- Date: Thu, 18 Dec 2025 07:44:29 +0000
- Accept-language: en-US, ru-RU
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=fs5tmpPkVnWW5zOsZaYv92t0dGewCuP8Ows97lyxbOc=; b=Q+n9Dfxs4afpvKqP7/Wb4F6G5Tt6yt8peAUDe4venhmkgzaBoplIBu2tnqUD2YMN+FcJYFeLBhiVEN+9NoFm0FlFqpsDKJvjQrcs6Vn2XkZaYkDwthNkjZfGB+9oPXB9UvBUuR6xZr1UJpSlIWVRc9MpkCl+q3kJ5uNz+52H0cjFjkIC0ImdU0MBGMn2ItleDcHkR398UUT1J+ZLv5wBzbYuPI+f2n/+SNye0MYAEXueiar0/1r7qoRubuuekGCRG6LoyHM7whxgTKB4kVWXt79medH7jKMztwvOSUmktMKSy47hp9BkUzUvgTEQhT3N2XYnhjlTeQXxTD+N/wlJVg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wI1pTkwpq/KsRTbt7gh8JCw5IrEDIVpgr0mXvoLSBaxd9OfzzyzzB11gjZXvoNcrsltVV3Ow7DpeyCTIyG69l3oHM9NMSWJMjLcu178edKDor+binQ4CWmWmLfVNmLh6LxU51+LfQuMoKXYWurpowCUgcwBDTdyRKR51qIbCk4DXZNNx6Gj2rG1rIZ34S1sAxEC0pQqhr8eU+DWK1/oJ6f/oxSjNSGuP48k/aZCORf+Ld4pqQG+L44rFwfmeyHcaz1Gsc3PJRbVTCTmJ7GFAvdalY+Juu0K0CLUxdFikCknjm9VQzqZVSZ6WwB1eSEWWwkarA1jroVQmVR63jh5ihw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Harry Ramsey <harry.ramsey@xxxxxxx>
- Delivery-date: Thu, 18 Dec 2025 07:44:52 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHcbyzuH15G1NdORkmDpo6kbgtlK7UmhcQAgACAJAA=
- Thread-topic: [PATCH V3] xen/dom0less: Calculate guest DTB size based on MAX_VIRT_CPUS
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;
[snip]
|