Re: [PATCH v3 0/4] Improve Hyper-V memory deposit error handling

From: Wei Liu

Date: Thu Feb 19 2026 - 01:49:40 EST


On Thu, Feb 05, 2026 at 06:42:04PM +0000, Stanislav Kinsburskii wrote:
> This series extends the MSHV driver to properly handle additional
> memory-related error codes from the Microsoft Hypervisor by depositing
> memory pages when needed.
>
> Currently, when the hypervisor returns HV_STATUS_INSUFFICIENT_MEMORY
> during partition creation, the driver calls hv_call_deposit_pages() to
> provide the necessary memory. However, there are other memory-related
> error codes that indicate the hypervisor needs additional memory
> resources, but the driver does not attempt to deposit pages for these
> cases.
>
> This series introduces a dedicated helper function macro to identify all
> memory-related error codes (HV_STATUS_INSUFFICIENT_MEMORY,
> HV_STATUS_INSUFFICIENT_BUFFERS, HV_STATUS_INSUFFICIENT_DEVICE_DOMAINS, and
> HV_STATUS_INSUFFICIENT_ROOT_MEMORY) and ensures the driver attempts to
> deposit pages for all of them via new hv_deposit_memory() helper.
>
> With these changes, partition creation becomes more robust by handling
> all scenarios where the hypervisor requires additional memory deposits.
>
> v3:
> - Fix uninitialized num_pages variable in hv_deposit_memory_node() in case
> of HV_STATUS_INSUFFICIENT_ROOT_MEMORY status
>

I fixed a typo pointed out by Mukesh in the previous version, dropped
the note from the commit message in the last patch, and applied this to
hyperv-next.

Please address Michael's comment in patch four and send out a follow-up
patch if necessary.

Wei