Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 
0003 /*
0004  * Linux-specific definitions for managing interactions with Microsoft's
0005  * Hyper-V hypervisor. The definitions in this file are specific to
0006  * the ARM64 architecture.  See include/asm-generic/mshyperv.h for
0007  * definitions are that architecture independent.
0008  *
0009  * Definitions that are specified in the Hyper-V Top Level Functional
0010  * Spec (TLFS) should not go in this file, but should instead go in
0011  * hyperv-tlfs.h.
0012  *
0013  * Copyright (C) 2021, Microsoft, Inc.
0014  *
0015  * Author : Michael Kelley <mikelley@microsoft.com>
0016  */
0017 
0018 #ifndef _ASM_MSHYPERV_H
0019 #define _ASM_MSHYPERV_H
0020 
0021 #include <linux/types.h>
0022 #include <linux/arm-smccc.h>
0023 #include <asm/hyperv-tlfs.h>
0024 
0025 /*
0026  * Declare calls to get and set Hyper-V VP register values on ARM64, which
0027  * requires a hypercall.
0028  */
0029 
0030 void hv_set_vpreg(u32 reg, u64 value);
0031 u64 hv_get_vpreg(u32 reg);
0032 void hv_get_vpreg_128(u32 reg, struct hv_get_vp_registers_output *result);
0033 
0034 static inline void hv_set_register(unsigned int reg, u64 value)
0035 {
0036     hv_set_vpreg(reg, value);
0037 }
0038 
0039 static inline u64 hv_get_register(unsigned int reg)
0040 {
0041     return hv_get_vpreg(reg);
0042 }
0043 
0044 /* SMCCC hypercall parameters */
0045 #define HV_SMCCC_FUNC_NUMBER    1
0046 #define HV_FUNC_ID  ARM_SMCCC_CALL_VAL(         \
0047                 ARM_SMCCC_STD_CALL,     \
0048                 ARM_SMCCC_SMC_64,       \
0049                 ARM_SMCCC_OWNER_VENDOR_HYP, \
0050                 HV_SMCCC_FUNC_NUMBER)
0051 
0052 #include <asm-generic/mshyperv.h>
0053 
0054 #endif