]>
Commit | Line | Data |
---|---|---|
b15cbd9c BS |
1 | /** @file\r |
2 | MSR Definitions.\r | |
3 | \r | |
4 | Provides defines for Machine Specific Registers(MSR) indexes. Data structures\r | |
5 | are provided for MSRs that contain one or more bit fields. If the MSR value\r | |
6 | returned is a single 32-bit or 64-bit value, then a data structure is not\r | |
7 | provided for that MSR.\r | |
8 | \r | |
9 | Copyright (c) 2017, Advanced Micro Devices. All rights reserved.<BR>\r | |
0acd8697 | 10 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
b15cbd9c BS |
11 | \r |
12 | @par Specification Reference:\r | |
788421d5 | 13 | AMD64 Architecture Programming Manual volume 2, March 2017, Sections 15.34\r |
b15cbd9c BS |
14 | \r |
15 | **/\r | |
16 | \r | |
8cf19dc7 DB |
17 | #ifndef __FAM17_MSR_H__\r |
18 | #define __FAM17_MSR_H__\r | |
b15cbd9c | 19 | \r |
a80e8878 TL |
20 | /**\r |
21 | Secure Encrypted Virtualization - Encrypted State (SEV-ES) GHCB register\r | |
22 | \r | |
23 | **/\r | |
24 | #define MSR_SEV_ES_GHCB 0xc0010130\r | |
25 | \r | |
26 | /**\r | |
27 | MSR information returned for #MSR_SEV_ES_GHCB\r | |
28 | **/\r | |
29 | typedef union {\r | |
30 | struct {\r | |
31 | UINT32 Function:12;\r | |
32 | UINT32 Reserved1:20;\r | |
33 | UINT32 Reserved2:32;\r | |
34 | } GhcbInfo;\r | |
35 | \r | |
36 | struct {\r | |
37 | UINT8 Reserved[3];\r | |
38 | UINT8 SevEncryptionBitPos;\r | |
39 | UINT16 SevEsProtocolMin;\r | |
40 | UINT16 SevEsProtocolMax;\r | |
41 | } GhcbProtocol;\r | |
42 | \r | |
43 | struct {\r | |
44 | UINT32 Function:12;\r | |
45 | UINT32 ReasonCodeSet:4;\r | |
46 | UINT32 ReasonCode:8;\r | |
47 | UINT32 Reserved1:8;\r | |
48 | UINT32 Reserved2:32;\r | |
49 | } GhcbTerminate;\r | |
50 | \r | |
34e16ff8 BS |
51 | struct {\r |
52 | UINT64 Function:12;\r | |
53 | UINT64 Features:52;\r | |
54 | } GhcbHypervisorFeatures;\r | |
55 | \r | |
f0983b20 BS |
56 | struct {\r |
57 | UINT64 Function:12;\r | |
58 | UINT64 GuestFrameNumber:52;\r | |
59 | } GhcbGpaRegister;\r | |
60 | \r | |
4665fa65 BS |
61 | struct {\r |
62 | UINT64 Function:12;\r | |
63 | UINT64 GuestFrameNumber:40;\r | |
64 | UINT64 Operation:4;\r | |
65 | UINT64 Reserved:8;\r | |
66 | } SnpPageStateChangeRequest;\r | |
67 | \r | |
68 | struct {\r | |
69 | UINT32 Function:12;\r | |
70 | UINT32 Reserved:20;\r | |
71 | UINT32 ErrorCode;\r | |
72 | } SnpPageStateChangeResponse;\r | |
73 | \r | |
a80e8878 TL |
74 | VOID *Ghcb;\r |
75 | \r | |
76 | UINT64 GhcbPhysicalAddress;\r | |
77 | } MSR_SEV_ES_GHCB_REGISTER;\r | |
78 | \r | |
f828fc98 BS |
79 | #define GHCB_INFO_SEV_INFO 1\r |
80 | #define GHCB_INFO_SEV_INFO_GET 2\r | |
81 | #define GHCB_INFO_CPUID_REQUEST 4\r | |
82 | #define GHCB_INFO_CPUID_RESPONSE 5\r | |
f0983b20 BS |
83 | #define GHCB_INFO_GHCB_GPA_REGISTER_REQUEST 18\r |
84 | #define GHCB_INFO_GHCB_GPA_REGISTER_RESPONSE 19\r | |
4665fa65 BS |
85 | #define GHCB_INFO_SNP_PAGE_STATE_CHANGE_REQUEST 20\r |
86 | #define GHCB_INFO_SNP_PAGE_STATE_CHANGE_RESPONSE 21\r | |
34e16ff8 BS |
87 | #define GHCB_HYPERVISOR_FEATURES_REQUEST 128\r |
88 | #define GHCB_HYPERVISOR_FEATURES_RESPONSE 129\r | |
f828fc98 | 89 | #define GHCB_INFO_TERMINATE_REQUEST 256\r |
a80e8878 TL |
90 | \r |
91 | #define GHCB_TERMINATE_GHCB 0\r | |
92 | #define GHCB_TERMINATE_GHCB_GENERAL 0\r | |
93 | #define GHCB_TERMINATE_GHCB_PROTOCOL 1\r | |
94 | \r | |
b15cbd9c BS |
95 | /**\r |
96 | Secure Encrypted Virtualization (SEV) status register\r | |
97 | \r | |
98 | **/\r | |
99 | #define MSR_SEV_STATUS 0xc0010131\r | |
100 | \r | |
101 | /**\r | |
102 | MSR information returned for #MSR_SEV_STATUS\r | |
103 | **/\r | |
104 | typedef union {\r | |
105 | ///\r | |
106 | /// Individual bit fields\r | |
107 | ///\r | |
108 | struct {\r | |
109 | ///\r | |
110 | /// [Bit 0] Secure Encrypted Virtualization (Sev) is enabled\r | |
111 | ///\r | |
112 | UINT32 SevBit:1;\r | |
113 | \r | |
114 | ///\r | |
115 | /// [Bit 1] Secure Encrypted Virtualization Encrypted State (SevEs) is enabled\r | |
116 | ///\r | |
117 | UINT32 SevEsBit:1;\r | |
118 | \r | |
0095070e BS |
119 | ///\r |
120 | /// [Bit 2] Secure Nested Paging (SevSnp) is enabled\r | |
121 | ///\r | |
122 | UINT32 SevSnpBit:1;\r | |
123 | \r | |
124 | UINT32 Reserved2:29;\r | |
b15cbd9c BS |
125 | } Bits;\r |
126 | ///\r | |
127 | /// All bit fields as a 32-bit value\r | |
128 | ///\r | |
129 | UINT32 Uint32;\r | |
130 | ///\r | |
131 | /// All bit fields as a 64-bit value\r | |
132 | ///\r | |
133 | UINT64 Uint64;\r | |
134 | } MSR_SEV_STATUS_REGISTER;\r | |
135 | \r | |
136 | #endif\r |