|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v1 3/3] xen: introduce CONFIG_HAS_DOMAIN_TYPE
On 16/04/2026 16:21, Oleksii Kurochko wrote:
> As domain type is part of common code now there is no any reason
> to have architecture-specific set_domain_type() functions so
> it is dropped.
>
> The CONFIG_ARM_64 guard in xen/arch/arm/domain_build.c is intentionally
> left unchanged: it is ARM-specific code, and ARM_64 selects
> HAS_DOMAIN_TYPE, so the semantics are identical.
>
> x86 with CONFIG_64BIT=y shouldn't use is_{32,64}bit_domain() as
> x86 doesn't have support of CONFIG_HAS_DOMAIN_TYPE. For x86_32
> it is fine to follow generic is_{32,64}_bit_domain() implementations.
I thought x86_32 Xen no longer builds. This means the fallback is only for
arm32.
>
> Generally it probably would be better to introduce CONFIG_32BIT
> and use it to define is_{32,64}bit_domain() as if one day
> CONFIG_128BIT will be introduced is_{32,64}bit_domain() will be
> defined incorrectly but considering that CONFIG_64BIT is maximum
> supported bitness it is fine to define in this way.
>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
> ---
> xen/arch/Kconfig | 3 +++
> 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 | 8 ++++----
> xen/arch/arm/include/asm/domain.h | 12 ------------
> xen/arch/arm/include/asm/kernel.h | 4 ----
> xen/arch/arm/kernel.c | 10 +++++-----
> xen/common/device-tree/dom0less-build.c | 5 ++++-
> xen/include/xen/dom0less-build.h | 2 --
> xen/include/xen/domain.h | 13 +++++++++++++
> xen/include/xen/fdt-kernel.h | 5 +++++
> xen/include/xen/sched.h | 4 ++++
> 13 files changed, 41 insertions(+), 44 deletions(-)
>
> diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig
> index f9230bfaf872..6c53149f7ee1 100644
> --- a/xen/arch/Kconfig
> +++ b/xen/arch/Kconfig
> @@ -1,6 +1,9 @@
> config 64BIT
> bool
>
> +config HAS_DOMAIN_TYPE
> + bool
> +
> config PHYS_ADDR_T_32
> bool
>
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index 2f2b501fdac4..79622b46a10d 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -7,6 +7,7 @@ config ARM_64
> def_bool y
> depends on !ARM_32
> select 64BIT
> + select HAS_DOMAIN_TYPE
> select HAS_FAST_MULTIPLY
> select HAS_VPCI_GUEST_SUPPORT if PCI_PASSTHROUGH
>
> diff --git a/xen/arch/arm/arm64/domctl.c b/xen/arch/arm/arm64/domctl.c
> index 8720d126c97d..9e9a29eb1e78 100644
> --- a/xen/arch/arm/arm64/domctl.c
> +++ b/xen/arch/arm/arm64/domctl.c
> @@ -21,10 +21,10 @@ static long switch_mode(struct domain *d, enum
> domain_type type)
> return -EINVAL;
> if ( domain_tot_pages(d) != 0 )
> return -EBUSY;
> - if ( d->arch.type == type )
> + if ( d->type == type )
> return 0;
>
> - d->arch.type = type;
> + d->type = type;
>
> if ( is_64bit_domain(d) )
> for_each_vcpu(d, v)
> diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
> index 4181c105389a..6f73c65e5151 100644
> --- a/xen/arch/arm/dom0less-build.c
> +++ b/xen/arch/arm/dom0less-build.c
> @@ -237,20 +237,6 @@ int __init make_arch_nodes(struct kernel_info *kinfo)
> return 0;
> }
>
> -/* TODO: make arch.type generic ? */
> -#ifdef CONFIG_ARM_64
> -void __init set_domain_type(struct domain *d, struct kernel_info *kinfo)
> -{
> - /* type must be set before allocate memory */
> - d->arch.type = kinfo->arch.type;
> -}
> -#else
> -void __init set_domain_type(struct domain *d, struct kernel_info *kinfo)
> -{
> - /* Nothing to do */
> -}
> -#endif
> -
> int __init init_vuart(struct domain *d, struct kernel_info *kinfo,
> const struct dt_device_node *node)
> {
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 6740da3d324b..2fd89b3a1345 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1178,7 +1178,7 @@ int __init make_cpus_node(const struct domain *d,
> struct kernel_info *kinfo)
> /* Keep the compiler happy with -Og */
> bool clock_valid = false;
> uint64_t mpidr_aff;
> - void *fdt = kinfo;
> + void *fdt = kinfo->fdt;
Here you are fixing a regression introduced in patch 2/3.
I'm ok with this patch. but since you touch common code too you need to wait for
other's opinion. For now, provided you fix the commit msg and regression remark:
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
~Michal
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |