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>
Subject: Re: [PATCH v2 2/4] xen/arm: split is_32bit/64bit_domain() between arm64/arm32
Date: Wed, 27 Aug 2025 00:23:13 +0000 [thread overview]
Message-ID: <875xe9395b.fsf@epam.com> (raw)
In-Reply-To: <20250806094929.293658-3-grygorii_strashko@epam.com> (Grygorii Strashko's message of "Wed, 6 Aug 2025 09:49:42 +0000")
Grygorii Strashko <grygorii_strashko@epam.com> writes:
> From: Grygorii Strashko <grygorii_strashko@epam.com>
>
> Split is_32bit/64bit_domain() macro implementations between arm64/arm32.
>
> Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> ---
> v2:
> - fix comments related to macro parameters evaluation issues
>
> xen/arch/arm/include/asm/arm32/domain.h | 20 +++++++++++++++++
> xen/arch/arm/include/asm/arm64/domain.h | 29 +++++++++++++++++++++++++
> xen/arch/arm/include/asm/domain.h | 7 +++---
> 3 files changed, 52 insertions(+), 4 deletions(-)
> create mode 100644 xen/arch/arm/include/asm/arm32/domain.h
> create mode 100644 xen/arch/arm/include/asm/arm64/domain.h
>
> diff --git a/xen/arch/arm/include/asm/arm32/domain.h b/xen/arch/arm/include/asm/arm32/domain.h
> new file mode 100644
> index 000000000000..1bd0735c9194
> --- /dev/null
> +++ b/xen/arch/arm/include/asm/arm32/domain.h
> @@ -0,0 +1,20 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef ARM_ARM32_DOMAIN_H
> +#define ARM_ARM32_DOMAIN_H
> +
> +/* Arm32 always runs guests in AArch32 mode */
> +
> +#define is_32bit_domain(d) ((void)(d), 1)
> +#define is_64bit_domain(d) ((void)(d), 0)
> +
> +#endif /* ARM_ARM32_DOMAIN_H */
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> diff --git a/xen/arch/arm/include/asm/arm64/domain.h b/xen/arch/arm/include/asm/arm64/domain.h
> new file mode 100644
> index 000000000000..1a2d73950bf0
> --- /dev/null
> +++ b/xen/arch/arm/include/asm/arm64/domain.h
> @@ -0,0 +1,29 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef ARM_ARM64_DOMAIN_H
> +#define ARM_ARM64_DOMAIN_H
> +
> +/*
> + * Returns true if guest execution state is AArch32
> + *
> + * @d: pointer to the domain structure
> + */
> +#define is_32bit_domain(d) ((d)->arch.type == DOMAIN_32BIT)
> +
> +/*
> + * Returns true if guest execution state is AArch64
> + *
> + * @d: pointer to the domain structure
> + */
> +#define is_64bit_domain(d) ((d)->arch.type == DOMAIN_64BIT)
> +
> +#endif /* ARM_ARM64_DOMAIN_H */
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
> index a3487ca71303..dde48178b857 100644
> --- a/xen/arch/arm/include/asm/domain.h
> +++ b/xen/arch/arm/include/asm/domain.h
> @@ -22,11 +22,10 @@ enum domain_type {
> DOMAIN_32BIT,
> DOMAIN_64BIT,
> };
> -#define is_32bit_domain(d) ((d)->arch.type == DOMAIN_32BIT)
> -#define is_64bit_domain(d) ((d)->arch.type == DOMAIN_64BIT)
> +
> +# include <asm/arm64/domain.h>
> #else
> -#define is_32bit_domain(d) (1)
> -#define is_64bit_domain(d) (0)
> +# include <asm/arm32/domain.h>
> #endif
>
> /*
--
WBR, Volodymyr
next prev parent reply other threads:[~2025-08-27 0:23 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
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 [this message]
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=875xe9395b.fsf@epam.com \
--to=volodymyr_babchuk@epam.com \
--cc=bertrand.marquis@arm.com \
--cc=grygorii_strashko@epam.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.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.