hyperv-tlfs.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * This file contains definitions from the Hyper-V Hypervisor Top-Level
  4. * Functional Specification (TLFS):
  5. * https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs
  6. *
  7. * Copyright (C) 2021, Microsoft, Inc.
  8. *
  9. * Author : Michael Kelley <mikelley@microsoft.com>
  10. */
  11. #ifndef _ASM_HYPERV_TLFS_H
  12. #define _ASM_HYPERV_TLFS_H
  13. #include <linux/types.h>
  14. /*
  15. * All data structures defined in the TLFS that are shared between Hyper-V
  16. * and a guest VM use Little Endian byte ordering. This matches the default
  17. * byte ordering of Linux running on ARM64, so no special handling is required.
  18. */
  19. /*
  20. * Group C Features. See the asm-generic version of hyperv-tlfs.h
  21. * for a description of Feature Groups.
  22. */
  23. /* Crash MSRs available */
  24. #define HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE BIT(8)
  25. /* STIMER direct mode is available */
  26. #define HV_STIMER_DIRECT_MODE_AVAILABLE BIT(13)
  27. /*
  28. * To support arch-generic code calling hv_set/get_register:
  29. * - On x86, HV_MSR_ indicates an MSR accessed via rdmsrl/wrmsrl
  30. * - On ARM, HV_MSR_ indicates a VP register accessed via hypercall
  31. */
  32. #define HV_MSR_CRASH_P0 (HV_REGISTER_GUEST_CRASH_P0)
  33. #define HV_MSR_CRASH_P1 (HV_REGISTER_GUEST_CRASH_P1)
  34. #define HV_MSR_CRASH_P2 (HV_REGISTER_GUEST_CRASH_P2)
  35. #define HV_MSR_CRASH_P3 (HV_REGISTER_GUEST_CRASH_P3)
  36. #define HV_MSR_CRASH_P4 (HV_REGISTER_GUEST_CRASH_P4)
  37. #define HV_MSR_CRASH_CTL (HV_REGISTER_GUEST_CRASH_CTL)
  38. #define HV_MSR_VP_INDEX (HV_REGISTER_VP_INDEX)
  39. #define HV_MSR_TIME_REF_COUNT (HV_REGISTER_TIME_REF_COUNT)
  40. #define HV_MSR_REFERENCE_TSC (HV_REGISTER_REFERENCE_TSC)
  41. #define HV_MSR_SINT0 (HV_REGISTER_SINT0)
  42. #define HV_MSR_SCONTROL (HV_REGISTER_SCONTROL)
  43. #define HV_MSR_SIEFP (HV_REGISTER_SIEFP)
  44. #define HV_MSR_SIMP (HV_REGISTER_SIMP)
  45. #define HV_MSR_EOM (HV_REGISTER_EOM)
  46. #define HV_MSR_STIMER0_CONFIG (HV_REGISTER_STIMER0_CONFIG)
  47. #define HV_MSR_STIMER0_COUNT (HV_REGISTER_STIMER0_COUNT)
  48. union hv_msi_entry {
  49. u64 as_uint64[2];
  50. struct {
  51. u64 address;
  52. u32 data;
  53. u32 reserved;
  54. } __packed;
  55. };
  56. #include <asm-generic/hyperv-tlfs.h>
  57. #endif