All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
To: Grygorii Strashko <grygorii_strashko@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien@xen.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>
Subject: Re: [XEN][PATCH 1/7] xen/arm64: domctl: set_address_size add check for vcpus not initialized
Date: Thu, 31 Jul 2025 15:09:50 +0200	[thread overview]
Message-ID: <DBQ9JRMYP231.2OVN6KC0QPG0U@amd.com> (raw)
In-Reply-To: <20250731094234.996684-2-grygorii_strashko@epam.com>

On Thu Jul 31, 2025 at 11:42 AM CEST, Grygorii Strashko wrote:
> From: Grygorii Strashko <grygorii_strashko@epam.com>
>
> The vcpu ctx initialization (arch_set_info_guest()) is depends on proper
                                                       ^
                                                   stray "is"

> domain type (32/64bit) configuration, so check that vcpus are not
> initialized when toolstack issues XEN_DOMCTL_set_address_size hypercall.
>
> Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
> ---
>  xen/arch/arm/arm64/domctl.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/xen/arch/arm/arm64/domctl.c b/xen/arch/arm/arm64/domctl.c
> index 8720d126c97d..82eff26fb0d1 100644
> --- a/xen/arch/arm/arm64/domctl.c
> +++ b/xen/arch/arm/arm64/domctl.c
> @@ -13,6 +13,19 @@
>  #include <asm/arm64/sve.h>
>  #include <asm/cpufeature.h>
>  
> +static bool vcpus_check_initialised(struct domain *d)

nit: I'd call it vcpus_any_initialised(), that way it's far easier to
     see what it does without jumping into the implementation.

> +{
> +    struct vcpu *v;
> +
> +    for_each_vcpu(d, v)
> +    {
> +        if ( v->is_initialised )
> +            return true;
> +    }
> +
> +    return false;
> +}
> +
>  static long switch_mode(struct domain *d, enum domain_type type)
>  {
>      struct vcpu *v;
> @@ -21,6 +34,8 @@ static long switch_mode(struct domain *d, enum domain_type type)
>          return -EINVAL;
>      if ( domain_tot_pages(d) != 0 )
>          return -EBUSY;
> +    if ( vcpus_check_initialised(d) )
> +        return -EBUSY;
>      if ( d->arch.type == type )
>          return 0;
>  



  reply	other threads:[~2025-07-31 13:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31  9:42 [XEN][PATCH 0/7] xen/arm: rework to probe kernel before creating domains during xen boot Grygorii Strashko
2025-07-31  9:42 ` [XEN][PATCH 2/7] xen/domctl: introduce XEN_DOMCTL_CDF_is_32bits Grygorii Strashko
2025-07-31 11:08   ` Jan Beulich
2025-07-31 12:25   ` Alejandro Vallejo
2025-07-31 14:02   ` Teddy Astie
2025-07-31 15:19     ` Julien Grall
2025-07-31 19:49       ` Grygorii Strashko
2025-07-31  9:42 ` [XEN][PATCH 1/7] xen/arm64: domctl: set_address_size add check for vcpus not initialized Grygorii Strashko
2025-07-31 13:09   ` Alejandro Vallejo [this message]
2025-07-31  9:42 ` [XEN][PATCH 3/7] xen/fdt: kernel: add generic is_32bit_type flag to struct kernel_info Grygorii Strashko
2025-07-31  9:42 ` [XEN][PATCH 5/7] dom0less: Parse memory properties in the common bindings Grygorii Strashko
2025-07-31 12:58   ` Alejandro Vallejo
2025-07-31  9:42 ` [XEN][PATCH 4/7] xen/arm: probe kernel before creating dom0 Grygorii Strashko
2025-07-31  9:42 ` [XEN][PATCH 7/7] xen/dt: kernel: add assert(!domain) in kernel_probe Grygorii Strashko
2025-07-31  9:42 ` [XEN][PATCH 6/7] dom0less: probe kernel before creating domains 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=DBQ9JRMYP231.2OVN6KC0QPG0U@amd.com \
    --to=alejandro.garciavallejo@amd.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.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.