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

Re: [PATCH v5 1/3] xen/arm: optimize the size of struct vcpu


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Fri, 9 Jan 2026 14:15:12 +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=7u4j0eVqzsyHEcdV/QAGnaH1kJdOdx0WpRzV6JBzlow=; b=JR/0GVADUbC/EXbZCOvdY+L1Slg357sChpHkQO9Q9bPi8SW9cqRlBIsq81UoD3vk/qdARt2VKNg/oKfXKJ/hKseVgwKh42myQf8R2Vlj9rLLrz6MGZWmX8Lsrv494wklKfKeEPBdr78iBDZWIu2Nz5muVxqL39LPSXiOIslsM5I26mP+U18sUhAHUICCV8FCSus53roUH/IGLlgHsYXNswLl3M7HYhEznva6+b7Z/BB/a0n4lnmeuyiJ0dFCfODGiJ05ISQ10PFnkQRzQwINNJDe5I5r/IgGRAckxPEAwc0itAAAmuPeajWeofezhDKEs5wxvRKSBRmmwO0WLtyVig==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vOhkKfafFbPjfUszG0sXbZ6gFNyaZZxA7hsP3CQvdhj3pOiI/0pHeo4M/Sv9+Pra0Bex4QkVTzDlsQQ+kN1sW6kJsFyr3LaTNPT9gZCkCQwnZ1mn+oqUP+izjuQRde5Uj3p6jh4asaIUpUDHgijKKi3Q2B/BkLA77OVlKH+qQjQIeMQuMLjd3PHzy0VmltPUkYhKEHxixpB7vZaaBLeSesrNRWgCXS5RAHIee2QtW76BAmIjFUsWpYtzi16esH+rEYSsibE6VP28YHKO0gtzFn60tDEz9nUWFYQrywpmKa4dC11s6S7C5glD0Lb1Fa1rKNgqTpFVAMPP/5a5kOunZA==
  • 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: Fri, 09 Jan 2026 13:15:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 07/01/2026 17:28, 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, the vgic member of NEW_VGIC's
> struct vgic_cpu member private_irqs is changed to a pointer to struct
> vgic_irq.
> 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.
> 
> As struct vcpu now fits into one page, drop MAX_PAGES_PER_VCPU.
> 
> Suggested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> Michal gave his:
>   Acked-by: Michal Orzel <michal.orzel@xxxxxxx>
> But wrote to MAX_PAGES_PER_VCPU in this patch, so probably he would
> like to look at how it was done.
Looks ok, you can retain the tag.

~MichaL




 


Rackspace

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