[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 0/3] dom0less: various updates


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Wed, 29 Apr 2026 08:41:05 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=Svu0MiN1dbFWA9U1YJpZjZAl8F2imVtLTYcZjjBwVFI=; b=f4CbxJtlABdmBs0Y41It3TyMlUS3cVcOTmLIQQCJ8pPqCC9jLwZBRQoZvgK+nfvWuvtn26C6Ex6IyANySf4PxwyWzJkDH7CjZQtvMtnMcTrdq6mFY/U7j53GihI8Dq8BowKawYpVbOimtd5MHxIbZkWFHc4uTMm9hJ/Adrp+5EiWB0KDmqN9YEEf99zwn25L6rFk86QJ2tN2yNcR1C872G4nNrTw9C7mIzDvcL0L0XCgCpBkWQCXatOGOOX8PcZ78j+lLkHaEydZuYiWK24rrnC9AahZzwAun2vdqlqIVUDnQhC4lzSF/Ap0IwGdThYTj4p/GkogmlD5OQLcPYaypQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BkMX+NSrirQgoAhR1LIJ7kUqxW4w1hUcm7dEd4fFT4InzTusnXmmDAyqj8Zs3E+eDRoeCJuVscyRwXi65W/vwjPHynhLKRtX93Aqy6LtsVU1734xM7la8fGWMblin+vPGa0eOIVJtL7BMip3/cimhhI61hQmQIUaG4kdU35H/huv/Xs+ZmWkthL5yyduBOREJHDVUQJedVXhnfXgWIFlc4sNdnmfJOmkHQWE3u2/ja2LkU/50df5hw0ocBAHbgx8CkoQR+Drtsi3EsEyeJIQ/mvUksY46wpuJzpYyLNHZWgGhtoN7pmoDXdmlPZ9mSwO9rm47wQ+CweijJgNy6n9gw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Romain Caritey <Romain.Caritey@xxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 29 Apr 2026 06:41:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

I committed the first two patches. I decided to wait with the third patch for
Jan as he was the one with the most remarks.

~Michal

On 27-Apr-26 17:34, Oleksii Kurochko wrote:
> This patch series introduces a new field to track not-yet-used phandles as 
> there
> are some use cases where RISC-V needs to know which phandle number could
> be used for generating a device tree node.
> 
> For example, on the RISC-V side in make_cpus_node() [1] it is necessary to 
> know
> which phandle number is unused to use it for device tree node generation.
> 
> Here is an example of generated guest DTB:
>     cpus {
>     ...
>       cpu@0 {
>     ...
>         interrupt-controller {
>           compatible = "riscv,cpu-intc";
>           #interrupt-cells = <0x1>;
>           interrupt-controller;
>           phandle = <0xfdea>;
>         };
>       };
>     };
> 
>     /soc/imsics@28000000 {
> 
>       interrupts-extended = <0xfdea 0x9 >;
> 
>       phandle = <0xfdeb>;
>     };
> 
>     /soc/aplic@d000000 {
>     ...
>       msi-parent = <0xfdeb>;
>       phandle = <0x1>;
>     };
> 
> Note that phandles for imsic and riscv,cpu-intc are generated in this example
> not by get_next_free_phandle(), that is why they have such big numbers.
> 
> For non-RISC-V people, APLIC is an interrupt controller (something like GIC in
> Arm), IMSIC is an interrupt controller that provides MSI and connects to
> each CPU.
> 
> So (based on the DTS above) for APLIC, kinfo->phandle_intc is reused, which
> will also be re-used for the device node's interrupt property. For all 
> others, I
> just introduced GUEST_PHANDLE_LAST [2] and used it for generation [3]. But I 
> expect
> that it could be useful for other architectures too so I just moved it to 
> common
> and re-use pfdt to understand what the maximum used phandle is.
> 
> [1] 
> https://www.kernel.org/doc/Documentation/devicetree/bindings/interrupt-controller/riscv%2Ccpu-intc.txt
> [2] 
> https://lore.kernel.org/xen-devel/ccd6d21b224b478c88ca5f2fdd2d1dd507671510.1773157782.git.oleksii.kurochko@xxxxxxxxx/
> [3] 
> https://lore.kernel.org/xen-devel/fd64b8526a23e9d7775b9b48c5a933b0673c4fba.1773157782.git.oleksii.kurochko@xxxxxxxxx/
>            *************************************
> 
> Another thing introduced in this patch series is moving domain type to common
> code as several architectures (ARM and RISC-V for now) use them and it
> looks pretty architecture-independent. Also, is_64bit_domain() is used by
> dom0less common code, so I found it useful also to move is_{32,64}bit_domain
> macros to common code.
> 
>            *************************************
> 
> And the last thing is changing the prototype of make_cpus_node() to be aligned
> with other make_*_node() and since RISC-V will need access to the 
> free_phandle field
> (even if it will be moved to kinfo->arch.free_phandle) and for the reason that
> this ->free_phandle is updated in make_*_node(), the kinfo argument is passed 
> as
> non-const.
> 
> CI: https://gitlab.com/xen-project/people/olkur/xen/-/pipelines/2482499536
> 
> ---
> Changes in v4:
>  - Rebase on top of staging.
>  - Add Review-by for patch 1 and 3.
>  - Address the comments.
> ---
> Changes in v3:
>  - Rebase on top of staging.
>  - Address the comments.
> ---
> Changes in v2:
>  - Address the comments from ML.
> ---
> 
> Oleksii Kurochko (3):
>   xen/dom0less: introduce next_phandle in struct kernel_info
>   xen/dom0less: pass kernel_info struct instead of fdt to
>     make_cpus_node()
>   xen: introduce CONFIG_HAS_DOMAIN_TYPE
> 
>  xen/arch/arm/Kconfig                    |  1 +
>  xen/arch/arm/arm64/domctl.c             |  4 +--
>  xen/arch/arm/dom0less-build.c           | 14 --------
>  xen/arch/arm/domain_build.c             | 17 +++++-----
>  xen/arch/arm/include/asm/domain.h       | 16 ---------
>  xen/arch/arm/include/asm/kernel.h       |  4 ---
>  xen/arch/arm/kernel.c                   | 16 ++++-----
>  xen/common/Kconfig                      |  3 ++
>  xen/common/device-tree/dom0less-build.c | 45 ++++++++++++++++++-------
>  xen/include/xen/dom0less-build.h        |  2 --
>  xen/include/xen/domain.h                | 13 +++++++
>  xen/include/xen/fdt-domain-build.h      | 17 +++++++++-
>  xen/include/xen/fdt-kernel.h            | 11 ++++++
>  xen/include/xen/sched.h                 |  4 +++
>  14 files changed, 98 insertions(+), 69 deletions(-)
> 




 


Rackspace

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