]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mshv: Introduce hv_deposit_memory helper functions
authorStanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Thu, 5 Feb 2026 18:42:15 +0000 (18:42 +0000)
committerWei Liu <wei.liu@kernel.org>
Thu, 19 Feb 2026 06:38:48 +0000 (06:38 +0000)
commitede54383e646821b499873c1caf2dd97551da8eb
treed8e6e9a6c4a9238d7f420d2f61cff48a85e855a2
parent7db44aa173de03c170d4dfa5864ae126678a5ad5
mshv: Introduce hv_deposit_memory helper functions

Introduce hv_deposit_memory_node() and hv_deposit_memory() helper
functions to handle memory deposit with proper error handling.

The new hv_deposit_memory_node() function takes the hypervisor status
as a parameter and validates it before depositing pages. It checks for
HV_STATUS_INSUFFICIENT_MEMORY specifically and returns an error for
unexpected status codes.

This is a precursor patch to new out-of-memory error codes support.
No functional changes intended.

Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Reviewed-by: Mukesh R <mrathor@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/hv_proc.c
drivers/hv/mshv_root_hv_call.c
drivers/hv/mshv_root_main.c
include/asm-generic/mshyperv.h