From: Jan Beulich <jbeulich@suse.com>
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: "Romain Caritey" <Romain.Caritey@microchip.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Michal Orzel" <michal.orzel@amd.com>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Roger Pau Monné" <roger.pau@citrix.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 3/3] xen: introduce CONFIG_HAS_DOMAIN_TYPE
Date: Mon, 4 May 2026 14:21:57 +0200 [thread overview]
Message-ID: <5daeb8f7-cf0f-4ea7-a686-93df36b43a30@suse.com> (raw)
In-Reply-To: <7c91e1a705e1046be4af1c5671a8d91cf3557013.1777296786.git.oleksii.kurochko@gmail.com>
On 27.04.2026 17:34, 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.
>
> Change the guard around access of kinfo->type to CONFIG_HAS_DOMAIN_TYPE
> for consistency. Also, drop and add some parentheses to be aligned
> with the similar if() below.
>
> x86 with CONFIG_64BIT=y shouldn't use is_{32,64}bit_domain() as
> x86 doesn't have support of CONFIG_HAS_DOMAIN_TYPE. Since x86_32 Xen no
> longer builds, the fallback is currently only relevant for arm32.
>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>
In principle:
Acked-by: Jan Beulich <jbeulich@suse.com>
However, still a few remarks:
> --- a/xen/include/xen/domain.h
> +++ b/xen/include/xen/domain.h
> @@ -13,6 +13,19 @@ struct guest_area {
> void *map;
> };
>
> +#ifdef CONFIG_HAS_DOMAIN_TYPE
> +enum __packed domain_type {
> + DOMAIN_32BIT,
> + DOMAIN_64BIT,
> +};
> +#define is_32bit_domain(d) ((d)->type == DOMAIN_32BIT)
> +#define is_64bit_domain(d) ((d)->type == DOMAIN_64BIT)
> +#elif !defined(CONFIG_64BIT)
> +/* At the moment on 32-bit-only platforms all domains are 32-bit. */
> +#define is_32bit_domain(d) (true)
> +#define is_64bit_domain(d) (false)
I think it would be nice if the excess parentheses were dropped from here.
> --- a/xen/include/xen/fdt-domain-build.h
> +++ b/xen/include/xen/fdt-domain-build.h
> @@ -7,6 +7,7 @@
> #include <xen/device_tree.h>
> #include <xen/fdt-kernel.h>
> #include <xen/mm.h>
> +#include <xen/sched.h>
> #include <xen/types.h>
>
> struct domain;
> @@ -69,6 +70,14 @@ static inline uint32_t alloc_phandle(struct kernel_info *kinfo)
> return kinfo->next_phandle >= GUEST_PHANDLE_GIC ? 0 : kinfo->next_phandle++;
> }
>
> +static inline void set_domain_type(struct domain *d, struct kernel_info *kinfo)
Pointer-to-const for the 2nd parameter?
> +{
> +#ifdef CONFIG_HAS_DOMAIN_TYPE
> + /* Type must be set before allocate memory */
This comment would be more prominent if it lived outside of the #ifdef,
perhaps (read on) ahead of the function. I wonder though why it's only
a comment, and not e.g. an assertion. If an assertion was possible to
add, the comment would want to live next to it. Without an assertion
putting it ahead of the function may be better.
Depending on how far to go, changes could be made while committing, or a
proper v5 may want submitting.
Jan
next prev parent reply other threads:[~2026-05-04 12:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 15:34 [PATCH v4 0/3] dom0less: various updates Oleksii Kurochko
2026-04-27 15:34 ` [PATCH v4 1/3] xen/dom0less: introduce next_phandle in struct kernel_info Oleksii Kurochko
2026-04-27 15:34 ` [PATCH v4 2/3] xen/dom0less: pass kernel_info struct instead of fdt to make_cpus_node() Oleksii Kurochko
2026-04-27 15:34 ` [PATCH v4 3/3] xen: introduce CONFIG_HAS_DOMAIN_TYPE Oleksii Kurochko
2026-05-04 12:21 ` Jan Beulich [this message]
2026-05-06 7:44 ` Oleksii Kurochko
2026-05-06 8:10 ` Jan Beulich
2026-05-06 8:59 ` Oleksii Kurochko
2026-05-07 6:48 ` Orzel, Michal
2026-04-29 6:41 ` [PATCH v4 0/3] dom0less: various updates Orzel, Michal
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=5daeb8f7-cf0f-4ea7-a686-93df36b43a30@suse.com \
--to=jbeulich@suse.com \
--cc=Romain.Caritey@microchip.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bertrand.marquis@arm.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=oleksii.kurochko@gmail.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.