|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 23/23] xen/riscv: add initial dom0less infrastructure support
On 17.06.2026 13:17, Oleksii Kurochko wrote:
> Enable dom0less support for RISC-V by selecting HAS_DOM0LESS and
> providing the minimal architecture hooks required by the common
> dom0less infrastructure.
>
> Add stub implementations for architecture-specific helpers used when
> building domains from the device tree. These currently perform no
> additional work but allow the generic dom0less code to build and run
> on RISC-V.
>
> Introduce max_init_domid as a runtime variable rather than a constant
> so that it can be updated during dom0less domain creation.
>
> Provide missing helpers and definitions required by the domain
> construction code, including domain bitness helpers and the
> p2m_set_allocation() prototype.
>
> Additionally define the guest magic memory region in the public
> RISC-V interface. GUEST_MAGIC_BASE is placed at 0x79000000 to avoid
> overlapping with the QEMU RISC-V virt machine address space.
No qemu comes into play so far (and likely such also isn't planned).
Then why would such an overlap be problematic? Plus as before, the
constraints on such arbitrarily chosen numbers want putting down in
a code comment next to the respective #define-s.
> --- a/xen/arch/riscv/domain-build.c
> +++ b/xen/arch/riscv/domain-build.c
> @@ -156,9 +156,22 @@ int __init make_cpus_node(const struct domain *d, struct
> kernel_info *kinfo)
> return fdt_end_node(fdt);
> }
>
> +int __init construct_hwdom(struct kernel_info *kinfo,
> + const struct dt_device_node *node)
> +{
> + return -EOPNOTSUPP;
> +}
> +
> int __init make_timer_node(const struct kernel_info *kinfo)
> {
> /* There is no need for timer node for RISC-V. */
>
> return 0;
> }
> +
> +int __init make_hypervisor_node(struct domain *d,
> + const struct kernel_info *kinfo,
> + int addrcells, int sizecells)
> +{
> + return -EOPNOTSUPP;
> +}
In the description you say "to build and run". How come "run" is actually
true when these two new stubs return an error? For construct_hwdom() this
may be explained by you not aiming at supporting Dom0 / hwdom (but that
then still is a limitation to mention, perhaps in a TODO comment), but
with DOM0LESS_ENHANCED_NO_XS set make_hypervisor_node() failing is going
to break DomU building as well, afaics.
> --- a/xen/arch/riscv/include/asm/setup.h
> +++ b/xen/arch/riscv/include/asm/setup.h
> @@ -5,7 +5,9 @@
>
> #include <xen/types.h>
>
> -#define max_init_domid (0)
> +#include <public/xen.h>
> +
> +extern domid_t max_init_domid;
Shouldn't this be generalized, seeing that dom0less code requires it this
way on every arch? Same ...
> --- a/xen/arch/riscv/setup.c
> +++ b/xen/arch/riscv/setup.c
> @@ -33,6 +33,8 @@
> #include <asm/traps.h>
> #include <asm/vsbi.h>
>
> +domid_t __initdata max_init_domid;
... for the placement of this then, obviously.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |