]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h
UefiCpuPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / UefiCpuPkg / Library / CpuCommonFeaturesLib / CpuCommonFeatures.h
1 /** @file
2 CPU Common features library header file.
3
4 Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef _CPU_COMMON_FEATURES_H_
10 #define _CPU_COMMON_FEATURES_H_
11
12 #include <PiDxe.h>
13
14 #include <Library/BaseLib.h>
15 #include <Library/PcdLib.h>
16 #include <Library/DebugLib.h>
17 #include <Library/RegisterCpuFeaturesLib.h>
18 #include <Library/BaseMemoryLib.h>
19 #include <Library/MemoryAllocationLib.h>
20 #include <Library/LocalApicLib.h>
21
22 #include <Register/Cpuid.h>
23 #include <Register/Msr.h>
24
25 /**
26 Prepares for the data used by CPU feature detection and initialization.
27
28 @param[in] NumberOfProcessors The number of CPUs in the platform.
29
30 @return Pointer to a buffer of CPU related configuration data.
31
32 @note This service could be called by BSP only.
33 **/
34 VOID *
35 EFIAPI
36 AesniGetConfigData (
37 IN UINTN NumberOfProcessors
38 );
39
40 /**
41 Detects if AESNI feature supported on current processor.
42
43 @param[in] ProcessorNumber The index of the CPU executing this function.
44 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
45 structure for the CPU executing this function.
46 @param[in] ConfigData A pointer to the configuration buffer returned
47 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
48 CPU_FEATURE_GET_CONFIG_DATA was not provided in
49 RegisterCpuFeature().
50
51 @retval TRUE AESNI feature is supported.
52 @retval FALSE AESNI feature is not supported.
53
54 @note This service could be called by BSP/APs.
55 **/
56 BOOLEAN
57 EFIAPI
58 AesniSupport (
59 IN UINTN ProcessorNumber,
60 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
61 IN VOID *ConfigData OPTIONAL
62 );
63
64 /**
65 Initializes AESNI feature to specific state.
66
67 @param[in] ProcessorNumber The index of the CPU executing this function.
68 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
69 structure for the CPU executing this function.
70 @param[in] ConfigData A pointer to the configuration buffer returned
71 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
72 CPU_FEATURE_GET_CONFIG_DATA was not provided in
73 RegisterCpuFeature().
74 @param[in] State If TRUE, then the AESNI feature must be enabled.
75 If FALSE, then the AESNI feature must be disabled.
76
77 @retval RETURN_SUCCESS AESNI feature is initialized.
78
79 @note This service could be called by BSP only.
80 **/
81 RETURN_STATUS
82 EFIAPI
83 AesniInitialize (
84 IN UINTN ProcessorNumber,
85 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
86 IN VOID *ConfigData, OPTIONAL
87 IN BOOLEAN State
88 );
89
90 /**
91 Detects if Clock Modulation feature supported on current processor.
92
93 @param[in] ProcessorNumber The index of the CPU executing this function.
94 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
95 structure for the CPU executing this function.
96 @param[in] ConfigData A pointer to the configuration buffer returned
97 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
98 CPU_FEATURE_GET_CONFIG_DATA was not provided in
99 RegisterCpuFeature().
100
101 @retval TRUE Clock Modulation feature is supported.
102 @retval FALSE Clock Modulation feature is not supported.
103
104 @note This service could be called by BSP/APs.
105 **/
106 BOOLEAN
107 EFIAPI
108 ClockModulationSupport (
109 IN UINTN ProcessorNumber,
110 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
111 IN VOID *ConfigData OPTIONAL
112 );
113
114 /**
115 Initializes Clock Modulation feature to specific state.
116
117 @param[in] ProcessorNumber The index of the CPU executing this function.
118 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
119 structure for the CPU executing this function.
120 @param[in] ConfigData A pointer to the configuration buffer returned
121 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
122 CPU_FEATURE_GET_CONFIG_DATA was not provided in
123 RegisterCpuFeature().
124 @param[in] State If TRUE, then the Clock Modulation feature must be enabled.
125 If FALSE, then the Clock Modulation feature must be disabled.
126
127 @retval RETURN_SUCCESS Clock Modulation feature is initialized.
128
129 @note This service could be called by BSP only.
130 **/
131 RETURN_STATUS
132 EFIAPI
133 ClockModulationInitialize (
134 IN UINTN ProcessorNumber,
135 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
136 IN VOID *ConfigData, OPTIONAL
137 IN BOOLEAN State
138 );
139
140 /**
141 Detects if Enhanced Intel SpeedStep feature supported on current processor.
142
143 @param[in] ProcessorNumber The index of the CPU executing this function.
144 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
145 structure for the CPU executing this function.
146 @param[in] ConfigData A pointer to the configuration buffer returned
147 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
148 CPU_FEATURE_GET_CONFIG_DATA was not provided in
149 RegisterCpuFeature().
150
151 @retval TRUE Enhanced Intel SpeedStep feature is supported.
152 @retval FALSE Enhanced Intel SpeedStep feature is not supported.
153
154 @note This service could be called by BSP/APs.
155 **/
156 BOOLEAN
157 EFIAPI
158 EistSupport (
159 IN UINTN ProcessorNumber,
160 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
161 IN VOID *ConfigData OPTIONAL
162 );
163
164 /**
165 Initializes Enhanced Intel SpeedStep feature to specific state.
166
167 @param[in] ProcessorNumber The index of the CPU executing this function.
168 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
169 structure for the CPU executing this function.
170 @param[in] ConfigData A pointer to the configuration buffer returned
171 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
172 CPU_FEATURE_GET_CONFIG_DATA was not provided in
173 RegisterCpuFeature().
174 @param[in] State If TRUE, then the Enhanced Intel SpeedStep feature
175 must be enabled.
176 If FALSE, then the Enhanced Intel SpeedStep feature
177 must be disabled.
178
179 @retval RETURN_SUCCESS Enhanced Intel SpeedStep feature is initialized.
180
181 @note This service could be called by BSP only.
182 **/
183 RETURN_STATUS
184 EFIAPI
185 EistInitialize (
186 IN UINTN ProcessorNumber,
187 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
188 IN VOID *ConfigData, OPTIONAL
189 IN BOOLEAN State
190 );
191
192 /**
193 Detects if Execute Disable feature supported on current processor.
194
195 @param[in] ProcessorNumber The index of the CPU executing this function.
196 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
197 structure for the CPU executing this function.
198 @param[in] ConfigData A pointer to the configuration buffer returned
199 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
200 CPU_FEATURE_GET_CONFIG_DATA was not provided in
201 RegisterCpuFeature().
202
203 @retval TRUE Execute Disable feature is supported.
204 @retval FALSE Execute Disable feature is not supported.
205
206 @note This service could be called by BSP/APs.
207 **/
208 BOOLEAN
209 EFIAPI
210 ExecuteDisableSupport (
211 IN UINTN ProcessorNumber,
212 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
213 IN VOID *ConfigData OPTIONAL
214 );
215
216 /**
217 Initializes Execute Disable feature to specific state.
218
219 @param[in] ProcessorNumber The index of the CPU executing this function.
220 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
221 structure for the CPU executing this function.
222 @param[in] ConfigData A pointer to the configuration buffer returned
223 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
224 CPU_FEATURE_GET_CONFIG_DATA was not provided in
225 RegisterCpuFeature().
226 @param[in] State If TRUE, then the Execute Disable feature must be enabled.
227 If FALSE, then the Execute Disable feature must be disabled.
228
229 @retval RETURN_SUCCESS Execute Disable feature is initialized.
230
231 @note This service could be called by BSP only.
232 **/
233 RETURN_STATUS
234 EFIAPI
235 ExecuteDisableInitialize (
236 IN UINTN ProcessorNumber,
237 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
238 IN VOID *ConfigData, OPTIONAL
239 IN BOOLEAN State
240 );
241
242 /**
243 Initializes Fast-Strings feature to specific state.
244
245 @param[in] ProcessorNumber The index of the CPU executing this function.
246 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
247 structure for the CPU executing this function.
248 @param[in] ConfigData A pointer to the configuration buffer returned
249 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
250 CPU_FEATURE_GET_CONFIG_DATA was not provided in
251 RegisterCpuFeature().
252 @param[in] State If TRUE, then the Fast-Strings feature must be enabled.
253 If FALSE, then the Fast-Strings feature must be disabled.
254
255 @retval RETURN_SUCCESS Fast-Strings feature is initialized.
256
257 @note This service could be called by BSP only.
258 **/
259 RETURN_STATUS
260 EFIAPI
261 FastStringsInitialize (
262 IN UINTN ProcessorNumber,
263 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
264 IN VOID *ConfigData, OPTIONAL
265 IN BOOLEAN State
266 );
267
268 /**
269 Detects if MONITOR/MWAIT feature supported on current processor.
270
271 @param[in] ProcessorNumber The index of the CPU executing this function.
272 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
273 structure for the CPU executing this function.
274 @param[in] ConfigData A pointer to the configuration buffer returned
275 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
276 CPU_FEATURE_GET_CONFIG_DATA was not provided in
277 RegisterCpuFeature().
278
279 @retval TRUE MONITOR/MWAIT feature is supported.
280 @retval FALSE MONITOR/MWAIT feature is not supported.
281
282 @note This service could be called by BSP/APs.
283 **/
284 BOOLEAN
285 EFIAPI
286 MonitorMwaitSupport (
287 IN UINTN ProcessorNumber,
288 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
289 IN VOID *ConfigData OPTIONAL
290 );
291
292 /**
293 Initializes MONITOR/MWAIT feature to specific state.
294
295 @param[in] ProcessorNumber The index of the CPU executing this function.
296 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
297 structure for the CPU executing this function.
298 @param[in] ConfigData A pointer to the configuration buffer returned
299 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
300 CPU_FEATURE_GET_CONFIG_DATA was not provided in
301 RegisterCpuFeature().
302 @param[in] State If TRUE, then the MONITOR/MWAIT feature must be enabled.
303 If FALSE, then the MONITOR/MWAIT feature must be disabled.
304
305 @retval RETURN_SUCCESS MONITOR/MWAIT feature is initialized.
306
307 @note This service could be called by BSP only.
308 **/
309 RETURN_STATUS
310 EFIAPI
311 MonitorMwaitInitialize (
312 IN UINTN ProcessorNumber,
313 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
314 IN VOID *ConfigData, OPTIONAL
315 IN BOOLEAN State
316 );
317
318 /**
319 Detects if VMX feature supported on current processor.
320
321 @param[in] ProcessorNumber The index of the CPU executing this function.
322 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
323 structure for the CPU executing this function.
324 @param[in] ConfigData A pointer to the configuration buffer returned
325 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
326 CPU_FEATURE_GET_CONFIG_DATA was not provided in
327 RegisterCpuFeature().
328
329 @retval TRUE VMX feature is supported.
330 @retval FALSE VMX feature is not supported.
331
332 @note This service could be called by BSP/APs.
333 **/
334 BOOLEAN
335 EFIAPI
336 VmxSupport (
337 IN UINTN ProcessorNumber,
338 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
339 IN VOID *ConfigData OPTIONAL
340 );
341
342 /**
343 Initializes VMX feature to specific state.
344
345 @param[in] ProcessorNumber The index of the CPU executing this function.
346 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
347 structure for the CPU executing this function.
348 @param[in] ConfigData A pointer to the configuration buffer returned
349 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
350 CPU_FEATURE_GET_CONFIG_DATA was not provided in
351 RegisterCpuFeature().
352 @param[in] State If TRUE, then the VMX feature must be enabled.
353 If FALSE, then the VMX feature must be disabled.
354
355 @retval RETURN_SUCCESS VMX feature is initialized.
356
357 @note This service could be called by BSP only.
358 **/
359 RETURN_STATUS
360 EFIAPI
361 VmxInitialize (
362 IN UINTN ProcessorNumber,
363 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
364 IN VOID *ConfigData, OPTIONAL
365 IN BOOLEAN State
366 );
367
368 /**
369 Detects if Lock Feature Control Register feature supported on current processor.
370
371 @param[in] ProcessorNumber The index of the CPU executing this function.
372 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
373 structure for the CPU executing this function.
374 @param[in] ConfigData A pointer to the configuration buffer returned
375 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
376 CPU_FEATURE_GET_CONFIG_DATA was not provided in
377 RegisterCpuFeature().
378
379 @retval TRUE Lock Feature Control Register feature is supported.
380 @retval FALSE Lock Feature Control Register feature is not supported.
381
382 @note This service could be called by BSP/APs.
383 **/
384 BOOLEAN
385 EFIAPI
386 LockFeatureControlRegisterSupport (
387 IN UINTN ProcessorNumber,
388 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
389 IN VOID *ConfigData OPTIONAL
390 );
391
392 /**
393 Initializes Lock Feature Control Register feature to specific state.
394
395 @param[in] ProcessorNumber The index of the CPU executing this function.
396 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
397 structure for the CPU executing this function.
398 @param[in] ConfigData A pointer to the configuration buffer returned
399 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
400 CPU_FEATURE_GET_CONFIG_DATA was not provided in
401 RegisterCpuFeature().
402 @param[in] State If TRUE, then the Lock Feature Control Register feature must be enabled.
403 If FALSE, then the Lock Feature Control Register feature must be disabled.
404
405 @retval RETURN_SUCCESS Lock Feature Control Register feature is initialized.
406
407 @note This service could be called by BSP only.
408 **/
409 RETURN_STATUS
410 EFIAPI
411 LockFeatureControlRegisterInitialize (
412 IN UINTN ProcessorNumber,
413 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
414 IN VOID *ConfigData, OPTIONAL
415 IN BOOLEAN State
416 );
417
418 /**
419 Detects if SMX feature supported on current processor.
420
421 @param[in] ProcessorNumber The index of the CPU executing this function.
422 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
423 structure for the CPU executing this function.
424 @param[in] ConfigData A pointer to the configuration buffer returned
425 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
426 CPU_FEATURE_GET_CONFIG_DATA was not provided in
427 RegisterCpuFeature().
428
429 @retval TRUE SMX feature is supported.
430 @retval FALSE SMX feature is not supported.
431
432 @note This service could be called by BSP/APs.
433 **/
434 BOOLEAN
435 EFIAPI
436 SmxSupport (
437 IN UINTN ProcessorNumber,
438 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
439 IN VOID *ConfigData OPTIONAL
440 );
441
442 /**
443 Initializes SMX feature to specific state.
444
445 @param[in] ProcessorNumber The index of the CPU executing this function.
446 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
447 structure for the CPU executing this function.
448 @param[in] ConfigData A pointer to the configuration buffer returned
449 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
450 CPU_FEATURE_GET_CONFIG_DATA was not provided in
451 RegisterCpuFeature().
452 @param[in] State If TRUE, then SMX feature must be enabled.
453 If FALSE, then SMX feature must be disabled.
454
455 @retval RETURN_SUCCESS SMX feature is initialized.
456 @retval RETURN_UNSUPPORTED VMX not initialized.
457
458 @note This service could be called by BSP only.
459 **/
460 RETURN_STATUS
461 EFIAPI
462 SmxInitialize (
463 IN UINTN ProcessorNumber,
464 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
465 IN VOID *ConfigData, OPTIONAL
466 IN BOOLEAN State
467 );
468
469 /**
470 Detects if LimitCpuidMaxval feature supported on current processor.
471
472 @param[in] ProcessorNumber The index of the CPU executing this function.
473 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
474 structure for the CPU executing this function.
475 @param[in] ConfigData A pointer to the configuration buffer returned
476 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
477 CPU_FEATURE_GET_CONFIG_DATA was not provided in
478 RegisterCpuFeature().
479
480 @retval TRUE LimitCpuidMaxval feature is supported.
481 @retval FALSE LimitCpuidMaxval feature is not supported.
482
483 @note This service could be called by BSP/APs.
484 **/
485 BOOLEAN
486 EFIAPI
487 LimitCpuidMaxvalSupport (
488 IN UINTN ProcessorNumber,
489 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
490 IN VOID *ConfigData OPTIONAL
491 );
492
493 /**
494 Initializes LimitCpuidMaxval feature to specific state.
495
496 @param[in] ProcessorNumber The index of the CPU executing this function.
497 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
498 structure for the CPU executing this function.
499 @param[in] ConfigData A pointer to the configuration buffer returned
500 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
501 CPU_FEATURE_GET_CONFIG_DATA was not provided in
502 RegisterCpuFeature().
503 @param[in] State If TRUE, then the LimitCpuidMaxval feature must be enabled.
504 If FALSE, then the LimitCpuidMaxval feature must be disabled.
505
506 @retval RETURN_SUCCESS LimitCpuidMaxval feature is initialized.
507
508 @note This service could be called by BSP only.
509 **/
510 RETURN_STATUS
511 EFIAPI
512 LimitCpuidMaxvalInitialize (
513 IN UINTN ProcessorNumber,
514 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
515 IN VOID *ConfigData, OPTIONAL
516 IN BOOLEAN State
517 );
518
519 /**
520 Detects if Machine Check Exception feature supported on current processor.
521
522 @param[in] ProcessorNumber The index of the CPU executing this function.
523 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
524 structure for the CPU executing this function.
525 @param[in] ConfigData A pointer to the configuration buffer returned
526 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
527 CPU_FEATURE_GET_CONFIG_DATA was not provided in
528 RegisterCpuFeature().
529
530 @retval TRUE Machine Check Exception feature is supported.
531 @retval FALSE Machine Check Exception feature is not supported.
532
533 @note This service could be called by BSP/APs.
534 **/
535 BOOLEAN
536 EFIAPI
537 MceSupport (
538 IN UINTN ProcessorNumber,
539 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
540 IN VOID *ConfigData OPTIONAL
541 );
542
543 /**
544 Initializes Machine Check Exception feature to specific state.
545
546 @param[in] ProcessorNumber The index of the CPU executing this function.
547 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
548 structure for the CPU executing this function.
549 @param[in] ConfigData A pointer to the configuration buffer returned
550 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
551 CPU_FEATURE_GET_CONFIG_DATA was not provided in
552 RegisterCpuFeature().
553 @param[in] State If TRUE, then the Machine Check Exception feature must be enabled.
554 If FALSE, then the Machine Check Exception feature must be disabled.
555
556 @retval RETURN_SUCCESS Machine Check Exception feature is initialized.
557
558 @note This service could be called by BSP only.
559 **/
560 RETURN_STATUS
561 EFIAPI
562 MceInitialize (
563 IN UINTN ProcessorNumber,
564 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
565 IN VOID *ConfigData, OPTIONAL
566 IN BOOLEAN State
567 );
568
569 /**
570 Detects if Machine Check Architecture feature supported on current processor.
571
572 @param[in] ProcessorNumber The index of the CPU executing this function.
573 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
574 structure for the CPU executing this function.
575 @param[in] ConfigData A pointer to the configuration buffer returned
576 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
577 CPU_FEATURE_GET_CONFIG_DATA was not provided in
578 RegisterCpuFeature().
579
580 @retval TRUE Machine Check Architecture feature is supported.
581 @retval FALSE Machine Check Architecture feature is not supported.
582
583 @note This service could be called by BSP/APs.
584 **/
585 BOOLEAN
586 EFIAPI
587 McaSupport (
588 IN UINTN ProcessorNumber,
589 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
590 IN VOID *ConfigData OPTIONAL
591 );
592
593 /**
594 Initializes Machine Check Architecture feature to specific state.
595
596 @param[in] ProcessorNumber The index of the CPU executing this function.
597 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
598 structure for the CPU executing this function.
599 @param[in] ConfigData A pointer to the configuration buffer returned
600 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
601 CPU_FEATURE_GET_CONFIG_DATA was not provided in
602 RegisterCpuFeature().
603 @param[in] State If TRUE, then the Machine Check Architecture feature must be enabled.
604 If FALSE, then the Machine Check Architecture feature must be disabled.
605
606 @retval RETURN_SUCCESS Machine Check Architecture feature is initialized.
607
608 @note This service could be called by BSP only.
609 **/
610 RETURN_STATUS
611 EFIAPI
612 McaInitialize (
613 IN UINTN ProcessorNumber,
614 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
615 IN VOID *ConfigData, OPTIONAL
616 IN BOOLEAN State
617 );
618
619 /**
620 Detects if IA32_MCG_CTL feature supported on current processor.
621
622 @param[in] ProcessorNumber The index of the CPU executing this function.
623 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
624 structure for the CPU executing this function.
625 @param[in] ConfigData A pointer to the configuration buffer returned
626 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
627 CPU_FEATURE_GET_CONFIG_DATA was not provided in
628 RegisterCpuFeature().
629
630 @retval TRUE IA32_MCG_CTL feature is supported.
631 @retval FALSE IA32_MCG_CTL feature is not supported.
632
633 @note This service could be called by BSP/APs.
634 **/
635 BOOLEAN
636 EFIAPI
637 McgCtlSupport (
638 IN UINTN ProcessorNumber,
639 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
640 IN VOID *ConfigData OPTIONAL
641 );
642
643 /**
644 Initializes IA32_MCG_CTL feature to specific state.
645
646 @param[in] ProcessorNumber The index of the CPU executing this function.
647 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
648 structure for the CPU executing this function.
649 @param[in] ConfigData A pointer to the configuration buffer returned
650 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
651 CPU_FEATURE_GET_CONFIG_DATA was not provided in
652 RegisterCpuFeature().
653 @param[in] State If TRUE, then the IA32_MCG_CTL feature must be enabled.
654 If FALSE, then the IA32_MCG_CTL feature must be disabled.
655
656 @retval RETURN_SUCCESS IA32_MCG_CTL feature is initialized.
657
658 @note This service could be called by BSP only.
659 **/
660 RETURN_STATUS
661 EFIAPI
662 McgCtlInitialize (
663 IN UINTN ProcessorNumber,
664 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
665 IN VOID *ConfigData, OPTIONAL
666 IN BOOLEAN State
667 );
668
669 /**
670 Detects if Pending Break feature supported on current processor.
671
672 @param[in] ProcessorNumber The index of the CPU executing this function.
673 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
674 structure for the CPU executing this function.
675 @param[in] ConfigData A pointer to the configuration buffer returned
676 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
677 CPU_FEATURE_GET_CONFIG_DATA was not provided in
678 RegisterCpuFeature().
679
680 @retval TRUE Pending Break feature is supported.
681 @retval FALSE Pending Break feature is not supported.
682
683 @note This service could be called by BSP/APs.
684 **/
685 BOOLEAN
686 EFIAPI
687 PendingBreakSupport (
688 IN UINTN ProcessorNumber,
689 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
690 IN VOID *ConfigData OPTIONAL
691 );
692
693 /**
694 Initializes Pending Break feature to specific state.
695
696 @param[in] ProcessorNumber The index of the CPU executing this function.
697 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
698 structure for the CPU executing this function.
699 @param[in] ConfigData A pointer to the configuration buffer returned
700 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
701 CPU_FEATURE_GET_CONFIG_DATA was not provided in
702 RegisterCpuFeature().
703 @param[in] State If TRUE, then the Pending Break feature must be enabled.
704 If FALSE, then the Pending Break feature must be disabled.
705
706 @retval RETURN_SUCCESS Pending Break feature is initialized.
707
708 @note This service could be called by BSP only.
709 **/
710 RETURN_STATUS
711 EFIAPI
712 PendingBreakInitialize (
713 IN UINTN ProcessorNumber,
714 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
715 IN VOID *ConfigData, OPTIONAL
716 IN BOOLEAN State
717 );
718
719 /**
720 Detects if C1E feature supported on current processor.
721
722 @param[in] ProcessorNumber The index of the CPU executing this function.
723 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
724 structure for the CPU executing this function.
725 @param[in] ConfigData A pointer to the configuration buffer returned
726 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
727 CPU_FEATURE_GET_CONFIG_DATA was not provided in
728 RegisterCpuFeature().
729
730 @retval TRUE C1E feature is supported.
731 @retval FALSE C1E feature is not supported.
732
733 @note This service could be called by BSP/APs.
734 **/
735 BOOLEAN
736 EFIAPI
737 C1eSupport (
738 IN UINTN ProcessorNumber,
739 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
740 IN VOID *ConfigData OPTIONAL
741 );
742
743 /**
744 Initializes C1E feature to specific state.
745
746 @param[in] ProcessorNumber The index of the CPU executing this function.
747 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
748 structure for the CPU executing this function.
749 @param[in] ConfigData A pointer to the configuration buffer returned
750 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
751 CPU_FEATURE_GET_CONFIG_DATA was not provided in
752 RegisterCpuFeature().
753 @param[in] State If TRUE, then the C1E feature must be enabled.
754 If FALSE, then the C1E feature must be disabled.
755
756 @retval RETURN_SUCCESS C1E feature is initialized.
757
758 @note This service could be called by BSP only.
759 **/
760 RETURN_STATUS
761 EFIAPI
762 C1eInitialize (
763 IN UINTN ProcessorNumber,
764 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
765 IN VOID *ConfigData, OPTIONAL
766 IN BOOLEAN State
767 );
768
769 /**
770 Prepares for the data used by CPU feature detection and initialization.
771
772 @param[in] NumberOfProcessors The number of CPUs in the platform.
773
774 @return Pointer to a buffer of CPU related configuration data.
775
776 @note This service could be called by BSP only.
777 **/
778 VOID *
779 EFIAPI
780 X2ApicGetConfigData (
781 IN UINTN NumberOfProcessors
782 );
783
784 /**
785 Detects if X2Apci feature supported on current processor.
786
787 Detect if X2Apci has been already enabled.
788
789 @param[in] ProcessorNumber The index of the CPU executing this function.
790 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
791 structure for the CPU executing this function.
792 @param[in] ConfigData A pointer to the configuration buffer returned
793 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
794 CPU_FEATURE_GET_CONFIG_DATA was not provided in
795 RegisterCpuFeature().
796
797 @retval TRUE X2Apci feature is supported.
798 @retval FALSE X2Apci feature is not supported.
799
800 @note This service could be called by BSP/APs.
801 **/
802 BOOLEAN
803 EFIAPI
804 X2ApicSupport (
805 IN UINTN ProcessorNumber,
806 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
807 IN VOID *ConfigData OPTIONAL
808 );
809
810 /**
811 Initializes X2Apci feature to specific state.
812
813 @param[in] ProcessorNumber The index of the CPU executing this function.
814 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
815 structure for the CPU executing this function.
816 @param[in] ConfigData A pointer to the configuration buffer returned
817 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
818 CPU_FEATURE_GET_CONFIG_DATA was not provided in
819 RegisterCpuFeature().
820 @param[in] State If TRUE, then the X2Apci feature must be enabled.
821 If FALSE, then the X2Apci feature must be disabled.
822
823 @retval RETURN_SUCCESS X2Apci feature is initialized.
824
825 @note This service could be called by BSP only.
826 **/
827 RETURN_STATUS
828 EFIAPI
829 X2ApicInitialize (
830 IN UINTN ProcessorNumber,
831 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
832 IN VOID *ConfigData, OPTIONAL
833 IN BOOLEAN State
834 );
835
836 /**
837 Prepares for the data used by CPU feature detection and initialization.
838
839 @param[in] NumberOfProcessors The number of CPUs in the platform.
840
841 @return Pointer to a buffer of CPU related configuration data.
842
843 @note This service could be called by BSP only.
844 **/
845 VOID *
846 EFIAPI
847 FeatureControlGetConfigData (
848 IN UINTN NumberOfProcessors
849 );
850
851 /**
852 Detects if Protected Processor Inventory Number feature supported on current
853 processor.
854
855 @param[in] ProcessorNumber The index of the CPU executing this function.
856 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
857 structure for the CPU executing this function.
858 @param[in] ConfigData A pointer to the configuration buffer returned
859 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
860 CPU_FEATURE_GET_CONFIG_DATA was not provided in
861 RegisterCpuFeature().
862
863 @retval TRUE Protected Processor Inventory Number feature is supported.
864 @retval FALSE Protected Processor Inventory Number feature is not supported.
865
866 @note This service could be called by BSP/APs.
867 **/
868 BOOLEAN
869 EFIAPI
870 PpinSupport (
871 IN UINTN ProcessorNumber,
872 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
873 IN VOID *ConfigData OPTIONAL
874 );
875
876 /**
877 Initializes Protected Processor Inventory Number feature to specific state.
878
879 @param[in] ProcessorNumber The index of the CPU executing this function.
880 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
881 structure for the CPU executing this function.
882 @param[in] ConfigData A pointer to the configuration buffer returned
883 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
884 CPU_FEATURE_GET_CONFIG_DATA was not provided in
885 RegisterCpuFeature().
886 @param[in] State If TRUE, then the Protected Processor Inventory
887 Number feature must be enabled.
888 If FALSE, then the Protected Processor Inventory
889 Number feature must be disabled.
890
891 @retval RETURN_SUCCESS Protected Processor Inventory Number feature is
892 initialized.
893 @retval RETURN_DEVICE_ERROR Device can't change state because it has been
894 locked.
895
896 **/
897 RETURN_STATUS
898 EFIAPI
899 PpinInitialize (
900 IN UINTN ProcessorNumber,
901 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
902 IN VOID *ConfigData, OPTIONAL
903 IN BOOLEAN State
904 );
905
906 /**
907 Detects if Local machine check exception feature supported on current
908 processor.
909
910 @param[in] ProcessorNumber The index of the CPU executing this function.
911 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
912 structure for the CPU executing this function.
913 @param[in] ConfigData A pointer to the configuration buffer returned
914 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
915 CPU_FEATURE_GET_CONFIG_DATA was not provided in
916 RegisterCpuFeature().
917
918 @retval TRUE Local machine check exception feature is supported.
919 @retval FALSE Local machine check exception feature is not supported.
920
921 @note This service could be called by BSP/APs.
922 **/
923 BOOLEAN
924 EFIAPI
925 LmceSupport (
926 IN UINTN ProcessorNumber,
927 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
928 IN VOID *ConfigData OPTIONAL
929 );
930
931 /**
932 Initializes Local machine check exception feature to specific state.
933
934 @param[in] ProcessorNumber The index of the CPU executing this function.
935 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
936 structure for the CPU executing this function.
937 @param[in] ConfigData A pointer to the configuration buffer returned
938 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
939 CPU_FEATURE_GET_CONFIG_DATA was not provided in
940 RegisterCpuFeature().
941 @param[in] State If TRUE, then the Local machine check exception
942 feature must be enabled.
943 If FALSE, then the Local machine check exception
944 feature must be disabled.
945
946 @retval RETURN_SUCCESS Local machine check exception feature is initialized.
947
948 **/
949 RETURN_STATUS
950 EFIAPI
951 LmceInitialize (
952 IN UINTN ProcessorNumber,
953 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
954 IN VOID *ConfigData, OPTIONAL
955 IN BOOLEAN State
956 );
957
958 /**
959 Prepares for the data used by CPU feature detection and initialization.
960
961 @param[in] NumberOfProcessors The number of CPUs in the platform.
962
963 @return Pointer to a buffer of CPU related configuration data.
964
965 @note This service could be called by BSP only.
966 **/
967 VOID *
968 EFIAPI
969 ProcTraceGetConfigData (
970 IN UINTN NumberOfProcessors
971 );
972
973 /**
974 Detects if Intel Processor Trace feature supported on current processor.
975
976 @param[in] ProcessorNumber The index of the CPU executing this function.
977 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
978 structure for the CPU executing this function.
979 @param[in] ConfigData A pointer to the configuration buffer returned
980 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
981 CPU_FEATURE_GET_CONFIG_DATA was not provided in
982 RegisterCpuFeature().
983
984 @retval TRUE Processor Trace feature is supported.
985 @retval FALSE Processor Trace feature is not supported.
986
987 @note This service could be called by BSP/APs.
988 **/
989 BOOLEAN
990 EFIAPI
991 ProcTraceSupport (
992 IN UINTN ProcessorNumber,
993 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
994 IN VOID *ConfigData OPTIONAL
995 );
996
997 /**
998 Initializes Intel Processor Trace feature to specific state.
999
1000 @param[in] ProcessorNumber The index of the CPU executing this function.
1001 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
1002 structure for the CPU executing this function.
1003 @param[in] ConfigData A pointer to the configuration buffer returned
1004 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
1005 CPU_FEATURE_GET_CONFIG_DATA was not provided in
1006 RegisterCpuFeature().
1007 @param[in] State If TRUE, then the Processor Trace feature must be
1008 enabled.
1009 If FALSE, then the Processor Trace feature must be
1010 disabled.
1011
1012 @retval RETURN_SUCCESS Intel Processor Trace feature is initialized.
1013
1014 **/
1015 RETURN_STATUS
1016 EFIAPI
1017 ProcTraceInitialize (
1018 IN UINTN ProcessorNumber,
1019 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
1020 IN VOID *ConfigData, OPTIONAL
1021 IN BOOLEAN State
1022 );
1023
1024 #endif