blob: c32dbf660ae79417c268eec8c9a973589de84cbe [file] [log] [blame]
Hank Janssen565e7dc2009-07-13 15:15:47 -07001/*
2 *
3 * Copyright (c) 2009, Microsoft Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 *
18 * Authors:
19 * Haiyang Zhang <haiyangz@microsoft.com>
20 * Hank Janssen <hjanssen@microsoft.com>
21 *
22 */
23
24
25#pragma once
26
Hank Janssen565e7dc2009-07-13 15:15:47 -070027
Bill Pemberton454f18a2009-07-27 16:47:24 -040028/* Versioning definitions used for guests reporting themselves to the */
29/* hypervisor, and visa versa. */
30/* ================================================================== */
31
32
33
34/* Version info reported by guest OS's */
35
Hank Janssen565e7dc2009-07-13 15:15:47 -070036typedef enum _HV_GUEST_OS_VENDOR
37{
38 HvGuestOsVendorMicrosoft = 0x0001
39
40} HV_GUEST_OS_VENDOR, *PHV_GUEST_OS_VENDOR;
41
42typedef enum _HV_GUEST_OS_MICROSOFT_IDS
43{
44 HvGuestOsMicrosoftUndefined = 0x00,
45 HvGuestOsMicrosoftMSDOS = 0x01,
46 HvGuestOsMicrosoftWindows3x = 0x02,
47 HvGuestOsMicrosoftWindows9x = 0x03,
48 HvGuestOsMicrosoftWindowsNT = 0x04,
49 HvGuestOsMicrosoftWindowsCE = 0x05
50
51} HV_GUEST_OS_MICROSOFT_IDS, *PHV_GUEST_OS_MICROSOFT_IDS;
52
Bill Pemberton454f18a2009-07-27 16:47:24 -040053
54/* Declare the MSR used to identify the guest OS. */
55
Hank Janssen565e7dc2009-07-13 15:15:47 -070056#define HV_X64_MSR_GUEST_OS_ID 0x40000000
57
58typedef union _HV_X64_MSR_GUEST_OS_ID_CONTENTS
59{
Greg Kroah-Hartman59471432009-07-14 15:10:26 -070060 u64 AsUINT64;
Hank Janssen565e7dc2009-07-13 15:15:47 -070061 struct
62 {
Greg Kroah-Hartman59471432009-07-14 15:10:26 -070063 u64 BuildNumber : 16;
Bill Pemberton454f18a2009-07-27 16:47:24 -040064 u64 ServiceVersion : 8; /* Service Pack, etc. */
Greg Kroah-Hartman59471432009-07-14 15:10:26 -070065 u64 MinorVersion : 8;
66 u64 MajorVersion : 8;
Bill Pemberton454f18a2009-07-27 16:47:24 -040067 u64 OsId : 8; /* HV_GUEST_OS_MICROSOFT_IDS (If Vendor=MS) */
68 u64 VendorId : 16; /* HV_GUEST_OS_VENDOR */
Hank Janssen565e7dc2009-07-13 15:15:47 -070069 };
70} HV_X64_MSR_GUEST_OS_ID_CONTENTS, *PHV_X64_MSR_GUEST_OS_ID_CONTENTS;
71
Bill Pemberton454f18a2009-07-27 16:47:24 -040072
73/* Declare the MSR used to setup pages used to communicate with the hypervisor. */
74
Hank Janssen565e7dc2009-07-13 15:15:47 -070075#define HV_X64_MSR_HYPERCALL 0x40000001
76
77typedef union _HV_X64_MSR_HYPERCALL_CONTENTS
78{
Greg Kroah-Hartman59471432009-07-14 15:10:26 -070079 u64 AsUINT64;
Hank Janssen565e7dc2009-07-13 15:15:47 -070080 struct
81 {
Greg Kroah-Hartman59471432009-07-14 15:10:26 -070082 u64 Enable : 1;
83 u64 Reserved : 11;
84 u64 GuestPhysicalAddress : 52;
Hank Janssen565e7dc2009-07-13 15:15:47 -070085 };
86} HV_X64_MSR_HYPERCALL_CONTENTS, *PHV_X64_MSR_HYPERCALL_CONTENTS;