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

Re: [PATCH v4 2/4] xen/arm: optimize the size of struct vcpu


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Mon, 29 Dec 2025 12:10:15 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.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=J0cV5rV+xQPEWNXLpe0WxtftRePmtn+2wnrRtPWXJ0w=; b=noKctoP4dbyW0qMJmTSdttxyS+iK7oYY8NyFy/q5MU8xbCyD1WfU6FYIOG8GF6LMTNZT7swyyBMl5jWGMwmLA1d/VIstDYXbGpAHyAxJeiiwVdHN3V8x8xANFYrInrft57J+hZ72KPaKXgbfRNkGn9229w2k3ZI7Coc9xs+UYJofB4tvuHt3qxq0lQifSXQuvSXk5lpU3ooeWOyQgIXJIAaoaJZW4eGXsrij435O+LUi/VK7EevOflhzQj4LrarwfNWRpmD/7SdURlvtOjPitpax0G1S5QV7JRqihxmtGLJ3TFMm6ADFZNySu81zR5D0baYe+8gIjb4MT/zIs+ecvg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NeQubH514eXMgZt47R8/lqtdJRqhA2Wfdl/lwQrnBcedYwo+l1o84Xcv2GXLDC1kZegkVEvEqBJxOAqUnUTLNWcK4gJ/JHMVzSYSYva7dhRkP6uIw6KQjwQUt+Xkp8kWr70P0W0gM/p1wNxsO1ExWWPJlKfTfpxMl4pGfsP8KzduGRg86JGAOVoUKLJefCImOPwVqBzSkQuKllNyHTStYhhx2aaFrRugPGViHeKDUQ3/YrYVV1B8ohgGuCKUVDkfOqdZSffHmO+a+q3Yr7RBFgE9rimS70e0FpY7EpV7ijigPU8PifrO6zu3Uh7YyNI9rFRvl0rz4iL+LaoXe2kN9w==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Mon, 29 Dec 2025 11:10:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 29/12/2025 12:08, Orzel, Michal wrote:
> 
> 
> On 23/12/2025 18:01, Oleksii Kurochko wrote:
>> When CONFIG_NEW_VGIC=y and CONFIG_ARM_64=y, the size of struct vcpu
>> exceeds one page, which requires allocating two pages and led to the
>> introduction of MAX_PAGES_PER_VCPU.
Also, I think it would be better to drop MAX_PAGES_PER_VCPU in this patch.

~Michal

>>
>> To remove the need for MAX_PAGES_PER_VCPU in a follow-up patch, the vgic
>> member of NEW_VGIC's struct vgic_vcpu member private_irq is changed to a
> s/vgic_vcpu/vgic_cpu/
> s/private_irq/private_irqs/
> 
>> pointer to struct vgic_irq.
>> As a result, the size of struct vcpu for Arm64 is reduced to 2176 bytes,
>> compared to 3840 bytes (without these changes and with CONFIG_ARM_64=y)
>> and 4736 bytes (without these changes and with both CONFIG_ARM_64=y and
>> CONFIG_NEW_VGIC=y).
> You only touch new vGIC, so there should be no size reduction without it but 
> the
> paragraph reads as if the change affected both old and new vGIC. Also I would
> mention that probably you provided the numbers based on a defconfig target.
> 
>>
>> Since the private_irqs member is now a pointer, vcpu_vgic_init() and
>> vcpu_vgic_free() are updated to allocate and free private_irqs instance.
>>
>> Suggested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
>> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Other than that:
> 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®.