mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Kelley <mhklinux@outlook.com>
To: Mukesh R <mrathor@linux.microsoft.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "haiyangz@microsoft.com" <haiyangz@microsoft.com>,
	"wei.liu@kernel.org" <wei.liu@kernel.org>,
	"decui@microsoft.com" <decui@microsoft.com>
Subject: RE: [PATCH] mshv: Change parameter passing to hv_call_create_partition()
Date: Sun, 22 Nov 2026 03:44:13 +0000	[thread overview]
Message-ID: <MN2PR02MB6863F6129CE2B77EB2CD9780D4462@MN2PR02MB6863.namprd02.prod.outlook.com> (raw)
In-Reply-To: <20261107003303.3897039-1-mrathor@linux.microsoft.com>

From: Mukesh R <mrathor@linux.microsoft.com> Sent: Friday, November 6, 2026 4:33 PM
> 
> At present, mshv_ioctl_create_partition() for unknown reasons passes two
> aggregate parameters by value to hv_call_create_partition(). Change that
> to pass them by reference.
> 
> Signed-off-by: Mukesh R <mrathor@linux.microsoft.com>

Reviewed-by: Michael Kelley <mhklinux@outlook.com>

> ---
>  drivers/hv/mshv_root.h         |  4 ++--
>  drivers/hv/mshv_root_hv_call.c | 12 ++++++------
>  drivers/hv/mshv_root_main.c    |  5 ++---
>  3 files changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/hv/mshv_root.h b/drivers/hv/mshv_root.h
> index 1f086dcb7aa1..c61b52db7f00 100644
> --- a/drivers/hv/mshv_root.h
> +++ b/drivers/hv/mshv_root.h
> @@ -275,8 +275,8 @@ void mshv_vp_stats_unmap(u64 partition_id, u32 vp_index,
> 
>  int hv_call_withdraw_memory(u64 count, int node, u64 partition_id);
>  int hv_call_create_partition(u64 flags,
> -			     struct hv_partition_creation_properties creation_properties,
> -			     union hv_partition_isolation_properties isolation_properties,
> +			     struct hv_partition_creation_properties *cr_prop,
> +			     union hv_partition_isolation_properties *isol_prop,
>  			     u64 *partition_id);
>  int hv_call_initialize_partition(u64 partition_id);
>  int hv_call_finalize_partition(u64 partition_id);
> diff --git a/drivers/hv/mshv_root_hv_call.c b/drivers/hv/mshv_root_hv_call.c
> index e761addda50e..bf0f90515dad 100644
> --- a/drivers/hv/mshv_root_hv_call.c
> +++ b/drivers/hv/mshv_root_hv_call.c
> @@ -86,8 +86,8 @@ int hv_call_withdraw_memory(u64 count, int node, u64 partition_id)
>  }
> 
>  int hv_call_create_partition(u64 flags,
> -			     struct hv_partition_creation_properties creation_properties,
> -			     union hv_partition_isolation_properties isolation_properties,
> +			     struct hv_partition_creation_properties *cr_prop,
> +			     union hv_partition_isolation_properties *isol_prop,
>  			     u64 *partition_id)
>  {
>  	struct hv_input_create_partition *input;
> @@ -105,11 +105,11 @@ int hv_call_create_partition(u64 flags,
>  		input->flags = flags;
>  		input->compatibility_version = HV_COMPATIBILITY_21_H2;
> 
> -		memcpy(&input->partition_creation_properties, &creation_properties,
> -		       sizeof(creation_properties));
> +		memcpy(&input->partition_creation_properties, cr_prop,
> +		       sizeof(*cr_prop));
> 
> -		memcpy(&input->isolation_properties, &isolation_properties,
> -		       sizeof(isolation_properties));
> +		memcpy(&input->isolation_properties, isol_prop,
> +		       sizeof(*isol_prop));
> 
>  		status = hv_do_hypercall(HVCALL_CREATE_PARTITION,
>  					 input, output);
> diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c
> index cc2cfce2aefd..89fe6fb9244a 100644
> --- a/drivers/hv/mshv_root_main.c
> +++ b/drivers/hv/mshv_root_main.c
> @@ -2088,9 +2088,8 @@ mshv_ioctl_create_partition(void __user *user_arg, struct device *module_dev)
>  	if (ret)
>  		goto free_partition;
> 
> -	ret = hv_call_create_partition(creation_flags,
> -				       creation_properties,
> -				       isolation_properties,
> +	ret = hv_call_create_partition(creation_flags, &creation_properties,
> +				       &isolation_properties,
>  				       &pt_id);
>  	if (ret)
>  		goto cleanup_irq_srcu;
> --
> 2.51.2.vfs.0.1
> 


      reply	other threads:[~2026-11-22  3:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07  0:33 Mukesh R
2026-11-22  3:44 ` Michael Kelley [this message]

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=MN2PR02MB6863F6129CE2B77EB2CD9780D4462@MN2PR02MB6863.namprd02.prod.outlook.com \
    --to=mhklinux@outlook.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrathor@linux.microsoft.com \
    --cc=wei.liu@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®