All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mukesh R" <mrathor@linux.microsoft.com>, linux-hyperv@vger.kernel.org
Subject: Re: [PATCH V1 2/2] Drivers: hv: Fix bugs and issues around repeat hypercall
Date: Sat, 14 Nov 2026 03:18:43 +0000	[thread overview]
Message-ID: <sashiko-outbox-214095@kernel.org> (raw)
In-Reply-To: <20261114025313.1257042-3-mrathor@linux.microsoft.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] Drivers: hv: unused HV_REP_COUNT_MAX macro and dead return in
  mshyperv.h
--

commit 9765fd900ad842b6359a24f592cd624ffdc92be5
Author: Mukesh R <mrathor@linux.microsoft.com>

Drivers: hv: Fix bugs and issues around repeat hypercall

This commit updates repeat hypercall handling to account for partial
completions on failure, splits repeat hypercall helpers between hardware
confidential VMs and regular VMs, and renames HV_STATUS_TIME_OUT to
HV_STATUS_TIMEOUT.

> diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h
> index 396bcb3db0bcc..87c784b9daa69 100644
> --- a/include/asm-generic/mshyperv.h
> +++ b/include/asm-generic/mshyperv.h
> @@ -28,6 +28,9 @@
>  
>  #define VTPM_BASE_ADDRESS 0xfed40000
>  
> +#define HV_REP_COUNT_MAX	\
> +	(HV_HYPERCALL_REP_COMP_MASK >> HV_HYPERCALL_REP_COMP_OFFSET)
> +
>  enum hv_partition_type {

[ ... ]

> @@ -135,45 +143,63 @@ static inline unsigned int hv_repcomp(u64 status)
>  	/* Bits [43:32] of status have 'Reps completed' data. */
>  	return (status & HV_HYPERCALL_REP_COMP_MASK) >>
>  			 HV_HYPERCALL_REP_COMP_OFFSET;
>  }
>  
> -/*
> - * Rep hypercalls. Callers of this functions are supposed to ensure that
> - * rep_count, varhead_size, and rep_start comply with Hyper-V hypercall
> - * definition.
> - */
> -static inline u64 hv_do_rep_hypercall_ex(u16 code, u16 rep_count,
> -					 u16 varhead_size, u16 rep_start,
> -					 void *input, void *output)
> +static inline u64 hv_do_rep_hypercall_reg(u16 code, u16 rep_count,
> +					  u16 varhead_size, u16 rep_start,
> +					  void *input, void *output)
>  {
>  	u64 control = code;
> -	u64 status;
> -	u16 rep_comp;
>  
>  	control |= (u64)varhead_size << HV_HYPERCALL_VARHEAD_OFFSET;
>  	control |= (u64)rep_count << HV_HYPERCALL_REP_COMP_OFFSET;
>  	control |= (u64)rep_start << HV_HYPERCALL_REP_START_OFFSET;
>  
> -	do {
> +	return hv_do_hypercall(control, input, output);
> +}
> +
> +static inline u64 hv_do_rep_hypercall_cvm(u16 code, u16 rep_count,
> +					  u16 varhead_size, u16 rep_start,
> +					  void *input, void *output)
> +{
> +	u64 status, control = code;
> +	u16 rep_comp = 0;
> +
> +	control |= (u64)varhead_size << HV_HYPERCALL_VARHEAD_OFFSET;
> +	control |= (u64)rep_count << HV_HYPERCALL_REP_COMP_OFFSET;
> +	control |= (u64)rep_start << HV_HYPERCALL_REP_START_OFFSET;
> +
> +	for (;;) {
>  		status = hv_do_hypercall(control, input, output);
> -		if (!hv_result_success(status))
> +
> +		if (!hv_result_timeout(status))
>  			return status;
>  
>  		rep_comp = hv_repcomp(status);
> -
>  		control &= ~HV_HYPERCALL_REP_START_MASK;
>  		control |= (u64)rep_comp << HV_HYPERCALL_REP_START_OFFSET;
>  
>  		touch_nmi_watchdog();
> -	} while (rep_comp < rep_count);
> +	}
>  
>  	return status;
>  }

[Severity: Low]
Is the trailing return status; in hv_do_rep_hypercall_cvm() needed now
that the loop is for (;;) with no break statement?  Also, HV_REP_COUNT_MAX
added earlier in this file has no users in the tree.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261114025313.1257042-1-mrathor@linux.microsoft.com?part=2

      reply	other threads:[~2026-11-14  3:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14  2:53 [PATCH V1 0/2] Hyper-V: Fix bugs and issues around repeat hypercall Mukesh R
2026-11-14  2:53 ` [PATCH V1 1/2] Drivers: hv: Add new function hv_isolation_type_hw() Mukesh R
2026-11-14  2:53 ` [PATCH V1 2/2] Drivers: hv: Fix bugs and issues around repeat hypercall Mukesh R
2026-11-14  3:18   ` sashiko-bot [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=sashiko-outbox-214095@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=mrathor@linux.microsoft.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.