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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6bca523f-4133-948c-71bf-24475e7292a7@linux.microsoft.com>
Date: Fri, 23 Jan 2026 16:31:43 -0800
From: Mukesh R <mrathor@...ux.microsoft.com>
To: Stanislav Kinsburskii <skinsburskii@...ux.microsoft.com>,
 kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
 decui@...rosoft.com, longli@...rosoft.com
Cc: linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] mshv: Introduce hv_result_oom() helper function

On 1/22/26 17:35, Stanislav Kinsburskii wrote:
> Replace direct comparisons of hv_result(status) against
> HV_STATUS_INSUFFICIENT_MEMORY with a new hv_result_oom() helper function.
> This improves code readability and provides a consistent and extendable
> interface for checking out-of-memory conditions in hypercall results.
> 
> No functional changes intended.
> 
> Signed-off-by: Stanislav Kinsburskii <skinsburskii@...ux.microsoft.com>
> ---
>   drivers/hv/hv_proc.c           |   14 ++++++++++++--
>   drivers/hv/mshv_root_hv_call.c |   20 ++++++++++----------
>   drivers/hv/mshv_root_main.c    |    2 +-
>   include/asm-generic/mshyperv.h |    3 +++
>   4 files changed, 26 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/hv/hv_proc.c b/drivers/hv/hv_proc.c
> index fbb4eb3901bb..80c66d1c74d5 100644
> --- a/drivers/hv/hv_proc.c
> +++ b/drivers/hv/hv_proc.c
> @@ -110,6 +110,16 @@ int hv_call_deposit_pages(int node, u64 partition_id, u32 num_pages)
>   }
>   EXPORT_SYMBOL_GPL(hv_call_deposit_pages);
>   
> +bool hv_result_oom(u64 status)
> +{
> +	switch (hv_result(status)) {
> +	case HV_STATUS_INSUFFICIENT_MEMORY:
> +		return true;
> +	}
> +	return false;
> +}
> +EXPORT_SYMBOL_GPL(hv_result_oom);

I had mentioned this during internal review previously, so forgive me
for repeating. I don't think using _oom suffix is a good idea. Firstly,
system is not out of memory, hypervisor will continue to work perfectly,
just the particalur hypercall needs a bit more ram to succeed. Secondly
and more importantly, "oom" has come to mean a very specific event
in linux, and as such reusing it for something totally different is
unnecessary. For example, if another maintainer working on oom happens
to see this, and not being familiar with HyperV may get totally confused
and waste time unnecessarily.

It can easily be renamed: hv_result_insuff_mem, or hv_result_enomem,
or hv_result_deposit_ram etc... there are many options.

Thanks,
-Mukesh

.... deleted ...


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ