On 04.12.25 10:44, Luca Fancellu wrote:
> [You don't often get email from [email protected]. Learn why this is 
> important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> Hi Oleksandr,

Hello Luca

> 
>>
>>>
>>>>     */
>>>> -#define DOMU_DTB_SIZE 4096
>>>> +#define DOMU_DTB_SIZE (2048 + (MAX_VIRT_CPUS * 128))
>>>
>>> On Arm32, MAX_VIRT_CPUS is 8. This means the new DOMU_DTB_SIZE is going
>>> to be smaller than 4096. Why is it ok?
>>
>> You are correct to question the impact on Arm32, where MAX_VIRT_CPUS is
>> smaller, leading to a calculated buffer size of 3072 bytes, which is
>> less than the original 4096 bytes.
>>
>> Unfortunately, I have no possibility to test on Arm32. But, I do not see
>> much difference between Arm64 and Arm32 in the context of DomU device
>> tree generation by looking into the code.
> 
> Let me know what kind of test you need, we have some arm32 setup here (not 
> HW, virtual platforms).


Thank you very much for offering to test this on Arm32 platforms.

The primary goal of the test is to confirm that the new, calculated DTB 
buffer size of 3072 bytes is sufficient for a worst-case Arm32 dom0less 
guest. The expected result is that Xen boots successfully, and the 
regular dom0less guest is created without any panics.

The ideal test configuration would be a dom0less guest with the 
following configuration:
- The vCPU count set to the maximum for Arm32, which is 8, the vCPU 
nodes should ideally contain "clock-frequency" property.
- Any other features that add nodes to the guest device tree enabled 
(e.g., hypervisor, reserved-memory, pl011 nodes are present, etc), to 
create the largest possible "base" FDT size.

The test would involve applying the current patch, and the diff below:

diff --git a/xen/common/device-tree/dom0less-build.c 
b/xen/common/device-tree/dom0less-build.c
index 38a5830813..e95f42d1e1 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -577,6 +577,9 @@ static int __init prepare_dtb_domU(struct domain *d, 
struct kernel_info *kinfo)
      if ( ret < 0 )
          goto err;

+    printk("Final compacted FDT size is: %d bytes\n", 
fdt_totalsize(kinfo->fdt));
+    printk("Predefined FDT size is: %d bytes\n", DOMU_DTB_SIZE);
+
      return 0;

    err:


Please let me know what you get. Thanks again.


> 
> Cheers,
> Luca
> 

Reply via email to