Skip to content

Commit 09beefe

Browse files
mhklinuxliuw
authored andcommitted
x86/hyperv: Fix output argument to hypercall that changes page visibility
The hypercall in hv_mark_gpa_visibility() is invoked with an input argument and an output argument. The output argument ostensibly returns the number of pages that were processed. But in fact, the hypercall does not provide any output, so the output argument is spurious. The spurious argument is harmless because Hyper-V ignores it, but in the interest of correctness and to avoid the potential for future problems, remove it. Signed-off-by: Michael Kelley <mhklinux@outlook.com> Reviewed-by: Nuno Das Neves <nunodasneves@linux.microsoft.com> Link: https://lore.kernel.org/r/20250226200612.2062-2-mhklinux@outlook.com Signed-off-by: Wei Liu <wei.liu@kernel.org> Message-ID: <20250226200612.2062-2-mhklinux@outlook.com>
1 parent ea2f45a commit 09beefe

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/x86/hyperv/ivm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,6 @@ static int hv_mark_gpa_visibility(u16 count, const u64 pfn[],
464464
enum hv_mem_host_visibility visibility)
465465
{
466466
struct hv_gpa_range_for_visibility *input;
467-
u16 pages_processed;
468467
u64 hv_status;
469468
unsigned long flags;
470469

@@ -493,7 +492,7 @@ static int hv_mark_gpa_visibility(u16 count, const u64 pfn[],
493492
memcpy((void *)input->gpa_page_list, pfn, count * sizeof(*pfn));
494493
hv_status = hv_do_rep_hypercall(
495494
HVCALL_MODIFY_SPARSE_GPA_PAGE_HOST_VISIBILITY, count,
496-
0, input, &pages_processed);
495+
0, input, NULL);
497496
local_irq_restore(flags);
498497

499498
if (hv_result_success(hv_status))

0 commit comments

Comments
 (0)