mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-04 12:16:56 +07:00
x86, xsave: Check cpuid level for XSTATE_CPUID (0x0d)
The patch introduces the XSTATE_CPUID macro and adds a check that tests if XSTATE_CPUID exists. Signed-off-by: Robert Richter <robert.richter@amd.com> LKML-Reference: <1279731838-1522-4-git-send-email-robert.richter@amd.com> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
parent
97e80a70db
commit
ee813d53a8
@ -4,6 +4,8 @@
|
|||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
|
|
||||||
|
#define XSTATE_CPUID 0x0000000d
|
||||||
|
|
||||||
#define XSTATE_FP 0x1
|
#define XSTATE_FP 0x1
|
||||||
#define XSTATE_SSE 0x2
|
#define XSTATE_SSE 0x2
|
||||||
#define XSTATE_YMM 0x4
|
#define XSTATE_YMM 0x4
|
||||||
|
@ -379,7 +379,7 @@ static void setup_xstate_features(void)
|
|||||||
xstate_sizes = alloc_bootmem(xstate_features * sizeof(int));
|
xstate_sizes = alloc_bootmem(xstate_features * sizeof(int));
|
||||||
|
|
||||||
do {
|
do {
|
||||||
cpuid_count(0xd, leaf, &eax, &ebx, &ecx, &edx);
|
cpuid_count(XSTATE_CPUID, leaf, &eax, &ebx, &ecx, &edx);
|
||||||
|
|
||||||
if (eax == 0)
|
if (eax == 0)
|
||||||
break;
|
break;
|
||||||
@ -425,7 +425,12 @@ static void __cpuinit xstate_enable_boot_cpu(void)
|
|||||||
{
|
{
|
||||||
unsigned int eax, ebx, ecx, edx;
|
unsigned int eax, ebx, ecx, edx;
|
||||||
|
|
||||||
cpuid_count(0xd, 0, &eax, &ebx, &ecx, &edx);
|
if (boot_cpu_data.cpuid_level < XSTATE_CPUID) {
|
||||||
|
WARN(1, KERN_ERR "XSTATE_CPUID missing\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
cpuid_count(XSTATE_CPUID, 0, &eax, &ebx, &ecx, &edx);
|
||||||
pcntxt_mask = eax + ((u64)edx << 32);
|
pcntxt_mask = eax + ((u64)edx << 32);
|
||||||
|
|
||||||
if ((pcntxt_mask & XSTATE_FPSSE) != XSTATE_FPSSE) {
|
if ((pcntxt_mask & XSTATE_FPSSE) != XSTATE_FPSSE) {
|
||||||
@ -444,7 +449,7 @@ static void __cpuinit xstate_enable_boot_cpu(void)
|
|||||||
/*
|
/*
|
||||||
* Recompute the context size for enabled features
|
* Recompute the context size for enabled features
|
||||||
*/
|
*/
|
||||||
cpuid_count(0xd, 0, &eax, &ebx, &ecx, &edx);
|
cpuid_count(XSTATE_CPUID, 0, &eax, &ebx, &ecx, &edx);
|
||||||
xstate_size = ebx;
|
xstate_size = ebx;
|
||||||
|
|
||||||
update_regset_xstate_info(xstate_size, pcntxt_mask);
|
update_regset_xstate_info(xstate_size, pcntxt_mask);
|
||||||
|
Loading…
Reference in New Issue
Block a user