summaryrefslogtreecommitdiff
path: root/include/asm-generic/hyperv-tlfs.h
diff options
context:
space:
mode:
authorNuno Das Neves <nunodasneves@linux.microsoft.com>2024-03-07 15:03:38 -0800
committerWei Liu <wei.liu@kernel.org>2024-03-12 05:17:50 +0000
commit410779d8d81fcfb45f839238dc6505af5357f5b8 (patch)
tree6d47316c02a7329bda4f46ac49e6a34a5697942f /include/asm-generic/hyperv-tlfs.h
parent2b4b90e053a29057fb05ba81acce26bddce8d404 (diff)
mshyperv: Introduce hv_get_hypervisor_version function
Introduce x86_64 and arm64 functions to get the hypervisor version information and store it in a structure for simpler parsing. Use the new function to get and parse the version at boot time. While at it, move the printing code to hv_common_init() so it is not duplicated. Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com> Acked-by: Wei Liu <wei.liu@kernel.org> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Link: https://lore.kernel.org/r/1709852618-29110-1-git-send-email-nunodasneves@linux.microsoft.com Signed-off-by: Wei Liu <wei.liu@kernel.org> Message-ID: <1709852618-29110-1-git-send-email-nunodasneves@linux.microsoft.com>
Diffstat (limited to 'include/asm-generic/hyperv-tlfs.h')
-rw-r--r--include/asm-generic/hyperv-tlfs.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/asm-generic/hyperv-tlfs.h b/include/asm-generic/hyperv-tlfs.h
index 3d1b31f90ed6..32514a870b98 100644
--- a/include/asm-generic/hyperv-tlfs.h
+++ b/include/asm-generic/hyperv-tlfs.h
@@ -818,6 +818,29 @@ struct hv_input_unmap_device_interrupt {
#define HV_SOURCE_SHADOW_BRIDGE_BUS_RANGE 0x1
/*
+ * Version info reported by hypervisor
+ */
+union hv_hypervisor_version_info {
+ struct {
+ u32 build_number;
+
+ u32 minor_version : 16;
+ u32 major_version : 16;
+
+ u32 service_pack;
+
+ u32 service_number : 24;
+ u32 service_branch : 8;
+ };
+ struct {
+ u32 eax;
+ u32 ebx;
+ u32 ecx;
+ u32 edx;
+ };
+};
+
+/*
* The whole argument should fit in a page to be able to pass to the hypervisor
* in one hypercall.
*/