1 /* SPDX-License-Identifier: GPL-2.0 */
4 * Linux-specific definitions for managing interactions with Microsoft's
5 * Hyper-V hypervisor. The definitions in this file are specific to
6 * the ARM64 architecture. See include/asm-generic/mshyperv.h for
7 * definitions are that architecture independent.
9 * Definitions that are derived from Hyper-V code or headers should not go in
10 * this file, but should instead go in the relevant files in include/hyperv.
12 * Copyright (C) 2021, Microsoft, Inc.
17 #ifndef _ASM_MSHYPERV_H
18 #define _ASM_MSHYPERV_H
20 #include <linux/types.h>
21 #include <linux/arm-smccc.h>
22 #include <hyperv/hvhdk.h>
25 * Declare calls to get and set Hyper-V VP register values on ARM64, which
26 * requires a hypercall.
29 void hv_set_vpreg(u32 reg, u64 value);
30 u64 hv_get_vpreg(u32 reg);
31 void hv_get_vpreg_128(u32 reg, struct hv_get_vp_registers_output *result);
33 static inline void hv_set_msr(unsigned int reg, u64 value)
35 hv_set_vpreg(reg, value);
38 static inline u64 hv_get_msr(unsigned int reg)
40 return hv_get_vpreg(reg);
43 /* SMCCC hypercall parameters */
44 #define HV_SMCCC_FUNC_NUMBER 1
45 #define HV_FUNC_ID ARM_SMCCC_CALL_VAL( \
48 ARM_SMCCC_OWNER_VENDOR_HYP, \
51 #include <asm-generic/mshyperv.h>