Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 
0003 /*
0004  * This file contains definitions from the Hyper-V Hypervisor Top-Level
0005  * Functional Specification (TLFS):
0006  * https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs
0007  *
0008  * Copyright (C) 2021, Microsoft, Inc.
0009  *
0010  * Author : Michael Kelley <mikelley@microsoft.com>
0011  */
0012 
0013 #ifndef _ASM_HYPERV_TLFS_H
0014 #define _ASM_HYPERV_TLFS_H
0015 
0016 #include <linux/types.h>
0017 
0018 /*
0019  * All data structures defined in the TLFS that are shared between Hyper-V
0020  * and a guest VM use Little Endian byte ordering.  This matches the default
0021  * byte ordering of Linux running on ARM64, so no special handling is required.
0022  */
0023 
0024 /*
0025  * These Hyper-V registers provide information equivalent to the CPUID
0026  * instruction on x86/x64.
0027  */
0028 #define HV_REGISTER_HYPERVISOR_VERSION      0x00000100 /*CPUID 0x40000002 */
0029 #define HV_REGISTER_FEATURES            0x00000200 /*CPUID 0x40000003 */
0030 #define HV_REGISTER_ENLIGHTENMENTS      0x00000201 /*CPUID 0x40000004 */
0031 
0032 /*
0033  * Group C Features. See the asm-generic version of hyperv-tlfs.h
0034  * for a description of Feature Groups.
0035  */
0036 
0037 /* Crash MSRs available */
0038 #define HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE    BIT(8)
0039 
0040 /* STIMER direct mode is available */
0041 #define HV_STIMER_DIRECT_MODE_AVAILABLE     BIT(13)
0042 
0043 /*
0044  * Synthetic register definitions equivalent to MSRs on x86/x64
0045  */
0046 #define HV_REGISTER_CRASH_P0        0x00000210
0047 #define HV_REGISTER_CRASH_P1        0x00000211
0048 #define HV_REGISTER_CRASH_P2        0x00000212
0049 #define HV_REGISTER_CRASH_P3        0x00000213
0050 #define HV_REGISTER_CRASH_P4        0x00000214
0051 #define HV_REGISTER_CRASH_CTL       0x00000215
0052 
0053 #define HV_REGISTER_GUEST_OSID      0x00090002
0054 #define HV_REGISTER_VP_INDEX        0x00090003
0055 #define HV_REGISTER_TIME_REF_COUNT  0x00090004
0056 #define HV_REGISTER_REFERENCE_TSC   0x00090017
0057 
0058 #define HV_REGISTER_SINT0       0x000A0000
0059 #define HV_REGISTER_SCONTROL        0x000A0010
0060 #define HV_REGISTER_SIEFP       0x000A0012
0061 #define HV_REGISTER_SIMP        0x000A0013
0062 #define HV_REGISTER_EOM         0x000A0014
0063 
0064 #define HV_REGISTER_STIMER0_CONFIG  0x000B0000
0065 #define HV_REGISTER_STIMER0_COUNT   0x000B0001
0066 
0067 union hv_msi_entry {
0068     u64 as_uint64[2];
0069     struct {
0070         u64 address;
0071         u32 data;
0072         u32 reserved;
0073     } __packed;
0074 };
0075 
0076 #include <asm-generic/hyperv-tlfs.h>
0077 
0078 #endif