]> www.infradead.org Git - users/hch/misc.git/commitdiff
x86/hyperv: Fix output argument to hypercall that changes page visibility
authorMichael Kelley <mhklinux@outlook.com>
Wed, 26 Feb 2025 20:06:06 +0000 (12:06 -0800)
committerWei Liu <wei.liu@kernel.org>
Mon, 10 Mar 2025 00:21:07 +0000 (00:21 +0000)
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>

arch/x86/hyperv/ivm.c

index dd68d9ad9b22caf09e95ef58661bbf8aa0bed152..ec7880271cf98a631778d1c228a0ff3bcea241fb 100644 (file)
@@ -464,7 +464,6 @@ static int hv_mark_gpa_visibility(u16 count, const u64 pfn[],
                           enum hv_mem_host_visibility visibility)
 {
        struct hv_gpa_range_for_visibility *input;
-       u16 pages_processed;
        u64 hv_status;
        unsigned long flags;
 
@@ -493,7 +492,7 @@ static int hv_mark_gpa_visibility(u16 count, const u64 pfn[],
        memcpy((void *)input->gpa_page_list, pfn, count * sizeof(*pfn));
        hv_status = hv_do_rep_hypercall(
                        HVCALL_MODIFY_SPARSE_GPA_PAGE_HOST_VISIBILITY, count,
-                       0, input, &pages_processed);
+                       0, input, NULL);
        local_irq_restore(flags);
 
        if (hv_result_success(hv_status))