2 LimitCpuidMaxval Feature.
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
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.
15 #include "CpuCommonFeatures.h"
18 Detects if LimitCpuidMaxval feature supported on current processor.
20 @param[in] ProcessorNumber The index of the CPU executing this function.
21 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
22 structure for the CPU executing this function.
23 @param[in] ConfigData A pointer to the configuration buffer returned
24 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
25 CPU_FEATURE_GET_CONFIG_DATA was not provided in
28 @retval TRUE LimitCpuidMaxval feature is supported.
29 @retval FALSE LimitCpuidMaxval feature is not supported.
31 @note This service could be called by BSP/APs.
35 LimitCpuidMaxvalSupport (
36 IN UINTN ProcessorNumber
,
37 IN REGISTER_CPU_FEATURE_INFORMATION
*CpuInfo
,
38 IN VOID
*ConfigData OPTIONAL
43 AsmCpuid (CPUID_SIGNATURE
, &Eax
, NULL
, NULL
, NULL
);
48 Initializes LimitCpuidMaxval feature to specific state.
50 @param[in] ProcessorNumber The index of the CPU executing this function.
51 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
52 structure for the CPU executing this function.
53 @param[in] ConfigData A pointer to the configuration buffer returned
54 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
55 CPU_FEATURE_GET_CONFIG_DATA was not provided in
57 @param[in] State If TRUE, then the LimitCpuidMaxval feature must be enabled.
58 If FALSE, then the LimitCpuidMaxval feature must be disabled.
60 @retval RETURN_SUCCESS LimitCpuidMaxval feature is initialized.
62 @note This service could be called by BSP only.
66 LimitCpuidMaxvalInitialize (
67 IN UINTN ProcessorNumber
,
68 IN REGISTER_CPU_FEATURE_INFORMATION
*CpuInfo
,
69 IN VOID
*ConfigData
, OPTIONAL
73 CPU_REGISTER_TABLE_WRITE_FIELD (
77 MSR_IA32_MISC_ENABLE_REGISTER
,
78 Bits
.LimitCpuidMaxval
,
81 return RETURN_SUCCESS
;