summaryrefslogtreecommitdiff
path: root/include/hyperv
diff options
context:
space:
mode:
authorMichael Kelley <mhklinux@outlook.com>2025-03-18 14:49:19 -0700
committerWei Liu <wei.liu@kernel.org>2025-03-21 18:24:22 +0000
commit999ad14259a0d45cb3b616e2e95a7c8b622a7ecd (patch)
tree177df3483f8dd8f22d1a84354a5e08bc84b17d90 /include/hyperv
parent621191d709b14882270dfd8ea5d7d6cdfebe2c35 (diff)
x86/hyperv: Add comments about hv_vpset and var size hypercall input args
Current code varies in how the size of the variable size input header for hypercalls is calculated when the input contains struct hv_vpset. Surprisingly, this variation is correct, as different hypercalls make different choices for what portion of struct hv_vpset is treated as part of the variable size input header. The Hyper-V TLFS is silent on these details, but the behavior has been confirmed with Hyper-V developers. To avoid future confusion about these differences, add comments to struct hv_vpset, and to hypercall call sites with input that contains a struct hv_vpset. The comments describe the overall situation and the calculation that should be used at each particular call site. No functional change as only comments are updated. Signed-off-by: Michael Kelley <mhklinux@outlook.com> Link: https://lore.kernel.org/r/20250318214919.958953-1-mhklinux@outlook.com Signed-off-by: Wei Liu <wei.liu@kernel.org> Message-ID: <20250318214919.958953-1-mhklinux@outlook.com>
Diffstat (limited to 'include/hyperv')
-rw-r--r--include/hyperv/hvgdk_mini.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/hyperv/hvgdk_mini.h b/include/hyperv/hvgdk_mini.h
index 735329859f21..abf0bd76e370 100644
--- a/include/hyperv/hvgdk_mini.h
+++ b/include/hyperv/hvgdk_mini.h
@@ -205,7 +205,14 @@ union hv_reference_tsc_msr {
/* The number of vCPUs in one sparse bank */
#define HV_VCPUS_PER_SPARSE_BANK (64)
-/* Some of Hyper-V structs do not use hv_vpset where linux uses them */
+/*
+ * Some of Hyper-V structs do not use hv_vpset where linux uses them.
+ *
+ * struct hv_vpset is usually used as part of hypercall input. The portion
+ * that counts as "fixed size input header" vs. "variable size input header"
+ * varies per hypercall. See comments at relevant hypercall call sites as to
+ * how the "valid_bank_mask" field should be accounted.
+ */
struct hv_vpset { /* HV_VP_SET */
u64 format;
u64 valid_bank_mask;