mshyperv.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Linux-specific definitions for managing interactions with Microsoft's
  4. * Hyper-V hypervisor. The definitions in this file are specific to
  5. * the ARM64 architecture. See include/asm-generic/mshyperv.h for
  6. * definitions are that architecture independent.
  7. *
  8. * Definitions that are specified in the Hyper-V Top Level Functional
  9. * Spec (TLFS) should not go in this file, but should instead go in
  10. * hyperv-tlfs.h.
  11. *
  12. * Copyright (C) 2021, Microsoft, Inc.
  13. *
  14. * Author : Michael Kelley <mikelley@microsoft.com>
  15. */
  16. #ifndef _ASM_MSHYPERV_H
  17. #define _ASM_MSHYPERV_H
  18. #include <linux/types.h>
  19. #include <linux/arm-smccc.h>
  20. #include <asm/hyperv-tlfs.h>
  21. /*
  22. * Declare calls to get and set Hyper-V VP register values on ARM64, which
  23. * requires a hypercall.
  24. */
  25. void hv_set_vpreg(u32 reg, u64 value);
  26. u64 hv_get_vpreg(u32 reg);
  27. void hv_get_vpreg_128(u32 reg, struct hv_get_vp_registers_output *result);
  28. static inline void hv_set_register(unsigned int reg, u64 value)
  29. {
  30. hv_set_vpreg(reg, value);
  31. }
  32. static inline u64 hv_get_register(unsigned int reg)
  33. {
  34. return hv_get_vpreg(reg);
  35. }
  36. /* SMCCC hypercall parameters */
  37. #define HV_SMCCC_FUNC_NUMBER 1
  38. #define HV_FUNC_ID ARM_SMCCC_CALL_VAL( \
  39. ARM_SMCCC_STD_CALL, \
  40. ARM_SMCCC_SMC_64, \
  41. ARM_SMCCC_OWNER_VENDOR_HYP, \
  42. HV_SMCCC_FUNC_NUMBER)
  43. #include <asm-generic/mshyperv.h>
  44. #endif