[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [XEN][PATCH 0/7] xen/arm: rework to probe kernel before creating domains during xen boot
From: Grygorii Strashko <grygorii_strashko@xxxxxxxx> This series follows discussion [1][2] which pointed to "historical" issue present in Xen and related to creating domains on 64bit Arches which allows running both 64/32bit guests (like Arm AArch64): Now, during Xen boot or by toolstack, the domain is always created before knowing the guest type (32/64bit). For example, on ARM64 during Xen boot: - dom0 is created with default type 32bit - vcpu[0] is created - kernel binary probed and guest type is determined (for example 64bit) - dom0 type changed according to guest type causing vcpu[0] reconfiguration (with restriction applied that domain type have to be properly set before allocating domain'a memory) The same domain creation sequence executed for dom0less boot and for creating domains by toolstack (The toolstack uses XEN_DOMCTL_set_address_size hypercall to reconfigure domain type). As indicated by Julien Grall and Andrew Cooper, above domain creation sequence is not robust and fragile, so it was proposed to introduce extra flags to XEN_DOMCTL_createdomain to allow configuring domain type properly at domain creation time and perform further rework of domain creation sequence to probe guest type before creating domain. Hence, this series: - 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 form 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 type AArch64 and then switch to requested domain type and ensures all required domain settings applied. For Arm32 this flag is ignored. - dom0 setup sequence reworked to probe kernel before creating domain - dom0less domains setup sequence reworked to probe kernel before creating domains Xen toolstack is not changed as part of this series and it expected to be reworked further to follow the same approach to probe guest binary before creating domain. Tested (Arm64): - dom0 a32/a64 boot - dom0less a32/a64 domU boot - toolstack create a32/a64 [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 Alejandro Vallejo (1): dom0less: Parse memory properties in the common bindings Grygorii Strashko (6): xen/arm64: domctl: set_address_size add check for vcpus not initialized xen/domctl: introduce XEN_DOMCTL_CDF_is_32bits xen/fdt: kernel: add generic is_32bit_type flag to struct kernel_info xen/arm: probe kernel before creating dom0 dom0less: probe kernel before creating domains xen/dt: kernel: add assert(!domain) in kernel_probe xen/arch/arm/arm64/domctl.c | 28 ++++++++++++--- xen/arch/arm/dom0less-build.c | 2 +- xen/arch/arm/domain.c | 10 +++++- xen/arch/arm/domain_build.c | 40 ++++++++++++---------- xen/arch/arm/include/asm/kernel.h | 7 +--- xen/arch/arm/kernel.c | 10 +++--- xen/common/device-tree/dom0less-bindings.c | 3 ++ xen/common/device-tree/dom0less-build.c | 28 +++++++-------- xen/common/device-tree/kernel.c | 12 ++++--- xen/common/domain.c | 3 +- xen/include/public/domctl.h | 7 +++- xen/include/xen/bootfdt.h | 2 ++ xen/include/xen/fdt-kernel.h | 3 ++ 13 files changed, 97 insertions(+), 58 deletions(-) -- 2.34.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |