[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


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Thu, 31 Jul 2025 09:42:36 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=LJGNO244xmbvCg8mFJ8B/E0SmsrA4Ra8FtaUDi5cEdw=; b=nCT42uCXWB/MJ2IS70yDEBVhUAPqaRAyAobSt2s8Mb9hjQMXwQucEdLLOCI3Kh5x30F96xII/vVBLEkTbNbu4CnaOqUdlkg1eMHDPsgHkRjPnOR/kP6wjtEdrJJRLIoIOhA5bJO7+DF2rYc9ye19u0dxC3Uksv4hy0YRxxELUu5nXJQGT1L6XcHJTii8OqUKI/YLORqENiQi+XyXqvYfLyU2Cpxbg/mTZ0gUwbmkppQaKsOms/GuEFNU96cZas5AIXHHrihHXMaymbi218DO+e7H7Ler3rc3ViMB3/sclBsOoh1cDtknlHAQPinTuc/aZ0FxTnJsXzd2DsV09xeJyw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EGm07XnXkTjcI1LtJHD7T0XouT1FfpVlP+1ltgRrTKSmjHmJz/ukXt6gMbkyfIGYLxqdwUH9Ea//IRMAbbGkn+23U87w1Cqk3EI9ycMuQSvZusSM87r8JGO+xun+v2V5gxBFMvnNXyzDHl55Ciwe7VXbmmr9D/hZNM3D82tWdh65j/5IyFRPlyPzwUejJBVr8wULJ7jiss+CRcMdrHxMX89KskBM5nb8Qs/EBagWJO5COUhGGDc3tgu3QLMvDyDaldWJvA/Adz3dtU9QhmeUKKmFjWllDLa1RVfXLD9XPJ5ZIexBTq0j6MldinoCSYULUD7SnE/isrW/a8fvV0oc/Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, 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>
  • Delivery-date: Thu, 31 Jul 2025 09:42:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcAf9y7RxsIYyypkiwAYTFDxXPeg==
  • Thread-topic: [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



 


Rackspace

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