[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




On 12/29/25 12:08 PM, 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.

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.

  Yes, all the numbers are provided based on defconfig target.
  I will update this paragraph in the following way to be more clear:
  As a result, the size of struct vcpu for Arm64 is reduced to 2176 bytes
  in the case when CONFIG_ARM_64=y and CONFIG_NEW_VGIC=y, 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).
  Note that all numbers are based on defconfig with the mentioned options
  enabled or disabled as specified.


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>

Thanks!

~ Oleksii




 


Rackspace

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