diff options
| author | Nuno Das Neves <nunodasneves@linux.microsoft.com> | 2025-10-17 21:58:17 +0300 |
|---|---|---|
| committer | Wei Liu <wei.liu@kernel.org> | 2025-11-15 09:18:14 +0300 |
| commit | 4cc1aa469cd6b714adc958547a4866247bfd60a9 (patch) | |
| tree | a01658c318946292752e4e1a7e913da7dc8f6603 /tools/perf/scripts/python/bin/stackcollapse-record | |
| parent | 7563d021e28ec71bc6266e1848b22205ed7863d6 (diff) | |
| download | linux-4cc1aa469cd6b714adc958547a4866247bfd60a9.tar.xz | |
mshv: Fix deposit memory in MSHV_ROOT_HVCALL
When the MSHV_ROOT_HVCALL ioctl is executing a hypercall, and gets
HV_STATUS_INSUFFICIENT_MEMORY, it deposits memory and then returns
-EAGAIN to userspace. The expectation is that the VMM will retry.
However, some VMM code in the wild doesn't do this and simply fails.
Rather than force the VMM to retry, change the ioctl to deposit
memory on demand and immediately retry the hypercall as is done with
all the other hypercall helper functions.
In addition to making the ioctl easier to use, removing the need for
multiple syscalls improves performance.
There is a complication: unlike the other hypercall helper functions,
in MSHV_ROOT_HVCALL the input is opaque to the kernel. This is
problematic for rep hypercalls, because the next part of the input
list can't be copied on each loop after depositing pages (this was
the original reason for returning -EAGAIN in this case).
Introduce hv_do_rep_hypercall_ex(), which adds a 'rep_start'
parameter. This solves the issue, allowing the deposit loop in
MSHV_ROOT_HVCALL to restart a rep hypercall after depositing pages
partway through.
Fixes: 621191d709b1 ("Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs")
Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-record')
0 files changed, 0 insertions, 0 deletions
