aboutsummaryrefslogtreecommitdiffstats
path: root/MdePkg/Include/Register/Intel/Msr/GoldmontPlusMsr.h
blob: 95e7de91dfed33f29557d47a39eb209c63741f76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
/** @file
  MSR Definitions for Intel Atom processors based on the Goldmont Plus microarchitecture.

  Provides defines for Machine Specific Registers(MSR) indexes. Data structures
  are provided for MSRs that contain one or more bit fields.  If the MSR value
  returned is a single 32-bit or 64-bit value, then a data structure is not
  provided for that MSR.

  Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
  SPDX-License-Identifier: BSD-2-Clause-Patent

  @par Specification Reference:
  Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Volume 4,
  May 2018, Volume 4: Model-Specific-Registers (MSR)

**/

#ifndef __GOLDMONT_PLUS_MSR_H__
#define __GOLDMONT_PLUS_MSR_H__

#include <Register/Intel/ArchitecturalMsr.h>

/**
  Is Intel Atom processors based on the Goldmont plus microarchitecture?

  @param   DisplayFamily  Display Family ID
  @param   DisplayModel   Display Model ID

  @retval  TRUE   Yes, it is.
  @retval  FALSE  No, it isn't.
**/
#define IS_GOLDMONT_PLUS_PROCESSOR(DisplayFamily, DisplayModel) \
  (DisplayFamily == 0x06 && \
   (                        \
    DisplayModel == 0x7A    \
    )                       \
   )

/**
  Core. (R/W) See Table 2-2. See Section 18.6.2.4, "Processor Event Based
  Sampling (PEBS).".

  @param  ECX  MSR_GOLDMONT_PLUS_PEBS_ENABLE (0x000003F1)
  @param  EAX  Lower 32-bits of MSR value.
               Described by the type MSR_GOLDMONT_PLUS_PEBS_ENABLE_REGISTER.
  @param  EDX  Upper 32-bits of MSR value.
               Described by the type MSR_GOLDMONT_PLUS_PEBS_ENABLE_REGISTER.

  <b>Example usage</b>
  @code
  MSR_GOLDMONT_PLUS_PEBS_ENABLE_REGISTER  Msr;

  Msr.Uint64 = AsmReadMsr64 (MSR_GOLDMONT_PLUS_PEBS_ENABLE);
  AsmWriteMsr64 (MSR_GOLDMONT_PLUS_PEBS_ENABLE, Msr.Uint64);
  @endcode
**/
#define MSR_GOLDMONT_PLUS_PEBS_ENABLE            0x000003F1

/**
  MSR information returned for MSR index #MSR_GOLDMONT_PLUS_PEBS_ENABLE
**/
typedef union {
  ///
  /// Individual bit fields
  ///
  struct {
    ///
    /// [Bit 0] Enable PEBS trigger and recording for the programmed event
    /// (precise or otherwise) on IA32_PMC0.
    ///
    UINT32  Fix_Me_1:1;
    ///
    /// [Bit 1] Enable PEBS trigger and recording for the programmed event
    /// (precise or otherwise) on IA32_PMC1.
    ///
    UINT32  Fix_Me_2:1;
    ///
    /// [Bit 2] Enable PEBS trigger and recording for the programmed event
    /// (precise or otherwise) on IA32_PMC2.
    ///
    UINT32  Fix_Me_3:1;
    ///
    /// [Bit 3] Enable PEBS trigger and recording for the programmed event
    /// (precise or otherwise) on IA32_PMC3.
    ///
    UINT32  Fix_Me_4:1;
    UINT32  Reserved1:28;
    ///
    /// [Bit 32] Enable PEBS trigger and recording for IA32_FIXED_CTR0.
    ///
    UINT32  Fix_Me_5:1;
    ///
    /// [Bit 33] Enable PEBS trigger and recording for IA32_FIXED_CTR1.
    ///
    UINT32  Fix_Me_6:1;
    ///
    /// [Bit 34] Enable PEBS trigger and recording for IA32_FIXED_CTR2.
    ///
    UINT32  Fix_Me_7:1;
    UINT32  Reserved2:29;
  } Bits;
  ///
  /// All bit fields as a 64-bit value
  ///
  UINT64  Uint64;
} MSR_GOLDMONT_PLUS_PEBS_ENABLE_REGISTER;


/**
  Core. Last Branch Record N From IP (R/W) One of the three MSRs that make up
  the first entry of the 32-entry LBR stack. The From_IP part of the stack
  contains pointers to the source instruction. See also: -  Last Branch Record
  Stack TOS at 1C9H. -  Section 17.7, "Last Branch, Call Stack, Interrupt, and
  .. Exception Recording for Processors based on Goldmont Plus
  Microarchitecture.".

  @param  ECX  MSR_GOLDMONT_PLUS_LASTBRANCH_N_FROM_IP (0x0000068N)
  @param  EAX  Lower 32-bits of MSR value.
  @param  EDX  Upper 32-bits of MSR value.

  <b>Example usage</b>
  @code
  UINT64  Msr;

  Msr = AsmReadMsr64 (MSR_GOLDMONT_PLUS_LASTBRANCH_N_FROM_IP);
  AsmWriteMsr64 (MSR_GOLDMONT_PLUS_LASTBRANCH_N_FROM_IP, Msr);
  @endcode
**/
#define MSR_GOLDMONT_PLUS_LASTBRANCH_0_FROM_IP    0x00000680
#define MSR_GOLDMONT_PLUS_LASTBRANCH_1_FROM_IP    0x00000681
#define MSR_GOLDMONT_PLUS_LASTBRANCH_2_FROM_IP    0x00000682
#define MSR_GOLDMONT_PLUS_LASTBRANCH_3_FROM_IP    0x00000683
#define MSR_GOLDMONT_PLUS_LASTBRANCH_4_FROM_IP    0x00000684
#define MSR_GOLDMONT_PLUS_LASTBRANCH_5_FROM_IP    0x00000685
#define MSR_GOLDMONT_PLUS_LASTBRANCH_6_FROM_IP    0x00000686
#define MSR_GOLDMONT_PLUS_LASTBRANCH_7_FROM_IP    0x00000687
#define MSR_GOLDMONT_PLUS_LASTBRANCH_8_FROM_IP    0x00000688
#define MSR_GOLDMONT_PLUS_LASTBRANCH_9_FROM_IP    0x00000689
#define MSR_GOLDMONT_PLUS_LASTBRANCH_10_FROM_IP   0x0000068A
#define MSR_GOLDMONT_PLUS_LASTBRANCH_11_FROM_IP   0x0000068B
#define MSR_GOLDMONT_PLUS_LASTBRANCH_12_FROM_IP   0x0000068C
#define MSR_GOLDMONT_PLUS_LASTBRANCH_13_FROM_IP   0x0000068D
#define MSR_GOLDMONT_PLUS_LASTBRANCH_14_FROM_IP   0x0000068E
#define MSR_GOLDMONT_PLUS_LASTBRANCH_15_FROM_IP   0x0000068F
#define MSR_GOLDMONT_PLUS_LASTBRANCH_16_FROM_IP   0x00000690
#define MSR_GOLDMONT_PLUS_LASTBRANCH_17_FROM_IP   0x00000691
#define MSR_GOLDMONT_PLUS_LASTBRANCH_18_FROM_IP   0x00000692
#define MSR_GOLDMONT_PLUS_LASTBRANCH_19_FROM_IP   0x00000693
#define MSR_GOLDMONT_PLUS_LASTBRANCH_20_FROM_IP   0x00000694
#define MSR_GOLDMONT_PLUS_LASTBRANCH_21_FROM_IP   0x00000695
#define MSR_GOLDMONT_PLUS_LASTBRANCH_22_FROM_IP   0x00000696
#define MSR_GOLDMONT_PLUS_LASTBRANCH_23_FROM_IP   0x00000697
#define MSR_GOLDMONT_PLUS_LASTBRANCH_24_FROM_IP   0x00000698
#define MSR_GOLDMONT_PLUS_LASTBRANCH_25_FROM_IP   0x00000699
#define MSR_GOLDMONT_PLUS_LASTBRANCH_26_FROM_IP   0x0000069A
#define MSR_GOLDMONT_PLUS_LASTBRANCH_27_FROM_IP   0x0000069B
#define MSR_GOLDMONT_PLUS_LASTBRANCH_28_FROM_IP   0x0000069C
#define MSR_GOLDMONT_PLUS_LASTBRANCH_29_FROM_IP   0x0000069D
#define MSR_GOLDMONT_PLUS_LASTBRANCH_30_FROM_IP   0x0000069E
#define MSR_GOLDMONT_PLUS_LASTBRANCH_31_FROM_IP   0x0000069F

/**
  Core. Last Branch Record N To IP (R/W) One of the three MSRs that make up
  the first entry of the 32-entry LBR stack. The To_IP part of the stack
  contains pointers to the Destination instruction. See also: - Section 17.7,
  "Last Branch, Call Stack, Interrupt, and Exception Recording for Processors
  based on Goldmont Plus Microarchitecture.".

  @param  ECX  MSR_GOLDMONT_PLUS_LASTBRANCH_N_TO_IP (0x000006C0)
  @param  EAX  Lower 32-bits of MSR value.
  @param  EDX  Upper 32-bits of MSR value.

  <b>Example usage</b>
  @code
  UINT64  Msr;

  Msr = AsmReadMsr64 (MSR_GOLDMONT_PLUS_LASTBRANCH_N_TO_IP);
  AsmWriteMsr64 (MSR_GOLDMONT_PLUS_LASTBRANCH_N_TO_IP, Msr);
  @endcode
**/
#define MSR_GOLDMONT_PLUS_LASTBRANCH_0_TO_IP      0x000006C0
#define MSR_GOLDMONT_PLUS_LASTBRANCH_1_TO_IP      0x000006C1
#define MSR_GOLDMONT_PLUS_LASTBRANCH_2_TO_IP      0x000006C2
#define MSR_GOLDMONT_PLUS_LASTBRANCH_3_TO_IP      0x000006C3
#define MSR_GOLDMONT_PLUS_LASTBRANCH_4_TO_IP      0x000006C4
#define MSR_GOLDMONT_PLUS_LASTBRANCH_5_TO_IP      0x000006C5
#define MSR_GOLDMONT_PLUS_LASTBRANCH_6_TO_IP      0x000006C6
#define MSR_GOLDMONT_PLUS_LASTBRANCH_7_TO_IP      0x000006C7
#define MSR_GOLDMONT_PLUS_LASTBRANCH_8_TO_IP      0x000006C8
#define MSR_GOLDMONT_PLUS_LASTBRANCH_9_TO_IP      0x000006C9
#define MSR_GOLDMONT_PLUS_LASTBRANCH_10_TO_IP     0x000006CA
#define MSR_GOLDMONT_PLUS_LASTBRANCH_11_TO_IP     0x000006CB
#define MSR_GOLDMONT_PLUS_LASTBRANCH_12_TO_IP     0x000006CC
#define MSR_GOLDMONT_PLUS_LASTBRANCH_13_TO_IP     0x000006CD
#define MSR_GOLDMONT_PLUS_LASTBRANCH_14_TO_IP     0x000006CE
#define MSR_GOLDMONT_PLUS_LASTBRANCH_15_TO_IP     0x000006CF
#define MSR_GOLDMONT_PLUS_LASTBRANCH_16_TO_IP     0x000006D0
#define MSR_GOLDMONT_PLUS_LASTBRANCH_17_TO_IP     0x000006D1
#define MSR_GOLDMONT_PLUS_LASTBRANCH_18_TO_IP     0x000006D2
#define MSR_GOLDMONT_PLUS_LASTBRANCH_19_TO_IP     0x000006D3
#define MSR_GOLDMONT_PLUS_LASTBRANCH_20_TO_IP     0x000006D4
#define MSR_GOLDMONT_PLUS_LASTBRANCH_21_TO_IP     0x000006D5
#define MSR_GOLDMONT_PLUS_LASTBRANCH_22_TO_IP     0x000006D6
#define MSR_GOLDMONT_PLUS_LASTBRANCH_23_TO_IP     0x000006D7
#define MSR_GOLDMONT_PLUS_LASTBRANCH_24_TO_IP     0x000006D8
#define MSR_GOLDMONT_PLUS_LASTBRANCH_25_TO_IP     0x000006D9
#define MSR_GOLDMONT_PLUS_LASTBRANCH_26_TO_IP     0x000006DA
#define MSR_GOLDMONT_PLUS_LASTBRANCH_27_TO_IP     0x000006DB
#define MSR_GOLDMONT_PLUS_LASTBRANCH_28_TO_IP     0x000006DC
#define MSR_GOLDMONT_PLUS_LASTBRANCH_29_TO_IP     0x000006DD
#define MSR_GOLDMONT_PLUS_LASTBRANCH_30_TO_IP     0x000006DE
#define MSR_GOLDMONT_PLUS_LASTBRANCH_31_TO_IP     0x000006DF


/**
  Core. Last Branch Record N Additional Information (R/W) One of the three
  MSRs that make up the first entry of the 32-entry LBR stack. This part of
  the stack contains flag and elapsed cycle information. See also: -  Last
  Branch Record Stack TOS at 1C9H. -  Section 17.9.1, "LBR Stack.".

  @param  ECX  MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_N (0x00000DCN)
  @param  EAX  Lower 32-bits of MSR value.
  @param  EDX  Upper 32-bits of MSR value.

  <b>Example usage</b>
  @code
  UINT64  Msr;

  Msr = AsmReadMsr64 (MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_N);
  AsmWriteMsr64 (MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_N, Msr);
  @endcode
**/
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_0      0x00000DC0
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_1      0x00000DC1
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_2      0x00000DC2
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_3      0x00000DC3
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_4      0x00000DC4
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_5      0x00000DC5
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_6      0x00000DC6
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_7      0x00000DC7
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_8      0x00000DC8
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_9      0x00000DC9
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_10     0x00000DCA
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_11     0x00000DCB
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_12     0x00000DCC
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_13     0x00000DCD
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_14     0x00000DCE
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_15     0x00000DCF
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_16     0x00000DD0
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_17     0x00000DD1
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_18     0x00000DD2
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_19     0x00000DD3
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_20     0x00000DD4
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_21     0x00000DD5
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_22     0x00000DD6
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_23     0x00000DD7
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_24     0x00000DD8
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_25     0x00000DD9
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_26     0x00000DDA
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_27     0x00000DDB
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_28     0x00000DDC
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_29     0x00000DDD
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_30     0x00000DDE
#define MSR_GOLDMONT_PLUS_LASTBRANCH_INFO_31     0x00000DDF

#endif