lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aMxjORzTO0DgWq9q@skinsburskii.localdomain>
Date: Thu, 18 Sep 2025 12:53:29 -0700
From: Stanislav Kinsburskii <skinsburskii@...ux.microsoft.com>
To: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
Cc: linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
	prapal@...ux.microsoft.com, easwar.hariharan@...ux.microsoft.com,
	tiala@...rosoft.com, anirudh@...rudhrb.com,
	paekkaladevi@...ux.microsoft.com, kys@...rosoft.com,
	haiyangz@...rosoft.com, wei.liu@...nel.org, decui@...rosoft.com,
	Jinank Jain <jinankjain@...ux.microsoft.com>
Subject: Re: [PATCH v3 5/5] mshv: Introduce new hypercall to map stats page
 for L1VH partitions

On Tue, Sep 16, 2025 at 04:44:22PM -0700, Nuno Das Neves wrote:
> From: Jinank Jain <jinankjain@...ux.microsoft.com>
> 

<snip>

> +static int hv_call_map_stats_page2(enum hv_stats_object_type type,
> +				   const union hv_stats_object_identity *identity,
> +				   u64 map_location)
> +{
> +	unsigned long flags;
> +	struct hv_input_map_stats_page2 *input;
> +	u64 status;
> +	int ret;
> +
> +	if (!map_location || !mshv_use_overlay_gpfn())
> +		return -EINVAL;
> +
> +	do {
> +		local_irq_save(flags);
> +		input = *this_cpu_ptr(hyperv_pcpu_input_arg);
> +
> +		memset(input, 0, sizeof(*input));
> +		input->type = type;
> +		input->identity = *identity;
> +		input->map_location = map_location;
> +
> +		status = hv_do_hypercall(HVCALL_MAP_STATS_PAGE2, input, NULL);
> +
> +		local_irq_restore(flags);
> +		if (hv_result(status) != HV_STATUS_INSUFFICIENT_MEMORY) {
> +			if (hv_result_success(status))
> +				break;
> +			hv_status_debug(status, "\n");

It looks more natural to check for success first and break the loop, and
only then handle errors.
Maybe even set ret for both success and error messages and break and
handle only the unsufficient memory status.

> @@ -865,6 +931,19 @@ int hv_call_unmap_stat_page(enum hv_stats_object_type type,
>  	return hv_result_to_errno(status);
>  }
>  
> +int hv_unmap_stats_page(enum hv_stats_object_type type, void *page_addr,
> +			const union hv_stats_object_identity *identity)
> +{

Should this function be type of void?

Thanks,
Stanislav


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ