x86/amd: Drop legacy logic
cover x86/amd: Drop legacy logic
Some of this has been unused for more than a decade. Some for a quarter of a centry.
Andrew Cooper (3):
x86/cpu: Sort headers
x86/amd: Drop vestigial PBE logic in init_amd() x86/amd: Drop the cpuid_mask_* command line options
CHANGELOG.md | 4 + docs/misc/xen-command-line.pandoc | 40 ---------- xen/arch/x86/cpu/amd.c | 126 ++---------------------------- xen/arch/x86/cpu/centaur.c | 10 ++- xen/arch/x86/cpu/hygon.c | 1 + xen/arch/x86/include/asm/amd.h | 90 --------------------- 6 files changed, 19 insertions(+), 252 deletions(-)
base-commit: 08c787f66cced18f0d0afafd86a040341adbd031
Signature · 1 line
2.39.5
PATCH 1/3 x86/cpu: Sort headers
No functional change.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
--- xen/arch/x86/cpu/amd.c | 15 ++++++++------- xen/arch/x86/cpu/centaur.c | 10 ++++++---- xen/arch/x86/cpu/hygon.c | 1 + 3 files changed, 15 insertions(+), 11 deletions(-)
xen/arch/x86/cpu/amd.c +8 -7
@@ -1,21 +1,22 @@ +#include <xen/bitops.h> #include <xen/cpu.h> #include <xen/init.h> -#include <xen/bitops.h> #include <xen/mm.h> #include <xen/param.h> -#include <xen/smp.h> -#include <xen/softirq.h> #include <xen/pci.h> #include <xen/sched.h> +#include <xen/smp.h> +#include <xen/softirq.h> #include <xen/warning.h> + +#include <asm/acpi.h> +#include <asm/amd.h> +#include <asm/apic.h> #include <asm/io.h> +#include <asm/microcode.h> #include <asm/msr.h> #include <asm/processor.h> -#include <asm/amd.h> #include <asm/spec_ctrl.h> -#include <asm/acpi.h> -#include <asm/apic.h> -#include <asm/microcode.h> #include "cpu.h"
xen/arch/x86/cpu/centaur.c +6 -4
@@ -1,9 +1,11 @@ -#include <xen/lib.h> -#include <xen/init.h> #include <xen/bitops.h> -#include <asm/processor.h> -#include <asm/msr.h> +#include <xen/init.h> +#include <xen/lib.h> +#include <asm/e820.h> +#include <asm/msr.h> +#include <asm/processor.h> +#include "cpu.h" #define ACE_PRESENT (1 << 6)
xen/arch/x86/cpu/hygon.c +1 -0
@@ -1,4 +1,5 @@#include <xen/init.h> +#include <asm/processor.h> #include <asm/spec_ctrl.h>
Signature · 1 line
2.39.5
Re: [PATCH 1/3] x86/cpu: Sort headers
Quoted 3 lines · Andrew Cooper
No functional change.
Signed-off-by Andrew Cooper <[email protected]>
PATCH 2/3 x86/amd: Drop vestigial PBE logic in init_amd()
In reply to Andrew CooperThe comment was adjusted by myself in commit 51bd4bbdfdba ("x86: drop X86_FEATURE_3DNOW_ALT"), on the presumption that the underlying logic existed for a good reason.
Having done further archaeology, it turns out to be vestigial technical debt from the leadup to Linux 2.4 in November 2000.
Prior to "Massive cleanup of CPU detection and bug handling", c->x86_capability was a single uint32_t containing cpuid(1).edx, cpuid(0x80000001).edx, or a synthesis thereof. X86_FEATURE_AMD3D was defined as the top bit this single uint32_t.
After "Massive cleanup of CPU detection and bug handling", c->x86_capability became an array with AMD's extended feature leaf split away from Intel's basic feature leaf.
AMD doc #20734-G states that 3DNow is only enumerated in the extended feature leaf, and that other vendors where using this bit too. i.e. AMD never produced a CPU which set bit 31 in the basic leaf, meaning that there's nothing to clear out in the first place.
This logic looks like it was relevant in the pre-"Massive cleanup" world but ought to have been dropped when c->x86_capability was properly split.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
Linux patch:
https://lore.kernel.org/lkml/[email protected]/T/#u
--- xen/arch/x86/cpu/amd.c | 7 ------- 1 file changed, 7 deletions(-)
xen/arch/x86/cpu/amd.c +0 -7
@@ -1131,13 +1131,6 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)wrmsrl (MSR_K8_HWCR , value); } -/* -* Some AMD CPUs duplicate the 3DNow bit in base and extended CPUID -* leaves. Unfortunately, this aliases PBE on Intel CPUs. Clobber the -* alias, leaving 3DNow in the extended leaf. -*/ -__clear_bit (X86_FEATURE_PBE , c->x86_capability); -if (c->x86 ==0xf && c->x86_model <0x14 &&cpu_has (c,X86_FEATURE_LAHF_LM )) {/*
Signature · 1 line
2.39.5
Re: [PATCH 2/3] x86/amd: Drop vestigial PBE logic in init_amd()
Quoted 21 lines · Andrew Cooper
The comment was adjusted by myself in commit
51bd4bbdfdba("x86: dropX86_FEATURE_3DNOW_ALT"), on the presumption that the underlying logic existed for a good reason.Having done further archaeology, it turns out to be vestigial technical debt from the leadup to Linux 2.4 in November 2000.
Prior to "Massive cleanup of CPU detection and bug handling",
c->x86_capabilitywas a singleuint32_tcontaining cpuid(1).edx, cpuid(0x80000001).edx, or a synthesis thereof.X86_FEATURE_AMD3Dwas defined as the top bit this singleuint32_t.After "Massive cleanup of CPU detection and bug handling",
c->x86_capabilitybecame an array with AMD's extended feature leaf split away from Intel's basic feature leaf.AMD doc #20734-G states that 3DNow is only enumerated in the extended feature leaf, and that other vendors where using this bit too. i.e. AMD never produced a CPU which set bit 31 in the basic leaf, meaning that there's nothing to clear out in the first place.
Quoted 4 lines
This logic looks like it was relevant in the pre-"Massive cleanup" world but ought to have been dropped when
c->x86_capabilitywas properly split.Signed-off-by Andrew Cooper <[email protected]>
albeit I think that, along the lines of a comment I made on Matrix, that ...
xen/arch/x86/cpu/amd.c static void cf_check init_amd(struct cpuinfo_x86 *c) · line 1139
Quoted 12 lines
xen/arch/x86/cpu/amd.c +0
-6@@ -1131,13 +1131,6 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)wrmsrl (MSR_K8_HWCR , value); } -/* -* Some AMD CPUs duplicate the 3DNow bit in base and extended CPUID -* leaves. Unfortunately, this aliases PBE on Intel CPUs. Clobber the -* alias, leaving 3DNow in the extended leaf. -*/ -__clear_bit (X86_FEATURE_PBE , c->x86_capability);
... while the justification applies to what the CPUs surface on their own, the basic leaf masking MSR could (likely) still have undue bits set, and hence may want pruning in exchange / addition.
Jan
Re: [PATCH 2/3] x86/amd: Drop vestigial PBE logic in init_amd()
Quoted 22 lines · Jan Beulich
Quoted 21 lines · Andrew Cooper
The comment was adjusted by myself in commit
51bd4bbdfdba("x86: dropX86_FEATURE_3DNOW_ALT"), on the presumption that the underlying logic existed for a good reason.Having done further archaeology, it turns out to be vestigial technical debt from the leadup to Linux 2.4 in November 2000.
Prior to "Massive cleanup of CPU detection and bug handling",
c->x86_capabilitywas a singleuint32_tcontaining cpuid(1).edx, cpuid(0x80000001).edx, or a synthesis thereof.X86_FEATURE_AMD3Dwas defined as the top bit this singleuint32_t.After "Massive cleanup of CPU detection and bug handling",
c->x86_capabilitybecame an array with AMD's extended feature leaf split away from Intel's basic feature leaf.AMD doc #20734-G states that 3DNow is only enumerated in the extended feature leaf, and that other vendors where using this bit too. i.e. AMD never produced a CPU which set bit 31 in the basic leaf, meaning that there's nothing to clear out in the first place.
Quoted 5 lines
Quoted 4 lines
This logic looks like it was relevant in the pre-"Massive cleanup" world but ought to have been dropped when
c->x86_capabilitywas properly split.Signed-off-by Andrew Cooper <[email protected]>Acked-by Jan Beulich <[email protected]>
Thanks.
Quoted 8 lines
albeit I think that, along the lines of a comment I made on Matrix, that ...
Quoted 6 lines
xen/arch/x86/cpu/amd.c +0
-0@@ -1131,13 +1131,6 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)wrmsrl (MSR_K8_HWCR , value); }
Quoted 9 lines
xen/arch/x86/cpu/amd.c static void cf_check init_amd(struct cpuinfo_x86 *c) · line 1139
Quoted 6 lines
xen/arch/x86/cpu/amd.c +0
-6-/* -* Some AMD CPUs duplicate the 3DNow bit in base and extended CPUID -* leaves. Unfortunately, this aliases PBE on Intel CPUs. Clobber the -* alias, leaving 3DNow in the extended leaf. -*/ -__clear_bit (X86_FEATURE_PBE , c->x86_capability);... while the justification applies to what the CPUs surface on their own, the basic leaf masking MSR could (likely) still have undue bits set, and hence may want pruning in exchange / addition.
As said, the ability to control CPUID in this way postdates by a decade this logic in Linux, and this logic came about because of a logical issue/shortcut taken by Linux, not because of a CPU which really mis-reported this bit.
We do have logic which adjusts the override MSRs on AMD based on errata.
~Andrew
PATCH 3/3 x86/amd: Drop the cpuid_mask_* command line options
In reply to Andrew CooperAs noted in the command line documentation, these are both deprecated since Xen 4.7 (2016), and are not fully effective on AMD CPUs starting from 2011.
Not realised at the time of writing the docs was that their use is also incompatible with certain errata workarounds which edit the CPUID MSRs after the levelling defaults are calculated.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Oleksii Kurochko <[email protected]>
--- CHANGELOG.md | 4 ++ docs/misc/xen-command-line.pandoc | 40 ------------ xen/arch/x86/cpu/amd.c | 104 ------------------------------ xen/arch/x86/include/asm/amd.h | 90 -------------------------- 4 files changed, 4 insertions(+), 234 deletions(-)
CHANGELOG.md +4 -0
@@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Added ### Removed + - On x86: + - The cpuid_mask_* command line options for legacy AMD CPUs. These were + deprecated in Xen 4.7 and noted not to work correctly with AMD CPUs from + 2011 onwards. ## [4.21.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.21.0) - 2025-11-19
docs/misc/xen-command-line.pandoc +0 -40
@@ -587,46 +587,6 @@ applicable. They can all be ignored. in its positive form to override Xen's default behaviour on these systems, and make the feature fully usable. -### cpuid_mask_cpu -> `= fam_0f_rev_[cdefg] | fam_10_rev_[bc] | fam_11_rev_b` - -> Applicability: AMD - -If none of the other **cpuid_mask_\*** options are given, Xen has a set of -pre-configured masks to make the current processor appear to be -family/revision specified. - -See below for general information on masking. - -**Warning: This option is not fully effective on Family 15h processors or -later.** - -### cpuid_mask_ecx -### cpuid_mask_edx -### cpuid_mask_ext_ecx -### cpuid_mask_ext_edx -### cpuid_mask_l7s0_eax -### cpuid_mask_l7s0_ebx -### cpuid_mask_thermal_ecx -### cpuid_mask_xsave_eax -> `= <integer>` - -> Applicability: x86. Default: `~0` (all bits set) - -The availability of these options are model specific. Some processors don't -support any of them, and no processor supports all of them. Xen will ignore -options on processors which are lacking support. - -These options can be used to alter the features visible via the `CPUID` -instruction. Settings applied here take effect globally, including for Xen -and all guests. - -Note: Since Xen 4.7, it is no longer necessary to mask a host to create -migration safety in heterogeneous scenarios. All necessary CPUID settings -should be provided in the VM configuration file. Furthermore, it is -recommended not to use this option, as doing so causes an unnecessary -reduction of features at Xen's disposal to manage guests. - ### cpuidle (x86) > `= <boolean>`
xen/arch/x86/cpu/amd.c +0 -104
151 lines not on this page · raw message
xen/arch/x86/include/asm/amd.h +0 -90
96 lines not on this page · raw message
Signature · 1 line
2.39.5
Re: [PATCH 3/3] x86/amd: Drop the cpuid_mask_* command line options
Quoted 2 lines · Andrew Cooper
As noted in the command line documentation, these are both deprecated since Xen 4.7 (2016), and are not fully effective on AMD CPUs starting from 2011.
The latter was said only for one of them, though.
Quoted 5 lines
Not realised at the time of writing the docs was that their use is also incompatible with certain errata workarounds which edit the CPUID MSRs after the levelling defaults are calculated.
Signed-off-by Andrew Cooper <[email protected]>
Re: [PATCH 3/3] x86/amd: Drop the cpuid_mask_* command line options
In reply to Andrew CooperQuoted 7 lines · Andrew Cooper
As noted in the command line documentation, these are both deprecated since Xen 4.7 (2016), and are not fully effective on AMD CPUs starting from 2011.
Not realised at the time of writing the docs was that their use is also incompatible with certain errata workarounds which edit the CPUID MSRs after the levelling defaults are calculated.
Quoted 7 lines
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Oleksii Kurochko <[email protected]>--- CHANGELOG.md | 4 ++
for CHANGELOG.md:
Thanks.
~ Oleksii
Quoted 333 lines
docs/misc/xen-command-line.pandoc | 40 ------------ xen/arch/x86/cpu/amd.c | 104 ------------------------------ xen/arch/x86/include/asm/amd.h | 90 -------------------------- 4 files changed, 4 insertions(+), 234 deletions(-)CHANGELOG.md +4
-0@@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Added ### Removed + - On x86: + - The cpuid_mask_* command line options for legacy AMD CPUs. These were + deprecated in Xen 4.7 and noted not to work correctly with AMD CPUs from + 2011 onwards. ## [4.21.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.21.0) - 2025-11-19docs/misc/xen-command-line.pandoc +0
-40@@ -587,46 +587,6 @@ applicable. They can all be ignored. in its positive form to override Xen's default behaviour on these systems, and make the feature fully usable. -### cpuid_mask_cpu -> `= fam_0f_rev_[cdefg] | fam_10_rev_[bc] | fam_11_rev_b` - -> Applicability: AMD - -If none of the other **cpuid_mask_\*** options are given, Xen has a set of -pre-configured masks to make the current processor appear to be -family/revision specified. - -See below for general information on masking. - -**Warning: This option is not fully effective on Family 15h processors or -later.** - -### cpuid_mask_ecx -### cpuid_mask_edx -### cpuid_mask_ext_ecx -### cpuid_mask_ext_edx -### cpuid_mask_l7s0_eax -### cpuid_mask_l7s0_ebx -### cpuid_mask_thermal_ecx -### cpuid_mask_xsave_eax -> `= <integer>` - -> Applicability: x86. Default: `~0` (all bits set) - -The availability of these options are model specific. Some processors don't -support any of them, and no processor supports all of them. Xen will ignore -options on processors which are lacking support. - -These options can be used to alter the features visible via the `CPUID` -instruction. Settings applied here take effect globally, including for Xen -and all guests. - -Note: Since Xen 4.7, it is no longer necessary to mask a host to create -migration safety in heterogeneous scenarios. All necessary CPUID settings -should be provided in the VM configuration file. Furthermore, it is -recommended not to use this option, as doing so causes an unnecessary -reduction of features at Xen's disposal to manage guests. - ### cpuidle (x86) > `= <boolean>`xen/arch/x86/cpu/amd.c +0
-104@@ -20,32 +20,6 @@#include "cpu.h" -/* -* Pre-canned values for overriding the CPUID features -* and extended features masks. -* -* Currently supported processors: -* -* "fam_0f_rev_c" -* "fam_0f_rev_d" -* "fam_0f_rev_e" -* "fam_0f_rev_f" -* "fam_0f_rev_g" -* "fam_10_rev_b" -* "fam_10_rev_c" -* "fam_11_rev_b" -*/ -static char __initdata opt_famrev[14 ]; -string_param ("cpuid_mask_cpu" , opt_famrev); - -static unsigned int __initdata opt_cpuid_mask_l7s0_eax = ~0u ; -integer_param ("cpuid_mask_l7s0_eax" , opt_cpuid_mask_l7s0_eax); -static unsigned int __initdata opt_cpuid_mask_l7s0_ebx = ~0u ; -integer_param ("cpuid_mask_l7s0_ebx" , opt_cpuid_mask_l7s0_ebx); - -static unsigned int __initdata opt_cpuid_mask_thermal_ecx = ~0u ; -integer_param ("cpuid_mask_thermal_ecx" , opt_cpuid_mask_thermal_ecx); -/* 1 = allow, 0 = don't allow guest creation, -1 = don't allow boot */ int8_t __read_mostly opt_allow_unsafe;boolean_param ("allow_unsafe" , opt_allow_unsafe);@@ -114,51 +88,6 @@ static void wrmsr_amd(unsigned int msr, uint64_t val) "d" (val >> 32), "D" (0x9c5a203a)); } -static const struct cpuidmask { - uint16_t fam; - char rev[2]; - unsigned int ecx, edx, ext_ecx, ext_edx; -} pre_canned[] __initconst = { -#define CAN(fam, id, rev) { \ - fam, #rev, \ - AMD_FEATURES_##id##_REV_##rev##_ECX, \ - AMD_FEATURES_##id##_REV_##rev##_EDX, \ - AMD_EXTFEATURES_##id##_REV_##rev##_ECX, \ - AMD_EXTFEATURES_##id##_REV_##rev##_EDX \ - } -#define CAN_FAM (fam, rev) CAN(0x##fam, FAM##fam##h, rev) -#define CAN_K8 (rev) CAN(0x0f, K8, rev) -CAN_FAM (11 ,B ), -CAN_FAM (10 ,C ), -CAN_FAM (10 ,B ), -CAN_K8 (G ), -CAN_K8 (F ), -CAN_K8 (E ), -CAN_K8 (D ), -CAN_K8 (C ) -#undef CAN -}; - -static const struct cpuidmask *__init noinline get_cpuidmask(const char *opt) -{ -unsigned long fam; -char rev; -unsigned int i; - -if (strncmp (opt,"fam_" ,4 )) -return NULL ; - fam =simple_strtoul (opt +4 , &opt,16 ); -if (strncmp (opt,"_rev_" ,5 ) || !opt[5 ] || opt[6 ]) -return NULL ; - rev =toupper (opt[5 ]); - -for (i =0 ; i <ARRAY_SIZE (pre_canned); ++i) -if (fam == pre_canned[i].fam && rev == *pre_canned[i].rev) -return &pre_canned[i]; - -return NULL ; -} -/* * Sets caps in expected_levelling_cap, probes for the specified mask MSR, and * set caps in levelling_caps if it is found. Processors prior to Fam 10h @@ -295,8 +224,6 @@ static const typeof(ctxt_switch_masking) __initconst_cf_clobber __used csm =*/ static void __init noinline amd_init_levelling(void) { -const struct cpuidmask *m =NULL ; -/* * If there's support for CpuidUserDis or CPUID faulting then * we can skip levelling because CPUID accesses are trapped anyway. @@ -318,26 +245,11 @@ static void __init noinline amd_init_levelling(void)probe_masking_msrs (); -if (*opt_famrev !='\0' ) { - m =get_cpuidmask (opt_famrev); - -if (!m) -printk ("Invalid processor string: %s\n" , opt_famrev); - } -if ((levelling_caps & LCAP_1cd) == LCAP_1cd) {uint32_t ecx, edx, tmp;cpuid (0x00000001 , &tmp, &tmp, &ecx, &edx); -if (~(opt_cpuid_mask_ecx & opt_cpuid_mask_edx)) { - ecx &= opt_cpuid_mask_ecx; - edx &= opt_cpuid_mask_edx; - }else if (m) { - ecx &= m->ecx; - edx &= m->edx; - } -/* Fast-forward bits - Must be set. */ if (ecx &cpufeat_mask (X86_FEATURE_XSAVE )) ecx |=cpufeat_mask (X86_FEATURE_OSXSAVE );@@ -351,14 +263,6 @@ static void __init noinline amd_init_levelling(void)cpuid (0x80000001 , &tmp, &tmp, &ecx, &edx); -if (~(opt_cpuid_mask_ext_ecx & opt_cpuid_mask_ext_edx)) { - ecx &= opt_cpuid_mask_ext_ecx; - edx &= opt_cpuid_mask_ext_edx; - }else if (m) { - ecx &= m->ext_ecx; - edx &= m->ext_edx; - } -/* Fast-forward bits - Must be set. */ edx |=cpufeat_mask (X86_FEATURE_APIC );@@ -370,20 +274,12 @@ static void __init noinline amd_init_levelling(void)cpuid (0x00000007 , &eax, &ebx, &tmp, &tmp); -if (~(opt_cpuid_mask_l7s0_eax & opt_cpuid_mask_l7s0_ebx)) { - eax &= opt_cpuid_mask_l7s0_eax; - ebx &= opt_cpuid_mask_l7s0_ebx; - } - cpuidmask_defaults._7ab0 &= ((uint64_t )eax <<32 ) | ebx; }if ((levelling_caps & LCAP_6c) == LCAP_6c) {uint32_t ecx =cpuid_ecx (6 ); -if (~opt_cpuid_mask_thermal_ecx) - ecx &= opt_cpuid_mask_thermal_ecx; - cpuidmask_defaults._6c &= (~0ULL <<32 ) | ecx; }xen/arch/x86/include/asm/amd.h +0
-90@@ -7,96 +7,6 @@#include <asm/cpufeature.h> -/* CPUID masked for use by AMD-V Extended Migration */ - -/* Family 0Fh, Revision C */ -#define AMD_FEATURES_K8_REV_C_ECX 0 -#define AMD_FEATURES_K8_REV_C_EDX ( \ - cpufeat_mask(X86_FEATURE_FPU) | cpufeat_mask(X86_FEATURE_VME) | \ - cpufeat_mask(X86_FEATURE_DE) | cpufeat_mask(X86_FEATURE_PSE) | \ - cpufeat_mask(X86_FEATURE_TSC) | cpufeat_mask(X86_FEATURE_MSR) | \ - cpufeat_mask(X86_FEATURE_PAE) | cpufeat_mask(X86_FEATURE_MCE) | \ - cpufeat_mask(X86_FEATURE_CX8) | cpufeat_mask(X86_FEATURE_APIC) | \ - cpufeat_mask(X86_FEATURE_SEP) | cpufeat_mask(X86_FEATURE_MTRR) | \ - cpufeat_mask(X86_FEATURE_PGE) | cpufeat_mask(X86_FEATURE_MCA) | \ - cpufeat_mask(X86_FEATURE_CMOV) | cpufeat_mask(X86_FEATURE_PAT) | \ - cpufeat_mask(X86_FEATURE_PSE36) | cpufeat_mask(X86_FEATURE_CLFLUSH)| \ - cpufeat_mask(X86_FEATURE_MMX) | cpufeat_mask(X86_FEATURE_FXSR) | \ - cpufeat_mask(X86_FEATURE_SSE) | cpufeat_mask(X86_FEATURE_SSE2)) -#define AMD_EXTFEATURES_K8_REV_C_ECX 0 -#define AMD_EXTFEATURES_K8_REV_C_EDX ( \ - cpufeat_mask(X86_FEATURE_FPU) | cpufeat_mask(X86_FEATURE_VME) | \ - cpufeat_mask(X86_FEATURE_DE) | cpufeat_mask(X86_FEATURE_PSE) | \ - cpufeat_mask(X86_FEATURE_TSC) | cpufeat_mask(X86_FEATURE_MSR) | \ - cpufeat_mask(X86_FEATURE_PAE) | cpufeat_mask(X86_FEATURE_MCE) | \ - cpufeat_mask(X86_FEATURE_CX8) | cpufeat_mask(X86_FEATURE_APIC) | \ - cpufeat_mask(X86_FEATURE_SYSCALL) | cpufeat_mask(X86_FEATURE_MTRR) | \ - cpufeat_mask(X86_FEATURE_PGE) | cpufeat_mask(X86_FEATURE_MCA) | \ - cpufeat_mask(X86_FEATURE_CMOV) | cpufeat_mask(X86_FEATURE_PAT) | \ - cpufeat_mask(X86_FEATURE_PSE36) | cpufeat_mask(X86_FEATURE_NX) | \ - cpufeat_mask(X86_FEATURE_MMXEXT) | cpufeat_mask(X86_FEATURE_MMX) | \ - cpufeat_mask(X86_FEATURE_FXSR) | cpufeat_mask(X86_FEATURE_LM) | \ - cpufeat_mask(X86_FEATURE_3DNOWEXT) | cpufeat_mask(X86_FEATURE_3DNOW)) - -/* Family 0Fh, Revision D */ -#define AMD_FEATURES_K8_REV_D_ECX AMD_FEATURES_K8_REV_C_ECX -#define AMD_FEATURES_K8_REV_D_EDX AMD_FEATURES_K8_REV_C_EDX -#define AMD_EXTFEATURES_K8_REV_D_ECX (AMD_EXTFEATURES_K8_REV_C_ECX |\ - cpufeat_mask(X86_FEATURE_LAHF_LM)) -#define AMD_EXTFEATURES_K8_REV_D_EDX (AMD_EXTFEATURES_K8_REV_C_EDX |\ - cpufeat_mask(X86_FEATURE_FFXSR)) - -/* Family 0Fh, Revision E */ -#define AMD_FEATURES_K8_REV_E_ECX (AMD_FEATURES_K8_REV_D_ECX | \ - cpufeat_mask(X86_FEATURE_SSE3)) -#define AMD_FEATURES_K8_REV_E_EDX (AMD_FEATURES_K8_REV_D_EDX | \ - cpufeat_mask(X86_FEATURE_HTT)) -#define AMD_EXTFEATURES_K8_REV_E_ECX (AMD_EXTFEATURES_K8_REV_D_ECX |\ - cpufeat_mask(X86_FEATURE_CMP_LEGACY)) -#define AMD_EXTFEATURES_K8_REV_E_EDX AMD_EXTFEATURES_K8_REV_D_EDX - -/* Family 0Fh, Revision F */ -#define AMD_FEATURES_K8_REV_F_ECX (AMD_FEATURES_K8_REV_E_ECX | \ - cpufeat_mask(X86_FEATURE_CX16)) -#define AMD_FEATURES_K8_REV_F_EDX AMD_FEATURES_K8_REV_E_EDX -#define AMD_EXTFEATURES_K8_REV_F_ECX (AMD_EXTFEATURES_K8_REV_E_ECX |\ - cpufeat_mask(X86_FEATURE_SVM) | cpufeat_mask(X86_FEATURE_EXTAPIC) | \ - cpufeat_mask(X86_FEATURE_CR8_LEGACY)) -#define AMD_EXTFEATURES_K8_REV_F_EDX (AMD_EXTFEATURES_K8_REV_E_EDX |\ - cpufeat_mask(X86_FEATURE_RDTSCP)) - -/* Family 0Fh, Revision G */ -#define AMD_FEATURES_K8_REV_G_ECX AMD_FEATURES_K8_REV_F_ECX -#define AMD_FEATURES_K8_REV_G_EDX AMD_FEATURES_K8_REV_F_EDX -#define AMD_EXTFEATURES_K8_REV_G_ECX (AMD_EXTFEATURES_K8_REV_F_ECX |\ - cpufeat_mask(X86_FEATURE_3DNOWPREFETCH)) -#define AMD_EXTFEATURES_K8_REV_G_EDX AMD_EXTFEATURES_K8_REV_F_EDX - -/* Family 10h, Revision B */ -#define AMD_FEATURES_FAM10h_REV_B_ECX (AMD_FEATURES_K8_REV_F_ECX | \ - cpufeat_mask(X86_FEATURE_POPCNT) | cpufeat_mask(X86_FEATURE_MONITOR)) -#define AMD_FEATURES_FAM10h_REV_B_EDX AMD_FEATURES_K8_REV_F_EDX -#define AMD_EXTFEATURES_FAM10h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_F_ECX |\ - cpufeat_mask(X86_FEATURE_ABM) | cpufeat_mask(X86_FEATURE_SSE4A) | \ - cpufeat_mask(X86_FEATURE_MISALIGNSSE) | cpufeat_mask(X86_FEATURE_OSVW) |\ - cpufeat_mask(X86_FEATURE_IBS)) -#define AMD_EXTFEATURES_FAM10h_REV_B_EDX (AMD_EXTFEATURES_K8_REV_F_EDX |\ - cpufeat_mask(X86_FEATURE_PAGE1GB)) - -/* Family 10h, Revision C */ -#define AMD_FEATURES_FAM10h_REV_C_ECX AMD_FEATURES_FAM10h_REV_B_ECX -#define AMD_FEATURES_FAM10h_REV_C_EDX AMD_FEATURES_FAM10h_REV_B_EDX -#define AMD_EXTFEATURES_FAM10h_REV_C_ECX (AMD_EXTFEATURES_FAM10h_REV_B_ECX |\ - cpufeat_mask(X86_FEATURE_SKINIT) | cpufeat_mask(X86_FEATURE_WDT)) -#define AMD_EXTFEATURES_FAM10h_REV_C_EDX AMD_EXTFEATURES_FAM10h_REV_B_EDX - -/* Family 11h, Revision B */ -#define AMD_FEATURES_FAM11h_REV_B_ECX AMD_FEATURES_K8_REV_G_ECX -#define AMD_FEATURES_FAM11h_REV_B_EDX AMD_FEATURES_K8_REV_G_EDX -#define AMD_EXTFEATURES_FAM11h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_G_ECX |\ - cpufeat_mask(X86_FEATURE_SKINIT)) -#define AMD_EXTFEATURES_FAM11h_REV_B_EDX AMD_EXTFEATURES_K8_REV_G_EDX -/* AMD errata checking * * Errata are defined using the AMD_LEGACY_ERRATUM() or AMD_OSVW_ERRATUM()