[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN][PATCH 2/7] xen/domctl: introduce XEN_DOMCTL_CDF_is_32bits
On 31.07.25 18:19, Julien Grall wrote: Hi Teddy, On 31/07/2025 15:02, Teddy Astie wrote:Hello, Le 31/07/2025 à 11:44, Grygorii Strashko a écrit :Hence, this patch introduces extra "XEN_DOMCTL_CDF_is_32bits" flag which is intended to be used by 64bit Arches for proper configuration of domain type when domain is created. Now it adds initial support for this flag for Arm64 arch only. The default Arm64 domain type is changed to 64bit: - the Arm Xen boot code is handling this case properly already; - for toolstack case the XEN_DOMCTL_set_address_size hypercall handling updated to forcibly configure domain type regardless of current domain type configuration. Hence toolstack configures vcpus and memory after configuring domain type it allows to start with domain default AArch64 type and then switch to requested domain type and ensures all required domain settings applied. For Arm32 this flag is ignored. Note. For Arm64, Once toolstack is updated to probe guest binary before creating domain the XEN_DOMCTL_set_address_size will become obsolete. [1] https://lists.xen.org/archives/html/xen-devel/2025-07/msg01647.html [2] https://lists.xen.org/archives/html/xen-devel/2025-07/msg01648.html Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx> ---I would prefer it be better presented as a platform-specific enum. Something like ``` enum xen_arch_subarch {We need to be cautious when using enum in the public interface because, if I am not mistaken, the size of the enum if not stable.XEN_ARM_SUBARCH_NATIVE = 0,"native" is a bit ambiguous when a platform is able to support 32-bit and 64-bit. Does this refer to the bitness of the hypervisor (EL2)? Firmware (EL3)? That said, I am not entirely sure I see the value of native because EL1 (the kernel exception level) has to be known at boot. So it is better to explicitly mention whether the kernel is 32-bit or 64-bit.XEN_ARM_SUBARCH_ARMV7 = 1,This name would not be correct. You can have a 32-bit Armv8 guest. A better name is SUBARCH_AARCH32.XEN_ARM_SUBARCH_AARCH64 = 2, I've been thinking how about using ELF "e_machine" to identify guest? It defines all arch ids already (no need to invent anything custom), plus supports EM_NONE which can be treated as default value or indicate that guest type is not set - arch specific handling. config/domain structs: uint16_t e_machine; Arch code can define and check number of supported ids, for example: arm: EM_NONE, EM_ARM (32bit), EM_AARCH64 (64bit) x86: EM_NONE [, EM_386 (32bit), EM_X86_64 (64bit) ] -- Best regards, -grygorii
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |