.. | .. |
---|
4 | 4 | */ |
---|
5 | 5 | #include <linux/cpu.h> |
---|
6 | 6 | |
---|
7 | | -#include <asm/pat.h> |
---|
| 7 | +#include <asm/memtype.h> |
---|
| 8 | +#include <asm/apic.h> |
---|
8 | 9 | #include <asm/processor.h> |
---|
9 | 10 | |
---|
10 | | -#include <asm/apic.h> |
---|
| 11 | +#include "cpu.h" |
---|
11 | 12 | |
---|
12 | 13 | struct cpuid_bit { |
---|
13 | 14 | u16 feature; |
---|
.. | .. |
---|
17 | 18 | u32 sub_leaf; |
---|
18 | 19 | }; |
---|
19 | 20 | |
---|
20 | | -/* Please keep the leaf sorted by cpuid_bit.level for faster search. */ |
---|
| 21 | +/* |
---|
| 22 | + * Please keep the leaf sorted by cpuid_bit.level for faster search. |
---|
| 23 | + * X86_FEATURE_MBA is supported by both Intel and AMD. But the CPUID |
---|
| 24 | + * levels are different and there is a separate entry for each. |
---|
| 25 | + */ |
---|
21 | 26 | static const struct cpuid_bit cpuid_bits[] = { |
---|
22 | 27 | { X86_FEATURE_APERFMPERF, CPUID_ECX, 0, 0x00000006, 0 }, |
---|
23 | 28 | { X86_FEATURE_EPB, CPUID_ECX, 3, 0x00000006, 0 }, |
---|
| 29 | + { X86_FEATURE_RRSBA_CTRL, CPUID_EDX, 2, 0x00000007, 2 }, |
---|
24 | 30 | { X86_FEATURE_CQM_LLC, CPUID_EDX, 1, 0x0000000f, 0 }, |
---|
25 | 31 | { X86_FEATURE_CQM_OCCUP_LLC, CPUID_EDX, 0, 0x0000000f, 1 }, |
---|
26 | 32 | { X86_FEATURE_CQM_MBM_TOTAL, CPUID_EDX, 1, 0x0000000f, 1 }, |
---|
.. | .. |
---|
30 | 36 | { X86_FEATURE_CDP_L3, CPUID_ECX, 2, 0x00000010, 1 }, |
---|
31 | 37 | { X86_FEATURE_CDP_L2, CPUID_ECX, 2, 0x00000010, 2 }, |
---|
32 | 38 | { X86_FEATURE_MBA, CPUID_EBX, 3, 0x00000010, 0 }, |
---|
| 39 | + { X86_FEATURE_PER_THREAD_MBA, CPUID_ECX, 0, 0x00000010, 3 }, |
---|
33 | 40 | { X86_FEATURE_HW_PSTATE, CPUID_EDX, 7, 0x80000007, 0 }, |
---|
34 | 41 | { X86_FEATURE_CPB, CPUID_EDX, 9, 0x80000007, 0 }, |
---|
35 | 42 | { X86_FEATURE_PROC_FEEDBACK, CPUID_EDX, 11, 0x80000007, 0 }, |
---|
36 | | - { X86_FEATURE_SME, CPUID_EAX, 0, 0x8000001f, 0 }, |
---|
37 | | - { X86_FEATURE_SEV, CPUID_EAX, 1, 0x8000001f, 0 }, |
---|
| 43 | + { X86_FEATURE_MBA, CPUID_EBX, 6, 0x80000008, 0 }, |
---|
38 | 44 | { 0, 0, 0, 0, 0 } |
---|
39 | 45 | }; |
---|
40 | 46 | |
---|
.. | .. |
---|
60 | 66 | set_cpu_cap(c, cb->feature); |
---|
61 | 67 | } |
---|
62 | 68 | } |
---|
63 | | - |
---|
64 | | -u32 get_scattered_cpuid_leaf(unsigned int level, unsigned int sub_leaf, |
---|
65 | | - enum cpuid_regs_idx reg) |
---|
66 | | -{ |
---|
67 | | - const struct cpuid_bit *cb; |
---|
68 | | - u32 cpuid_val = 0; |
---|
69 | | - |
---|
70 | | - for (cb = cpuid_bits; cb->feature; cb++) { |
---|
71 | | - |
---|
72 | | - if (level > cb->level) |
---|
73 | | - continue; |
---|
74 | | - |
---|
75 | | - if (level < cb->level) |
---|
76 | | - break; |
---|
77 | | - |
---|
78 | | - if (reg == cb->reg && sub_leaf == cb->sub_leaf) { |
---|
79 | | - if (cpu_has(&boot_cpu_data, cb->feature)) |
---|
80 | | - cpuid_val |= BIT(cb->bit); |
---|
81 | | - } |
---|
82 | | - } |
---|
83 | | - |
---|
84 | | - return cpuid_val; |
---|
85 | | -} |
---|
86 | | -EXPORT_SYMBOL_GPL(get_scattered_cpuid_leaf); |
---|