Jeff Fan | 80c4b23 | 2017-04-05 16:33:16 +0800 | [diff] [blame] | 1 | /** @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 | **/
|
| 40 | VOID *
|
| 41 | EFIAPI
|
| 42 | AesniGetConfigData (
|
| 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 | **/
|
| 62 | BOOLEAN
|
| 63 | EFIAPI
|
| 64 | AesniSupport (
|
| 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 | **/
|
| 87 | RETURN_STATUS
|
| 88 | EFIAPI
|
| 89 | AesniInitialize (
|
| 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 | **/
|
| 112 | BOOLEAN
|
| 113 | EFIAPI
|
| 114 | ClockModulationSupport (
|
| 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 | **/
|
| 137 | RETURN_STATUS
|
| 138 | EFIAPI
|
| 139 | ClockModulationInitialize (
|
| 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 | **/
|
| 162 | BOOLEAN
|
| 163 | EFIAPI
|
| 164 | EistSupport (
|
| 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 | **/
|
| 189 | RETURN_STATUS
|
| 190 | EFIAPI
|
| 191 | EistInitialize (
|
| 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 | **/
|
| 214 | BOOLEAN
|
| 215 | EFIAPI
|
| 216 | ExecuteDisableSupport (
|
| 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 | **/
|
| 239 | RETURN_STATUS
|
| 240 | EFIAPI
|
| 241 | ExecuteDisableInitialize (
|
| 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 | **/
|
| 265 | RETURN_STATUS
|
| 266 | EFIAPI
|
| 267 | FastStringsInitialize (
|
| 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 | **/
|
| 290 | BOOLEAN
|
| 291 | EFIAPI
|
| 292 | MonitorMwaitSupport (
|
| 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 | **/
|
| 315 | RETURN_STATUS
|
| 316 | EFIAPI
|
| 317 | MonitorMwaitInitialize (
|
| 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 | **/
|
| 340 | BOOLEAN
|
| 341 | EFIAPI
|
| 342 | VmxSupport (
|
| 343 | IN UINTN ProcessorNumber,
|
| 344 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 345 | IN VOID *ConfigData OPTIONAL
|
| 346 | );
|
| 347 |
|
| 348 | /**
|
| 349 | Initializes VMX inside SMX feature to specific state.
|
| 350 |
|
| 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().
|
| 358 | @param[in] State If TRUE, then the VMX inside SMX feature must be enabled.
|
| 359 | If FALSE, then the VMX inside SMX feature must be disabled.
|
| 360 |
|
| 361 | @retval RETURN_SUCCESS VMX inside SMX feature is initialized.
|
| 362 |
|
| 363 | @note This service could be called by BSP only.
|
| 364 | **/
|
| 365 | RETURN_STATUS
|
| 366 | EFIAPI
|
| 367 | VmxInsideSmxInitialize (
|
| 368 | IN UINTN ProcessorNumber,
|
| 369 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 370 | IN VOID *ConfigData, OPTIONAL
|
| 371 | IN BOOLEAN State
|
| 372 | );
|
| 373 |
|
| 374 | /**
|
| 375 | Initializes SENTER feature to specific state.
|
| 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 | @param[in] State If TRUE, then the SENTER feature must be enabled.
|
| 385 | If FALSE, then the SENTER feature must be disabled.
|
| 386 |
|
| 387 | @retval RETURN_SUCCESS SENTER feature is initialized.
|
| 388 |
|
| 389 | @note This service could be called by BSP only.
|
| 390 | **/
|
| 391 | RETURN_STATUS
|
| 392 | EFIAPI
|
| 393 | SenterInitialize (
|
| 394 | IN UINTN ProcessorNumber,
|
| 395 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 396 | IN VOID *ConfigData, OPTIONAL
|
| 397 | IN BOOLEAN State
|
| 398 | );
|
| 399 |
|
| 400 | /**
|
| 401 | Detects if Lock Feature Control Register feature supported on current processor.
|
| 402 |
|
| 403 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 404 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 405 | structure for the CPU executing this function.
|
| 406 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 407 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 408 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 409 | RegisterCpuFeature().
|
| 410 |
|
| 411 | @retval TRUE Lock Feature Control Register feature is supported.
|
| 412 | @retval FALSE Lock Feature Control Register feature is not supported.
|
| 413 |
|
| 414 | @note This service could be called by BSP/APs.
|
| 415 | **/
|
| 416 | BOOLEAN
|
| 417 | EFIAPI
|
| 418 | LockFeatureControlRegisterSupport (
|
| 419 | IN UINTN ProcessorNumber,
|
| 420 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 421 | IN VOID *ConfigData OPTIONAL
|
| 422 | );
|
| 423 |
|
| 424 | /**
|
| 425 | Initializes Lock Feature Control Register feature to specific state.
|
| 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 | @param[in] State If TRUE, then the Lock Feature Control Register feature must be enabled.
|
| 435 | If FALSE, then the Lock Feature Control Register feature must be disabled.
|
| 436 |
|
| 437 | @retval RETURN_SUCCESS Lock Feature Control Register feature is initialized.
|
| 438 |
|
| 439 | @note This service could be called by BSP only.
|
| 440 | **/
|
| 441 | RETURN_STATUS
|
| 442 | EFIAPI
|
| 443 | LockFeatureControlRegisterInitialize (
|
| 444 | IN UINTN ProcessorNumber,
|
| 445 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 446 | IN VOID *ConfigData, OPTIONAL
|
| 447 | IN BOOLEAN State
|
| 448 | );
|
| 449 |
|
| 450 | /**
|
| 451 | Detects if SMX feature supported on current processor.
|
| 452 |
|
| 453 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 454 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 455 | structure for the CPU executing this function.
|
| 456 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 457 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 458 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 459 | RegisterCpuFeature().
|
| 460 |
|
| 461 | @retval TRUE SMX feature is supported.
|
| 462 | @retval FALSE SMX feature is not supported.
|
| 463 |
|
| 464 | @note This service could be called by BSP/APs.
|
| 465 | **/
|
| 466 | BOOLEAN
|
| 467 | EFIAPI
|
| 468 | SmxSupport (
|
| 469 | IN UINTN ProcessorNumber,
|
| 470 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 471 | IN VOID *ConfigData OPTIONAL
|
| 472 | );
|
| 473 |
|
| 474 | /**
|
| 475 | Initializes VMX outside SMX feature to specific state.
|
| 476 |
|
| 477 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 478 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 479 | structure for the CPU executing this function.
|
| 480 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 481 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 482 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 483 | RegisterCpuFeature().
|
| 484 | @param[in] State If TRUE, then the VMX outside SMX feature must be enabled.
|
| 485 | If FALSE, then the VMX outside SMX feature must be disabled.
|
| 486 |
|
| 487 | @retval RETURN_SUCCESS VMX outside SMX feature is initialized.
|
| 488 |
|
| 489 | @note This service could be called by BSP only.
|
| 490 | **/
|
| 491 | RETURN_STATUS
|
| 492 | EFIAPI
|
| 493 | VmxOutsideSmxInitialize (
|
| 494 | IN UINTN ProcessorNumber,
|
| 495 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 496 | IN VOID *ConfigData, OPTIONAL
|
| 497 | IN BOOLEAN State
|
| 498 | );
|
| 499 |
|
| 500 | /**
|
| 501 | Detects if LimitCpuidMaxval feature supported on current processor.
|
| 502 |
|
| 503 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 504 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 505 | structure for the CPU executing this function.
|
| 506 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 507 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 508 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 509 | RegisterCpuFeature().
|
| 510 |
|
| 511 | @retval TRUE LimitCpuidMaxval feature is supported.
|
| 512 | @retval FALSE LimitCpuidMaxval feature is not supported.
|
| 513 |
|
| 514 | @note This service could be called by BSP/APs.
|
| 515 | **/
|
| 516 | BOOLEAN
|
| 517 | EFIAPI
|
| 518 | LimitCpuidMaxvalSupport (
|
| 519 | IN UINTN ProcessorNumber,
|
| 520 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 521 | IN VOID *ConfigData OPTIONAL
|
| 522 | );
|
| 523 |
|
| 524 | /**
|
| 525 | Initializes LimitCpuidMaxval feature to specific state.
|
| 526 |
|
| 527 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 528 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 529 | structure for the CPU executing this function.
|
| 530 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 531 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 532 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 533 | RegisterCpuFeature().
|
| 534 | @param[in] State If TRUE, then the LimitCpuidMaxval feature must be enabled.
|
| 535 | If FALSE, then the LimitCpuidMaxval feature must be disabled.
|
| 536 |
|
| 537 | @retval RETURN_SUCCESS LimitCpuidMaxval feature is initialized.
|
| 538 |
|
| 539 | @note This service could be called by BSP only.
|
| 540 | **/
|
| 541 | RETURN_STATUS
|
| 542 | EFIAPI
|
| 543 | LimitCpuidMaxvalInitialize (
|
| 544 | IN UINTN ProcessorNumber,
|
| 545 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 546 | IN VOID *ConfigData, OPTIONAL
|
| 547 | IN BOOLEAN State
|
| 548 | );
|
| 549 |
|
| 550 | /**
|
| 551 | Detects if Machine Check Exception feature supported on current processor.
|
| 552 |
|
| 553 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 554 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 555 | structure for the CPU executing this function.
|
| 556 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 557 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 558 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 559 | RegisterCpuFeature().
|
| 560 |
|
| 561 | @retval TRUE Machine Check Exception feature is supported.
|
| 562 | @retval FALSE Machine Check Exception feature is not supported.
|
| 563 |
|
| 564 | @note This service could be called by BSP/APs.
|
| 565 | **/
|
| 566 | BOOLEAN
|
| 567 | EFIAPI
|
| 568 | MceSupport (
|
| 569 | IN UINTN ProcessorNumber,
|
| 570 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 571 | IN VOID *ConfigData OPTIONAL
|
| 572 | );
|
| 573 |
|
| 574 | /**
|
| 575 | Initializes Machine Check Exception feature to specific state.
|
| 576 |
|
| 577 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 578 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 579 | structure for the CPU executing this function.
|
| 580 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 581 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 582 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 583 | RegisterCpuFeature().
|
| 584 | @param[in] State If TRUE, then the Machine Check Exception feature must be enabled.
|
| 585 | If FALSE, then the Machine Check Exception feature must be disabled.
|
| 586 |
|
| 587 | @retval RETURN_SUCCESS Machine Check Exception feature is initialized.
|
| 588 |
|
| 589 | @note This service could be called by BSP only.
|
| 590 | **/
|
| 591 | RETURN_STATUS
|
| 592 | EFIAPI
|
| 593 | MceInitialize (
|
| 594 | IN UINTN ProcessorNumber,
|
| 595 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 596 | IN VOID *ConfigData, OPTIONAL
|
| 597 | IN BOOLEAN State
|
| 598 | );
|
| 599 |
|
| 600 | /**
|
| 601 | Detects if Machine Check Architecture feature supported on current processor.
|
| 602 |
|
| 603 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 604 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 605 | structure for the CPU executing this function.
|
| 606 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 607 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 608 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 609 | RegisterCpuFeature().
|
| 610 |
|
| 611 | @retval TRUE Machine Check Architecture feature is supported.
|
| 612 | @retval FALSE Machine Check Architecture feature is not supported.
|
| 613 |
|
| 614 | @note This service could be called by BSP/APs.
|
| 615 | **/
|
| 616 | BOOLEAN
|
| 617 | EFIAPI
|
| 618 | McaSupport (
|
| 619 | IN UINTN ProcessorNumber,
|
| 620 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 621 | IN VOID *ConfigData OPTIONAL
|
| 622 | );
|
| 623 |
|
| 624 | /**
|
| 625 | Initializes Machine Check Architecture feature to specific state.
|
| 626 |
|
| 627 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 628 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 629 | structure for the CPU executing this function.
|
| 630 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 631 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 632 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 633 | RegisterCpuFeature().
|
| 634 | @param[in] State If TRUE, then the Machine Check Architecture feature must be enabled.
|
| 635 | If FALSE, then the Machine Check Architecture feature must be disabled.
|
| 636 |
|
| 637 | @retval RETURN_SUCCESS Machine Check Architecture feature is initialized.
|
| 638 |
|
| 639 | @note This service could be called by BSP only.
|
| 640 | **/
|
| 641 | RETURN_STATUS
|
| 642 | EFIAPI
|
| 643 | McaInitialize (
|
| 644 | IN UINTN ProcessorNumber,
|
| 645 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 646 | IN VOID *ConfigData, OPTIONAL
|
| 647 | IN BOOLEAN State
|
| 648 | );
|
| 649 |
|
| 650 | /**
|
| 651 | Detects if IA32_MCG_CTL feature supported on current processor.
|
| 652 |
|
| 653 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 654 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 655 | structure for the CPU executing this function.
|
| 656 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 657 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 658 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 659 | RegisterCpuFeature().
|
| 660 |
|
| 661 | @retval TRUE IA32_MCG_CTL feature is supported.
|
| 662 | @retval FALSE IA32_MCG_CTL feature is not supported.
|
| 663 |
|
| 664 | @note This service could be called by BSP/APs.
|
| 665 | **/
|
| 666 | BOOLEAN
|
| 667 | EFIAPI
|
| 668 | McgCtlSupport (
|
| 669 | IN UINTN ProcessorNumber,
|
| 670 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 671 | IN VOID *ConfigData OPTIONAL
|
| 672 | );
|
| 673 |
|
| 674 | /**
|
| 675 | Initializes IA32_MCG_CTL feature to specific state.
|
| 676 |
|
| 677 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 678 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 679 | structure for the CPU executing this function.
|
| 680 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 681 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 682 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 683 | RegisterCpuFeature().
|
| 684 | @param[in] State If TRUE, then the IA32_MCG_CTL feature must be enabled.
|
| 685 | If FALSE, then the IA32_MCG_CTL feature must be disabled.
|
| 686 |
|
| 687 | @retval RETURN_SUCCESS IA32_MCG_CTL feature is initialized.
|
| 688 |
|
| 689 | @note This service could be called by BSP only.
|
| 690 | **/
|
| 691 | RETURN_STATUS
|
| 692 | EFIAPI
|
| 693 | McgCtlInitialize (
|
| 694 | IN UINTN ProcessorNumber,
|
| 695 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 696 | IN VOID *ConfigData, OPTIONAL
|
| 697 | IN BOOLEAN State
|
| 698 | );
|
| 699 |
|
| 700 | /**
|
| 701 | Detects if Pending Break feature supported on current processor.
|
| 702 |
|
| 703 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 704 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 705 | structure for the CPU executing this function.
|
| 706 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 707 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 708 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 709 | RegisterCpuFeature().
|
| 710 |
|
| 711 | @retval TRUE Pending Break feature is supported.
|
| 712 | @retval FALSE Pending Break feature is not supported.
|
| 713 |
|
| 714 | @note This service could be called by BSP/APs.
|
| 715 | **/
|
| 716 | BOOLEAN
|
| 717 | EFIAPI
|
| 718 | PendingBreakSupport (
|
| 719 | IN UINTN ProcessorNumber,
|
| 720 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 721 | IN VOID *ConfigData OPTIONAL
|
| 722 | );
|
| 723 |
|
| 724 | /**
|
| 725 | Initializes Pending Break feature to specific state.
|
| 726 |
|
| 727 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 728 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 729 | structure for the CPU executing this function.
|
| 730 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 731 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 732 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 733 | RegisterCpuFeature().
|
| 734 | @param[in] State If TRUE, then the Pending Break feature must be enabled.
|
| 735 | If FALSE, then the Pending Break feature must be disabled.
|
| 736 |
|
| 737 | @retval RETURN_SUCCESS Pending Break feature is initialized.
|
| 738 |
|
| 739 | @note This service could be called by BSP only.
|
| 740 | **/
|
| 741 | RETURN_STATUS
|
| 742 | EFIAPI
|
| 743 | PendingBreakInitialize (
|
| 744 | IN UINTN ProcessorNumber,
|
| 745 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 746 | IN VOID *ConfigData, OPTIONAL
|
| 747 | IN BOOLEAN State
|
| 748 | );
|
| 749 |
|
| 750 | /**
|
| 751 | Detects if C1E feature supported on current processor.
|
| 752 |
|
| 753 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 754 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 755 | structure for the CPU executing this function.
|
| 756 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 757 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 758 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 759 | RegisterCpuFeature().
|
| 760 |
|
| 761 | @retval TRUE C1E feature is supported.
|
| 762 | @retval FALSE C1E feature is not supported.
|
| 763 |
|
| 764 | @note This service could be called by BSP/APs.
|
| 765 | **/
|
| 766 | BOOLEAN
|
| 767 | EFIAPI
|
| 768 | C1eSupport (
|
| 769 | IN UINTN ProcessorNumber,
|
| 770 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 771 | IN VOID *ConfigData OPTIONAL
|
| 772 | );
|
| 773 |
|
| 774 | /**
|
| 775 | Initializes C1E feature to specific state.
|
| 776 |
|
| 777 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 778 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 779 | structure for the CPU executing this function.
|
| 780 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 781 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 782 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 783 | RegisterCpuFeature().
|
| 784 | @param[in] State If TRUE, then the C1E feature must be enabled.
|
| 785 | If FALSE, then the C1E feature must be disabled.
|
| 786 |
|
| 787 | @retval RETURN_SUCCESS C1E feature is initialized.
|
| 788 |
|
| 789 | @note This service could be called by BSP only.
|
| 790 | **/
|
| 791 | RETURN_STATUS
|
| 792 | EFIAPI
|
| 793 | C1eInitialize (
|
| 794 | IN UINTN ProcessorNumber,
|
| 795 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 796 | IN VOID *ConfigData, OPTIONAL
|
| 797 | IN BOOLEAN State
|
| 798 | );
|
| 799 |
|
| 800 | /**
|
Jeff Fan | dc834fb | 2017-05-24 13:45:25 +0800 | [diff] [blame] | 801 | Prepares for the data used by CPU feature detection and initialization.
|
| 802 |
|
| 803 | @param[in] NumberOfProcessors The number of CPUs in the platform.
|
| 804 |
|
| 805 | @return Pointer to a buffer of CPU related configuration data.
|
| 806 |
|
| 807 | @note This service could be called by BSP only.
|
| 808 | **/
|
| 809 | VOID *
|
| 810 | EFIAPI
|
| 811 | X2ApicGetConfigData (
|
| 812 | IN UINTN NumberOfProcessors
|
| 813 | );
|
| 814 |
|
| 815 | /**
|
Jeff Fan | 80c4b23 | 2017-04-05 16:33:16 +0800 | [diff] [blame] | 816 | Detects if X2Apci feature supported on current processor.
|
| 817 |
|
| 818 | Detect if X2Apci has been already enabled.
|
| 819 |
|
| 820 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 821 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 822 | structure for the CPU executing this function.
|
| 823 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 824 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 825 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 826 | RegisterCpuFeature().
|
| 827 |
|
| 828 | @retval TRUE X2Apci feature is supported.
|
| 829 | @retval FALSE X2Apci feature is not supported.
|
| 830 |
|
| 831 | @note This service could be called by BSP/APs.
|
| 832 | **/
|
| 833 | BOOLEAN
|
| 834 | EFIAPI
|
| 835 | X2ApicSupport (
|
| 836 | IN UINTN ProcessorNumber,
|
| 837 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 838 | IN VOID *ConfigData OPTIONAL
|
| 839 | );
|
| 840 |
|
| 841 | /**
|
| 842 | Initializes X2Apci feature to specific state.
|
| 843 |
|
| 844 | @param[in] ProcessorNumber The index of the CPU executing this function.
|
| 845 | @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
|
| 846 | structure for the CPU executing this function.
|
| 847 | @param[in] ConfigData A pointer to the configuration buffer returned
|
| 848 | by CPU_FEATURE_GET_CONFIG_DATA. NULL if
|
| 849 | CPU_FEATURE_GET_CONFIG_DATA was not provided in
|
| 850 | RegisterCpuFeature().
|
| 851 | @param[in] State If TRUE, then the X2Apci feature must be enabled.
|
| 852 | If FALSE, then the X2Apci feature must be disabled.
|
| 853 |
|
| 854 | @retval RETURN_SUCCESS X2Apci feature is initialized.
|
| 855 |
|
| 856 | @note This service could be called by BSP only.
|
| 857 | **/
|
| 858 | RETURN_STATUS
|
| 859 | EFIAPI
|
| 860 | X2ApicInitialize (
|
| 861 | IN UINTN ProcessorNumber,
|
| 862 | IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
|
| 863 | IN VOID *ConfigData, OPTIONAL
|
| 864 | IN BOOLEAN State
|
| 865 | );
|
| 866 |
|
| 867 | /**
|
| 868 | Prepares for the data used by CPU feature detection and initialization.
|
| 869 |
|
| 870 | @param[in] NumberOfProcessors The number of CPUs in the platform.
|
| 871 |
|
| 872 | @return Pointer to a buffer of CPU related configuration data.
|
| 873 |
|
| 874 | @note This service could be called by BSP only.
|
| 875 | **/
|
| 876 | VOID *
|
| 877 | EFIAPI
|
| 878 | FeatureControlGetConfigData (
|
| 879 | IN UINTN NumberOfProcessors
|
| 880 | );
|
| 881 |
|
| 882 | #endif
|