[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 3/4] xen: move alloc/free_vcpu_struct() to common code
- To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Tue, 23 Dec 2025 12:41:18 +0000
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=O650c9BC/H70OOHHoYAtvyDGLtk5I6CFDLKt+5L+XpM=; b=eLR168EADmd22oIrFeirqFBaTu/JwmGlawz9rKFfnIYAuuynJjY/xnlmU/B0G2z3Cu+3jIbsiRbFFw6054dOTWYZTb7kezwB5GD6cFe6sgL9eYznhtbS4UQod0uuJeyCigeV995qcWgJxRBw7ysHnRnaSNyzLQU2e2a+bglZqfgUQu5PFgoXKhQFogXLGx5DdvEOcgf+B9mc0w+vLyi0hUgNjGYx8ls8rWOlfQ/JvPc7ZtS4yDX1TLax28c21tc4YEUTluy+0oB/GXaQGn0cXKoQFXaGIF1H3zJhZVoPs16ycscfmofsl4hpxbxWnuX66qPO3DTcNrwpjcMrPGSX6w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ba+RymIu72/q6FRQAY3XyT2TxCRjxnoIIPyxWgit5i2AHNZLdeZbItptGvSPXAwDevNFKKECflmx0gCEz7zWuxvUAkat0tQiT5Bl439tdt+u0k+SBSIpwWJLSKN+bQQ8HCojGX61ggVtQ0y++b7LLZJvhvi8wucpiUba7PqDs9qu8m06LNiPYJbNJzHwLMYo/8FunUl2q/RvaQ+o55yIFXjv0iMztejwuBzAO5/5uzwhSsopriu7JiRwLPVkMgTjyCuYcUMJDvkFQO6RgqSJsAcUf5xIJcvRt7ilBI0ntxWL+0kD5yIhBgpjRct3b3atNJQlQZ2eZEgLu5g3rl/W1A==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>
- Delivery-date: Tue, 23 Dec 2025 12:41:29 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 22/12/2025 4:40 pm, Oleksii Kurochko wrote:
> alloc_vcpu_struct() and free_vcpu_struct() contain little
> architecture-specific logic and are suitable for sharing across
> architectures. Move both helpers to common code.
>
> To support the remaining architectural differences, introduce
> arch_vcpu_struct_memflags(), allowing architectures to override the
> memory flags passed to alloc_xenheap_pages(). This is currently needed
> by x86, which may require MEMF_bits(32) for HVM guests using shadow
> paging.
>
> The ARM implementation of alloc/free_vcpu_struct() is removed and
> replaced by the common version. Stub implementations are also dropped
> from PPC and RISC-V.
>
> Now that the size of struct vcpu for Arm64 is smaller than PAGE_SIZE,
> MAX_PAGES_PER_VCPU is no longer needed and is removed.
>
> Finally, make alloc_vcpu_struct() and free_vcpu_struct() static to
> common/domain.c, as they are no longer used outside common code.
>
> No functional changes.
>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> with the
repositioning as per Jan's request.
I've found one error in the comment block, but I'll submit a fix for
that separately (so as not to mix it with code movement).
|