blob: 9c6e0b4e674165e3afb98b8286b4013292d011ee [file] [log] [blame]
Jeff Fan80c4b232017-04-05 16:33:16 +08001/** @file
2 CPU Common features library header file.
3
4 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13**/
14
15#ifndef _CPU_COMMON_FEATURES_H_
16#define _CPU_COMMON_FEATURES_H_
17
18#include <PiDxe.h>
19
20#include <Library/BaseLib.h>
21#include <Library/PcdLib.h>
22#include <Library/DebugLib.h>
23#include <Library/RegisterCpuFeaturesLib.h>
24#include <Library/BaseMemoryLib.h>
25#include <Library/MemoryAllocationLib.h>
26#include <Library/LocalApicLib.h>
27
28#include <Register/Cpuid.h>
29#include <Register/Msr.h>
30
31/**
32 Prepares for the data used by CPU feature detection and initialization.
33
34 @param[in] NumberOfProcessors The number of CPUs in the platform.
35
36 @return Pointer to a buffer of CPU related configuration data.
37
38 @note This service could be called by BSP only.
39**/
40VOID *
41EFIAPI
42AesniGetConfigData (
43 IN UINTN NumberOfProcessors
44 );
45
46/**
47 Detects if AESNI feature supported on current processor.
48
49 @param[in] ProcessorNumber The index of the CPU executing this function.
50 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
51 structure for the CPU executing this function.
52 @param[in] ConfigData A pointer to the configuration buffer returned
53 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
54 CPU_FEATURE_GET_CONFIG_DATA was not provided in
55 RegisterCpuFeature().
56
57 @retval TRUE AESNI feature is supported.
58 @retval FALSE AESNI feature is not supported.
59
60 @note This service could be called by BSP/APs.
61**/
62BOOLEAN
63EFIAPI
64AesniSupport (
65 IN UINTN ProcessorNumber,
66 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
67 IN VOID *ConfigData OPTIONAL
68 );
69
70/**
71 Initializes AESNI feature to specific state.
72
73 @param[in] ProcessorNumber The index of the CPU executing this function.
74 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
75 structure for the CPU executing this function.
76 @param[in] ConfigData A pointer to the configuration buffer returned
77 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
78 CPU_FEATURE_GET_CONFIG_DATA was not provided in
79 RegisterCpuFeature().
80 @param[in] State If TRUE, then the AESNI feature must be enabled.
81 If FALSE, then the AESNI feature must be disabled.
82
83 @retval RETURN_SUCCESS AESNI feature is initialized.
84
85 @note This service could be called by BSP only.
86**/
87RETURN_STATUS
88EFIAPI
89AesniInitialize (
90 IN UINTN ProcessorNumber,
91 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
92 IN VOID *ConfigData, OPTIONAL
93 IN BOOLEAN State
94 );
95
96/**
97 Detects if Clock Modulation feature supported on current processor.
98
99 @param[in] ProcessorNumber The index of the CPU executing this function.
100 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
101 structure for the CPU executing this function.
102 @param[in] ConfigData A pointer to the configuration buffer returned
103 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
104 CPU_FEATURE_GET_CONFIG_DATA was not provided in
105 RegisterCpuFeature().
106
107 @retval TRUE Clock Modulation feature is supported.
108 @retval FALSE Clock Modulation feature is not supported.
109
110 @note This service could be called by BSP/APs.
111**/
112BOOLEAN
113EFIAPI
114ClockModulationSupport (
115 IN UINTN ProcessorNumber,
116 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
117 IN VOID *ConfigData OPTIONAL
118 );
119
120/**
121 Initializes Clock Modulation feature to specific state.
122
123 @param[in] ProcessorNumber The index of the CPU executing this function.
124 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
125 structure for the CPU executing this function.
126 @param[in] ConfigData A pointer to the configuration buffer returned
127 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
128 CPU_FEATURE_GET_CONFIG_DATA was not provided in
129 RegisterCpuFeature().
130 @param[in] State If TRUE, then the Clock Modulation feature must be enabled.
131 If FALSE, then the Clock Modulation feature must be disabled.
132
133 @retval RETURN_SUCCESS Clock Modulation feature is initialized.
134
135 @note This service could be called by BSP only.
136**/
137RETURN_STATUS
138EFIAPI
139ClockModulationInitialize (
140 IN UINTN ProcessorNumber,
141 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
142 IN VOID *ConfigData, OPTIONAL
143 IN BOOLEAN State
144 );
145
146/**
147 Detects if Enhanced Intel SpeedStep feature supported on current processor.
148
149 @param[in] ProcessorNumber The index of the CPU executing this function.
150 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
151 structure for the CPU executing this function.
152 @param[in] ConfigData A pointer to the configuration buffer returned
153 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
154 CPU_FEATURE_GET_CONFIG_DATA was not provided in
155 RegisterCpuFeature().
156
157 @retval TRUE Enhanced Intel SpeedStep feature is supported.
158 @retval FALSE Enhanced Intel SpeedStep feature is not supported.
159
160 @note This service could be called by BSP/APs.
161**/
162BOOLEAN
163EFIAPI
164EistSupport (
165 IN UINTN ProcessorNumber,
166 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
167 IN VOID *ConfigData OPTIONAL
168 );
169
170/**
171 Initializes Enhanced Intel SpeedStep feature to specific state.
172
173 @param[in] ProcessorNumber The index of the CPU executing this function.
174 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
175 structure for the CPU executing this function.
176 @param[in] ConfigData A pointer to the configuration buffer returned
177 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
178 CPU_FEATURE_GET_CONFIG_DATA was not provided in
179 RegisterCpuFeature().
180 @param[in] State If TRUE, then the Enhanced Intel SpeedStep feature
181 must be enabled.
182 If FALSE, then the Enhanced Intel SpeedStep feature
183 must be disabled.
184
185 @retval RETURN_SUCCESS Enhanced Intel SpeedStep feature is initialized.
186
187 @note This service could be called by BSP only.
188**/
189RETURN_STATUS
190EFIAPI
191EistInitialize (
192 IN UINTN ProcessorNumber,
193 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
194 IN VOID *ConfigData, OPTIONAL
195 IN BOOLEAN State
196 );
197
198/**
199 Detects if Execute Disable feature supported on current processor.
200
201 @param[in] ProcessorNumber The index of the CPU executing this function.
202 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
203 structure for the CPU executing this function.
204 @param[in] ConfigData A pointer to the configuration buffer returned
205 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
206 CPU_FEATURE_GET_CONFIG_DATA was not provided in
207 RegisterCpuFeature().
208
209 @retval TRUE Execute Disable feature is supported.
210 @retval FALSE Execute Disable feature is not supported.
211
212 @note This service could be called by BSP/APs.
213**/
214BOOLEAN
215EFIAPI
216ExecuteDisableSupport (
217 IN UINTN ProcessorNumber,
218 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
219 IN VOID *ConfigData OPTIONAL
220 );
221
222/**
223 Initializes Execute Disable feature to specific state.
224
225 @param[in] ProcessorNumber The index of the CPU executing this function.
226 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
227 structure for the CPU executing this function.
228 @param[in] ConfigData A pointer to the configuration buffer returned
229 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
230 CPU_FEATURE_GET_CONFIG_DATA was not provided in
231 RegisterCpuFeature().
232 @param[in] State If TRUE, then the Execute Disable feature must be enabled.
233 If FALSE, then the Execute Disable feature must be disabled.
234
235 @retval RETURN_SUCCESS Execute Disable feature is initialized.
236
237 @note This service could be called by BSP only.
238**/
239RETURN_STATUS
240EFIAPI
241ExecuteDisableInitialize (
242 IN UINTN ProcessorNumber,
243 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
244 IN VOID *ConfigData, OPTIONAL
245 IN BOOLEAN State
246 );
247
248/**
249 Initializes Fast-Strings feature to specific state.
250
251 @param[in] ProcessorNumber The index of the CPU executing this function.
252 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
253 structure for the CPU executing this function.
254 @param[in] ConfigData A pointer to the configuration buffer returned
255 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
256 CPU_FEATURE_GET_CONFIG_DATA was not provided in
257 RegisterCpuFeature().
258 @param[in] State If TRUE, then the Fast-Strings feature must be enabled.
259 If FALSE, then the Fast-Strings feature must be disabled.
260
261 @retval RETURN_SUCCESS Fast-Strings feature is initialized.
262
263 @note This service could be called by BSP only.
264**/
265RETURN_STATUS
266EFIAPI
267FastStringsInitialize (
268 IN UINTN ProcessorNumber,
269 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
270 IN VOID *ConfigData, OPTIONAL
271 IN BOOLEAN State
272 );
273
274/**
275 Detects if MONITOR/MWAIT feature supported on current processor.
276
277 @param[in] ProcessorNumber The index of the CPU executing this function.
278 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
279 structure for the CPU executing this function.
280 @param[in] ConfigData A pointer to the configuration buffer returned
281 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
282 CPU_FEATURE_GET_CONFIG_DATA was not provided in
283 RegisterCpuFeature().
284
285 @retval TRUE MONITOR/MWAIT feature is supported.
286 @retval FALSE MONITOR/MWAIT feature is not supported.
287
288 @note This service could be called by BSP/APs.
289**/
290BOOLEAN
291EFIAPI
292MonitorMwaitSupport (
293 IN UINTN ProcessorNumber,
294 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
295 IN VOID *ConfigData OPTIONAL
296 );
297
298/**
299 Initializes MONITOR/MWAIT feature to specific state.
300
301 @param[in] ProcessorNumber The index of the CPU executing this function.
302 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
303 structure for the CPU executing this function.
304 @param[in] ConfigData A pointer to the configuration buffer returned
305 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
306 CPU_FEATURE_GET_CONFIG_DATA was not provided in
307 RegisterCpuFeature().
308 @param[in] State If TRUE, then the MONITOR/MWAIT feature must be enabled.
309 If FALSE, then the MONITOR/MWAIT feature must be disabled.
310
311 @retval RETURN_SUCCESS MONITOR/MWAIT feature is initialized.
312
313 @note This service could be called by BSP only.
314**/
315RETURN_STATUS
316EFIAPI
317MonitorMwaitInitialize (
318 IN UINTN ProcessorNumber,
319 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
320 IN VOID *ConfigData, OPTIONAL
321 IN BOOLEAN State
322 );
323
324/**
325 Detects if VMX feature supported on current processor.
326
327 @param[in] ProcessorNumber The index of the CPU executing this function.
328 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
329 structure for the CPU executing this function.
330 @param[in] ConfigData A pointer to the configuration buffer returned
331 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
332 CPU_FEATURE_GET_CONFIG_DATA was not provided in
333 RegisterCpuFeature().
334
335 @retval TRUE VMX feature is supported.
336 @retval FALSE VMX feature is not supported.
337
338 @note This service could be called by BSP/APs.
339**/
340BOOLEAN
341EFIAPI
342VmxSupport (
343 IN UINTN ProcessorNumber,
344 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
345 IN VOID *ConfigData OPTIONAL
346 );
347
348/**
Eric Donga7bf24e2017-07-11 10:07:36 +0800349 Initializes VMX feature to specific state.
Jeff Fan80c4b232017-04-05 16:33:16 +0800350
351 @param[in] ProcessorNumber The index of the CPU executing this function.
352 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
353 structure for the CPU executing this function.
354 @param[in] ConfigData A pointer to the configuration buffer returned
355 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
356 CPU_FEATURE_GET_CONFIG_DATA was not provided in
357 RegisterCpuFeature().
Eric Donga7bf24e2017-07-11 10:07:36 +0800358 @param[in] State If TRUE, then the VMX feature must be enabled.
359 If FALSE, then the VMX feature must be disabled.
Jeff Fan80c4b232017-04-05 16:33:16 +0800360
Eric Donga7bf24e2017-07-11 10:07:36 +0800361 @retval RETURN_SUCCESS VMX feature is initialized.
Jeff Fan80c4b232017-04-05 16:33:16 +0800362
363 @note This service could be called by BSP only.
364**/
365RETURN_STATUS
366EFIAPI
Eric Donga7bf24e2017-07-11 10:07:36 +0800367VmxInitialize (
Jeff Fan80c4b232017-04-05 16:33:16 +0800368 IN UINTN ProcessorNumber,
369 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
370 IN VOID *ConfigData, OPTIONAL
371 IN BOOLEAN State
372 );
373
374/**
375 Detects if Lock Feature Control Register feature supported on current processor.
376
377 @param[in] ProcessorNumber The index of the CPU executing this function.
378 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
379 structure for the CPU executing this function.
380 @param[in] ConfigData A pointer to the configuration buffer returned
381 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
382 CPU_FEATURE_GET_CONFIG_DATA was not provided in
383 RegisterCpuFeature().
384
385 @retval TRUE Lock Feature Control Register feature is supported.
386 @retval FALSE Lock Feature Control Register feature is not supported.
387
388 @note This service could be called by BSP/APs.
389**/
390BOOLEAN
391EFIAPI
392LockFeatureControlRegisterSupport (
393 IN UINTN ProcessorNumber,
394 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
395 IN VOID *ConfigData OPTIONAL
396 );
397
398/**
399 Initializes Lock Feature Control Register feature to specific state.
400
401 @param[in] ProcessorNumber The index of the CPU executing this function.
402 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
403 structure for the CPU executing this function.
404 @param[in] ConfigData A pointer to the configuration buffer returned
405 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
406 CPU_FEATURE_GET_CONFIG_DATA was not provided in
407 RegisterCpuFeature().
408 @param[in] State If TRUE, then the Lock Feature Control Register feature must be enabled.
409 If FALSE, then the Lock Feature Control Register feature must be disabled.
410
411 @retval RETURN_SUCCESS Lock Feature Control Register feature is initialized.
412
413 @note This service could be called by BSP only.
414**/
415RETURN_STATUS
416EFIAPI
417LockFeatureControlRegisterInitialize (
418 IN UINTN ProcessorNumber,
419 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
420 IN VOID *ConfigData, OPTIONAL
421 IN BOOLEAN State
422 );
423
424/**
425 Detects if SMX feature supported on current processor.
426
427 @param[in] ProcessorNumber The index of the CPU executing this function.
428 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
429 structure for the CPU executing this function.
430 @param[in] ConfigData A pointer to the configuration buffer returned
431 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
432 CPU_FEATURE_GET_CONFIG_DATA was not provided in
433 RegisterCpuFeature().
434
435 @retval TRUE SMX feature is supported.
436 @retval FALSE SMX feature is not supported.
437
438 @note This service could be called by BSP/APs.
439**/
440BOOLEAN
441EFIAPI
442SmxSupport (
443 IN UINTN ProcessorNumber,
444 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
445 IN VOID *ConfigData OPTIONAL
446 );
447
448/**
Eric Donga7bf24e2017-07-11 10:07:36 +0800449 Initializes SMX feature to specific state.
Jeff Fan80c4b232017-04-05 16:33:16 +0800450
451 @param[in] ProcessorNumber The index of the CPU executing this function.
452 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
453 structure for the CPU executing this function.
454 @param[in] ConfigData A pointer to the configuration buffer returned
455 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
456 CPU_FEATURE_GET_CONFIG_DATA was not provided in
457 RegisterCpuFeature().
Eric Donga7bf24e2017-07-11 10:07:36 +0800458 @param[in] State If TRUE, then SMX feature must be enabled.
459 If FALSE, then SMX feature must be disabled.
Jeff Fan80c4b232017-04-05 16:33:16 +0800460
Eric Donga7bf24e2017-07-11 10:07:36 +0800461 @retval RETURN_SUCCESS SMX feature is initialized.
462 @retval RETURN_UNSUPPORTED VMX not initialized.
Jeff Fan80c4b232017-04-05 16:33:16 +0800463
464 @note This service could be called by BSP only.
465**/
466RETURN_STATUS
467EFIAPI
Eric Donga7bf24e2017-07-11 10:07:36 +0800468SmxInitialize (
Jeff Fan80c4b232017-04-05 16:33:16 +0800469 IN UINTN ProcessorNumber,
470 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
471 IN VOID *ConfigData, OPTIONAL
472 IN BOOLEAN State
473 );
474
475/**
476 Detects if LimitCpuidMaxval feature supported on current processor.
477
478 @param[in] ProcessorNumber The index of the CPU executing this function.
479 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
480 structure for the CPU executing this function.
481 @param[in] ConfigData A pointer to the configuration buffer returned
482 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
483 CPU_FEATURE_GET_CONFIG_DATA was not provided in
484 RegisterCpuFeature().
485
486 @retval TRUE LimitCpuidMaxval feature is supported.
487 @retval FALSE LimitCpuidMaxval feature is not supported.
488
489 @note This service could be called by BSP/APs.
490**/
491BOOLEAN
492EFIAPI
493LimitCpuidMaxvalSupport (
494 IN UINTN ProcessorNumber,
495 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
496 IN VOID *ConfigData OPTIONAL
497 );
498
499/**
500 Initializes LimitCpuidMaxval feature to specific state.
501
502 @param[in] ProcessorNumber The index of the CPU executing this function.
503 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
504 structure for the CPU executing this function.
505 @param[in] ConfigData A pointer to the configuration buffer returned
506 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
507 CPU_FEATURE_GET_CONFIG_DATA was not provided in
508 RegisterCpuFeature().
509 @param[in] State If TRUE, then the LimitCpuidMaxval feature must be enabled.
510 If FALSE, then the LimitCpuidMaxval feature must be disabled.
511
512 @retval RETURN_SUCCESS LimitCpuidMaxval feature is initialized.
513
514 @note This service could be called by BSP only.
515**/
516RETURN_STATUS
517EFIAPI
518LimitCpuidMaxvalInitialize (
519 IN UINTN ProcessorNumber,
520 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
521 IN VOID *ConfigData, OPTIONAL
522 IN BOOLEAN State
523 );
524
525/**
526 Detects if Machine Check Exception feature supported on current processor.
527
528 @param[in] ProcessorNumber The index of the CPU executing this function.
529 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
530 structure for the CPU executing this function.
531 @param[in] ConfigData A pointer to the configuration buffer returned
532 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
533 CPU_FEATURE_GET_CONFIG_DATA was not provided in
534 RegisterCpuFeature().
535
536 @retval TRUE Machine Check Exception feature is supported.
537 @retval FALSE Machine Check Exception feature is not supported.
538
539 @note This service could be called by BSP/APs.
540**/
541BOOLEAN
542EFIAPI
543MceSupport (
544 IN UINTN ProcessorNumber,
545 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
546 IN VOID *ConfigData OPTIONAL
547 );
548
549/**
550 Initializes Machine Check Exception feature to specific state.
551
552 @param[in] ProcessorNumber The index of the CPU executing this function.
553 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
554 structure for the CPU executing this function.
555 @param[in] ConfigData A pointer to the configuration buffer returned
556 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
557 CPU_FEATURE_GET_CONFIG_DATA was not provided in
558 RegisterCpuFeature().
559 @param[in] State If TRUE, then the Machine Check Exception feature must be enabled.
560 If FALSE, then the Machine Check Exception feature must be disabled.
561
562 @retval RETURN_SUCCESS Machine Check Exception feature is initialized.
563
564 @note This service could be called by BSP only.
565**/
566RETURN_STATUS
567EFIAPI
568MceInitialize (
569 IN UINTN ProcessorNumber,
570 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
571 IN VOID *ConfigData, OPTIONAL
572 IN BOOLEAN State
573 );
574
575/**
576 Detects if Machine Check Architecture feature supported on current processor.
577
578 @param[in] ProcessorNumber The index of the CPU executing this function.
579 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
580 structure for the CPU executing this function.
581 @param[in] ConfigData A pointer to the configuration buffer returned
582 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
583 CPU_FEATURE_GET_CONFIG_DATA was not provided in
584 RegisterCpuFeature().
585
586 @retval TRUE Machine Check Architecture feature is supported.
587 @retval FALSE Machine Check Architecture feature is not supported.
588
589 @note This service could be called by BSP/APs.
590**/
591BOOLEAN
592EFIAPI
593McaSupport (
594 IN UINTN ProcessorNumber,
595 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
596 IN VOID *ConfigData OPTIONAL
597 );
598
599/**
600 Initializes Machine Check Architecture feature to specific state.
601
602 @param[in] ProcessorNumber The index of the CPU executing this function.
603 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
604 structure for the CPU executing this function.
605 @param[in] ConfigData A pointer to the configuration buffer returned
606 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
607 CPU_FEATURE_GET_CONFIG_DATA was not provided in
608 RegisterCpuFeature().
609 @param[in] State If TRUE, then the Machine Check Architecture feature must be enabled.
610 If FALSE, then the Machine Check Architecture feature must be disabled.
611
612 @retval RETURN_SUCCESS Machine Check Architecture feature is initialized.
613
614 @note This service could be called by BSP only.
615**/
616RETURN_STATUS
617EFIAPI
618McaInitialize (
619 IN UINTN ProcessorNumber,
620 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
621 IN VOID *ConfigData, OPTIONAL
622 IN BOOLEAN State
623 );
624
625/**
626 Detects if IA32_MCG_CTL feature supported on current processor.
627
628 @param[in] ProcessorNumber The index of the CPU executing this function.
629 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
630 structure for the CPU executing this function.
631 @param[in] ConfigData A pointer to the configuration buffer returned
632 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
633 CPU_FEATURE_GET_CONFIG_DATA was not provided in
634 RegisterCpuFeature().
635
636 @retval TRUE IA32_MCG_CTL feature is supported.
637 @retval FALSE IA32_MCG_CTL feature is not supported.
638
639 @note This service could be called by BSP/APs.
640**/
641BOOLEAN
642EFIAPI
643McgCtlSupport (
644 IN UINTN ProcessorNumber,
645 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
646 IN VOID *ConfigData OPTIONAL
647 );
648
649/**
650 Initializes IA32_MCG_CTL feature to specific state.
651
652 @param[in] ProcessorNumber The index of the CPU executing this function.
653 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
654 structure for the CPU executing this function.
655 @param[in] ConfigData A pointer to the configuration buffer returned
656 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
657 CPU_FEATURE_GET_CONFIG_DATA was not provided in
658 RegisterCpuFeature().
659 @param[in] State If TRUE, then the IA32_MCG_CTL feature must be enabled.
660 If FALSE, then the IA32_MCG_CTL feature must be disabled.
661
662 @retval RETURN_SUCCESS IA32_MCG_CTL feature is initialized.
663
664 @note This service could be called by BSP only.
665**/
666RETURN_STATUS
667EFIAPI
668McgCtlInitialize (
669 IN UINTN ProcessorNumber,
670 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
671 IN VOID *ConfigData, OPTIONAL
672 IN BOOLEAN State
673 );
674
675/**
676 Detects if Pending Break feature supported on current processor.
677
678 @param[in] ProcessorNumber The index of the CPU executing this function.
679 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
680 structure for the CPU executing this function.
681 @param[in] ConfigData A pointer to the configuration buffer returned
682 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
683 CPU_FEATURE_GET_CONFIG_DATA was not provided in
684 RegisterCpuFeature().
685
686 @retval TRUE Pending Break feature is supported.
687 @retval FALSE Pending Break feature is not supported.
688
689 @note This service could be called by BSP/APs.
690**/
691BOOLEAN
692EFIAPI
693PendingBreakSupport (
694 IN UINTN ProcessorNumber,
695 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
696 IN VOID *ConfigData OPTIONAL
697 );
698
699/**
700 Initializes Pending Break feature to specific state.
701
702 @param[in] ProcessorNumber The index of the CPU executing this function.
703 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
704 structure for the CPU executing this function.
705 @param[in] ConfigData A pointer to the configuration buffer returned
706 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
707 CPU_FEATURE_GET_CONFIG_DATA was not provided in
708 RegisterCpuFeature().
709 @param[in] State If TRUE, then the Pending Break feature must be enabled.
710 If FALSE, then the Pending Break feature must be disabled.
711
712 @retval RETURN_SUCCESS Pending Break feature is initialized.
713
714 @note This service could be called by BSP only.
715**/
716RETURN_STATUS
717EFIAPI
718PendingBreakInitialize (
719 IN UINTN ProcessorNumber,
720 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
721 IN VOID *ConfigData, OPTIONAL
722 IN BOOLEAN State
723 );
724
725/**
726 Detects if C1E feature supported on current processor.
727
728 @param[in] ProcessorNumber The index of the CPU executing this function.
729 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
730 structure for the CPU executing this function.
731 @param[in] ConfigData A pointer to the configuration buffer returned
732 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
733 CPU_FEATURE_GET_CONFIG_DATA was not provided in
734 RegisterCpuFeature().
735
736 @retval TRUE C1E feature is supported.
737 @retval FALSE C1E feature is not supported.
738
739 @note This service could be called by BSP/APs.
740**/
741BOOLEAN
742EFIAPI
743C1eSupport (
744 IN UINTN ProcessorNumber,
745 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
746 IN VOID *ConfigData OPTIONAL
747 );
748
749/**
750 Initializes C1E feature to specific state.
751
752 @param[in] ProcessorNumber The index of the CPU executing this function.
753 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
754 structure for the CPU executing this function.
755 @param[in] ConfigData A pointer to the configuration buffer returned
756 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
757 CPU_FEATURE_GET_CONFIG_DATA was not provided in
758 RegisterCpuFeature().
759 @param[in] State If TRUE, then the C1E feature must be enabled.
760 If FALSE, then the C1E feature must be disabled.
761
762 @retval RETURN_SUCCESS C1E feature is initialized.
763
764 @note This service could be called by BSP only.
765**/
766RETURN_STATUS
767EFIAPI
768C1eInitialize (
769 IN UINTN ProcessorNumber,
770 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
771 IN VOID *ConfigData, OPTIONAL
772 IN BOOLEAN State
773 );
774
775/**
Jeff Fandc834fb2017-05-24 13:45:25 +0800776 Prepares for the data used by CPU feature detection and initialization.
777
778 @param[in] NumberOfProcessors The number of CPUs in the platform.
779
780 @return Pointer to a buffer of CPU related configuration data.
781
782 @note This service could be called by BSP only.
783**/
784VOID *
785EFIAPI
786X2ApicGetConfigData (
787 IN UINTN NumberOfProcessors
788 );
789
790/**
Jeff Fan80c4b232017-04-05 16:33:16 +0800791 Detects if X2Apci feature supported on current processor.
792
793 Detect if X2Apci has been already enabled.
794
795 @param[in] ProcessorNumber The index of the CPU executing this function.
796 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
797 structure for the CPU executing this function.
798 @param[in] ConfigData A pointer to the configuration buffer returned
799 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
800 CPU_FEATURE_GET_CONFIG_DATA was not provided in
801 RegisterCpuFeature().
802
803 @retval TRUE X2Apci feature is supported.
804 @retval FALSE X2Apci feature is not supported.
805
806 @note This service could be called by BSP/APs.
807**/
808BOOLEAN
809EFIAPI
810X2ApicSupport (
811 IN UINTN ProcessorNumber,
812 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
813 IN VOID *ConfigData OPTIONAL
814 );
815
816/**
817 Initializes X2Apci feature to specific state.
818
819 @param[in] ProcessorNumber The index of the CPU executing this function.
820 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
821 structure for the CPU executing this function.
822 @param[in] ConfigData A pointer to the configuration buffer returned
823 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
824 CPU_FEATURE_GET_CONFIG_DATA was not provided in
825 RegisterCpuFeature().
826 @param[in] State If TRUE, then the X2Apci feature must be enabled.
827 If FALSE, then the X2Apci feature must be disabled.
828
829 @retval RETURN_SUCCESS X2Apci feature is initialized.
830
831 @note This service could be called by BSP only.
832**/
833RETURN_STATUS
834EFIAPI
835X2ApicInitialize (
836 IN UINTN ProcessorNumber,
837 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
838 IN VOID *ConfigData, OPTIONAL
839 IN BOOLEAN State
840 );
841
842/**
843 Prepares for the data used by CPU feature detection and initialization.
844
845 @param[in] NumberOfProcessors The number of CPUs in the platform.
846
847 @return Pointer to a buffer of CPU related configuration data.
848
849 @note This service could be called by BSP only.
850**/
851VOID *
852EFIAPI
853FeatureControlGetConfigData (
854 IN UINTN NumberOfProcessors
855 );
856
857#endif