All of lore.kernel.org
 help / color / mirror / Atom feed
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Grygorii Strashko <grygorii_strashko@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v2 1/4] xen/arm: split set_domain_type() between arm64/arm32
Date: Wed, 27 Aug 2025 00:22:05 +0000	[thread overview]
Message-ID: <87bjo13976.fsf@epam.com> (raw)
In-Reply-To: <20250806094929.293658-2-grygorii_strashko@epam.com> (Grygorii Strashko's message of "Wed, 6 Aug 2025 09:49:42 +0000")

Hi,

Grygorii Strashko <grygorii_strashko@epam.com> writes:

> From: Grygorii Strashko <grygorii_strashko@epam.com>
>
> Split set_domain_type() between Arm64/Arm32 sub-arches as
> set_domain_type() implementation is going to be extended for Arm64.
>
> Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
> ---
> v2:
> - no changes, rebase
>
>  xen/arch/arm/arm32/Makefile       |  1 +
>  xen/arch/arm/arm32/domain-build.c | 22 ++++++++++++++++++++++
>  xen/arch/arm/arm64/Makefile       |  1 +
>  xen/arch/arm/arm64/domain-build.c | 24 ++++++++++++++++++++++++
>  xen/arch/arm/dom0less-build.c     | 14 --------------
>  xen/include/xen/dom0less-build.h  |  8 ++++++++
>  6 files changed, 56 insertions(+), 14 deletions(-)
>  create mode 100644 xen/arch/arm/arm32/domain-build.c
>  create mode 100644 xen/arch/arm/arm64/domain-build.c

Is it really worth to create two more source files just for one
function? Maybe it is better to use already existing
xen/arch/arm/arm*/domain.c ?

>
> diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile
> index 531168f58a0a..0fd3f5272361 100644
> --- a/xen/arch/arm/arm32/Makefile
> +++ b/xen/arch/arm/arm32/Makefile
> @@ -6,6 +6,7 @@ obj-y += cache.o
>  obj-$(CONFIG_EARLY_PRINTK) += debug.o
>  obj-y += domctl.o
>  obj-y += domain.o
> +obj-y += domain-build.o
>  obj-y += entry.o
>  obj-y += head.o
>  obj-y += insn.o
> diff --git a/xen/arch/arm/arm32/domain-build.c b/xen/arch/arm/arm32/domain-build.c
> new file mode 100644
> index 000000000000..e34261e4a2ad
> --- /dev/null
> +++ b/xen/arch/arm/arm32/domain-build.c
> @@ -0,0 +1,22 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#include <xen/fdt-kernel.h>
> +#include <xen/sched.h>
> +
> +#include <asm/domain.h>
> +
> +#ifdef CONFIG_DOM0LESS_BOOT
> +void __init set_domain_type(struct domain *d, struct kernel_info *kinfo)
> +{
> +    /* Nothing to do */
> +}
> +#endif
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
> index 6491c5350b2e..3272fe7e4ca2 100644
> --- a/xen/arch/arm/arm64/Makefile
> +++ b/xen/arch/arm/arm64/Makefile
> @@ -8,6 +8,7 @@ obj-$(CONFIG_HARDEN_BRANCH_PREDICTOR) += bpi.o
>  obj-$(CONFIG_EARLY_PRINTK) += debug.o
>  obj-y += domctl.o
>  obj-y += domain.o
> +obj-y += domain-build.o
>  obj-y += entry.o
>  obj-y += head.o
>  obj-y += insn.o
> diff --git a/xen/arch/arm/arm64/domain-build.c b/xen/arch/arm/arm64/domain-build.c
> new file mode 100644
> index 000000000000..3a89ee46b8c6
> --- /dev/null
> +++ b/xen/arch/arm/arm64/domain-build.c
> @@ -0,0 +1,24 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#include <xen/fdt-kernel.h>
> +#include <xen/sched.h>
> +
> +#include <asm/domain.h>
> +
> +#ifdef CONFIG_DOM0LESS_BOOT
> +/* TODO: make arch.type generic ? */
> +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;
> +}
> +#endif
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
> index c8d07213e247..58f77628df1f 100644
> --- a/xen/arch/arm/dom0less-build.c
> +++ b/xen/arch/arm/dom0less-build.c
> @@ -236,20 +236,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/include/xen/dom0less-build.h b/xen/include/xen/dom0less-build.h
> index 408859e3255a..3e81d8ba3a47 100644
> --- a/xen/include/xen/dom0less-build.h
> +++ b/xen/include/xen/dom0less-build.h
> @@ -57,6 +57,14 @@ int init_vuart(struct domain *d, struct kernel_info *kinfo,
>  int make_intc_domU_node(struct kernel_info *kinfo);
>  int make_arch_nodes(struct kernel_info *kinfo);
>  
> +/*
> + * Set domain type from struct kernel_info which defines guest Execution
> + * State 32-bit/64-bit (for Arm AArch32/AArch64).
> + * The domain type must be set before allocate_memory.
> + *
> + * @d: pointer to the domain structure.
> + * @kinfo: pointer to the kinfo structure.
> + */
>  void set_domain_type(struct domain *d, struct kernel_info *kinfo);
>  
>  int init_intc_phandle(struct kernel_info *kinfo, const char *name,

-- 
WBR, Volodymyr

  reply	other threads:[~2025-08-27  0:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06  9:49 [PATCH v2 0/4] xen/arm64: allow to make aarch32 support optional Grygorii Strashko
2025-08-06  9:49 ` [PATCH v2 1/4] xen/arm: split set_domain_type() between arm64/arm32 Grygorii Strashko
2025-08-27  0:22   ` Volodymyr Babchuk [this message]
2025-09-04 20:09     ` Grygorii Strashko
2025-09-05 12:10       ` Volodymyr Babchuk
2025-08-06  9:49 ` [PATCH v2 2/4] xen/arm: split is_32bit/64bit_domain() " Grygorii Strashko
2025-08-27  0:23   ` Volodymyr Babchuk
2025-08-06  9:49 ` [PATCH v2 4/4] xen/arm64: constify is_32/64bit_domain() macro for CONFIG_ARM64_AARCH32=n Grygorii Strashko
2025-08-27  0:19   ` Volodymyr Babchuk
2025-08-06  9:49 ` [PATCH v2 3/4] xen/arm64: allow to make aarch32 support optional Grygorii Strashko
2025-08-27  0:16   ` Volodymyr Babchuk
2025-09-04 20:09     ` Grygorii Strashko
2025-09-05 12:15       ` Volodymyr Babchuk
2025-09-05 13:07         ` Julien Grall
2025-09-05 18:30           ` Grygorii Strashko
2025-09-05  3:43   ` Demi Marie Obenour
2025-09-05  9:35     ` Grygorii Strashko
2025-09-05  7:04   ` Julien Grall
2025-09-05  9:34     ` Grygorii Strashko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bjo13976.fsf@epam.com \
    --to=volodymyr_babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=bertrand.marquis@arm.com \
    --cc=grygorii_strashko@epam.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.