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 <[email protected]>
Reviewed-by: Andrew Cooper <[email protected]> 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).
