Lines Matching +full:64 +full:- +full:byte

1 // SPDX-License-Identifier: GPL-2.0
51 { 0x06, LVL_1_INST, 8 }, /* 4-way set assoc, 32 byte line size */
52 { 0x08, LVL_1_INST, 16 }, /* 4-way set assoc, 32 byte line size */
53 { 0x09, LVL_1_INST, 32 }, /* 4-way set assoc, 64 byte line size */
54 { 0x0a, LVL_1_DATA, 8 }, /* 2 way set assoc, 32 byte line size */
55 { 0x0c, LVL_1_DATA, 16 }, /* 4-way set assoc, 32 byte line size */
56 { 0x0d, LVL_1_DATA, 16 }, /* 4-way set assoc, 64 byte line size */
57 { 0x0e, LVL_1_DATA, 24 }, /* 6-way set assoc, 64 byte line size */
58 { 0x21, LVL_2, 256 }, /* 8-way set assoc, 64 byte line size */
59 { 0x22, LVL_3, 512 }, /* 4-way set assoc, sectored cache, 64 byte line size */
60 { 0x23, LVL_3, MB(1) }, /* 8-way set assoc, sectored cache, 64 byte line size */
61 { 0x25, LVL_3, MB(2) }, /* 8-way set assoc, sectored cache, 64 byte line size */
62 { 0x29, LVL_3, MB(4) }, /* 8-way set assoc, sectored cache, 64 byte line size */
63 { 0x2c, LVL_1_DATA, 32 }, /* 8-way set assoc, 64 byte line size */
64 { 0x30, LVL_1_INST, 32 }, /* 8-way set assoc, 64 byte line size */
65 { 0x39, LVL_2, 128 }, /* 4-way set assoc, sectored cache, 64 byte line size */
66 { 0x3a, LVL_2, 192 }, /* 6-way set assoc, sectored cache, 64 byte line size */
67 { 0x3b, LVL_2, 128 }, /* 2-way set assoc, sectored cache, 64 byte line size */
68 { 0x3c, LVL_2, 256 }, /* 4-way set assoc, sectored cache, 64 byte line size */
69 { 0x3d, LVL_2, 384 }, /* 6-way set assoc, sectored cache, 64 byte line size */
70 { 0x3e, LVL_2, 512 }, /* 4-way set assoc, sectored cache, 64 byte line size */
71 { 0x3f, LVL_2, 256 }, /* 2-way set assoc, 64 byte line size */
72 { 0x41, LVL_2, 128 }, /* 4-way set assoc, 32 byte line size */
73 { 0x42, LVL_2, 256 }, /* 4-way set assoc, 32 byte line size */
74 { 0x43, LVL_2, 512 }, /* 4-way set assoc, 32 byte line size */
75 { 0x44, LVL_2, MB(1) }, /* 4-way set assoc, 32 byte line size */
76 { 0x45, LVL_2, MB(2) }, /* 4-way set assoc, 32 byte line size */
77 { 0x46, LVL_3, MB(4) }, /* 4-way set assoc, 64 byte line size */
78 { 0x47, LVL_3, MB(8) }, /* 8-way set assoc, 64 byte line size */
79 { 0x48, LVL_2, MB(3) }, /* 12-way set assoc, 64 byte line size */
80 { 0x49, LVL_3, MB(4) }, /* 16-way set assoc, 64 byte line size */
81 { 0x4a, LVL_3, MB(6) }, /* 12-way set assoc, 64 byte line size */
82 { 0x4b, LVL_3, MB(8) }, /* 16-way set assoc, 64 byte line size */
83 { 0x4c, LVL_3, MB(12) }, /* 12-way set assoc, 64 byte line size */
84 { 0x4d, LVL_3, MB(16) }, /* 16-way set assoc, 64 byte line size */
85 { 0x4e, LVL_2, MB(6) }, /* 24-way set assoc, 64 byte line size */
86 { 0x60, LVL_1_DATA, 16 }, /* 8-way set assoc, sectored cache, 64 byte line size */
87 { 0x66, LVL_1_DATA, 8 }, /* 4-way set assoc, sectored cache, 64 byte line size */
88 { 0x67, LVL_1_DATA, 16 }, /* 4-way set assoc, sectored cache, 64 byte line size */
89 { 0x68, LVL_1_DATA, 32 }, /* 4-way set assoc, sectored cache, 64 byte line size */
90 { 0x70, LVL_TRACE, 12 }, /* 8-way set assoc */
91 { 0x71, LVL_TRACE, 16 }, /* 8-way set assoc */
92 { 0x72, LVL_TRACE, 32 }, /* 8-way set assoc */
93 { 0x73, LVL_TRACE, 64 }, /* 8-way set assoc */
94 { 0x78, LVL_2, MB(1) }, /* 4-way set assoc, 64 byte line size */
95 { 0x79, LVL_2, 128 }, /* 8-way set assoc, sectored cache, 64 byte line size */
96 { 0x7a, LVL_2, 256 }, /* 8-way set assoc, sectored cache, 64 byte line size */
97 { 0x7b, LVL_2, 512 }, /* 8-way set assoc, sectored cache, 64 byte line size */
98 { 0x7c, LVL_2, MB(1) }, /* 8-way set assoc, sectored cache, 64 byte line size */
99 { 0x7d, LVL_2, MB(2) }, /* 8-way set assoc, 64 byte line size */
100 { 0x7f, LVL_2, 512 }, /* 2-way set assoc, 64 byte line size */
101 { 0x80, LVL_2, 512 }, /* 8-way set assoc, 64 byte line size */
102 { 0x82, LVL_2, 256 }, /* 8-way set assoc, 32 byte line size */
103 { 0x83, LVL_2, 512 }, /* 8-way set assoc, 32 byte line size */
104 { 0x84, LVL_2, MB(1) }, /* 8-way set assoc, 32 byte line size */
105 { 0x85, LVL_2, MB(2) }, /* 8-way set assoc, 32 byte line size */
106 { 0x86, LVL_2, 512 }, /* 4-way set assoc, 64 byte line size */
107 { 0x87, LVL_2, MB(1) }, /* 8-way set assoc, 64 byte line size */
108 { 0xd0, LVL_3, 512 }, /* 4-way set assoc, 64 byte line size */
109 { 0xd1, LVL_3, MB(1) }, /* 4-way set assoc, 64 byte line size */
110 { 0xd2, LVL_3, MB(2) }, /* 4-way set assoc, 64 byte line size */
111 { 0xd6, LVL_3, MB(1) }, /* 8-way set assoc, 64 byte line size */
112 { 0xd7, LVL_3, MB(2) }, /* 8-way set assoc, 64 byte line size */
113 { 0xd8, LVL_3, MB(4) }, /* 12-way set assoc, 64 byte line size */
114 { 0xdc, LVL_3, MB(2) }, /* 12-way set assoc, 64 byte line size */
115 { 0xdd, LVL_3, MB(4) }, /* 12-way set assoc, 64 byte line size */
116 { 0xde, LVL_3, MB(8) }, /* 12-way set assoc, 64 byte line size */
117 { 0xe2, LVL_3, MB(2) }, /* 16-way set assoc, 64 byte line size */
118 { 0xe3, LVL_3, MB(4) }, /* 16-way set assoc, 64 byte line size */
119 { 0xe4, LVL_3, MB(8) }, /* 16-way set assoc, 64 byte line size */
120 { 0xea, LVL_3, MB(12) }, /* 24-way set assoc, 64 byte line size */
121 { 0xeb, LVL_3, MB(18) }, /* 24-way set assoc, 64 byte line size */
122 { 0xec, LVL_3, MB(24) }, /* 24-way set assoc, 64 byte line size */
219 [0xc] = 64,
222 [0xf] = 0xffff /* fully associative - no way to show this currently */
247 eax->full = 0; in amd_cpuid4()
248 ebx->full = 0; in amd_cpuid4()
249 ecx->full = 0; in amd_cpuid4()
259 if (!l1->val) in amd_cpuid4()
261 assoc = assocs[l1->assoc]; in amd_cpuid4()
262 line_size = l1->line_size; in amd_cpuid4()
263 lines_per_tag = l1->lines_per_tag; in amd_cpuid4()
264 size_in_kb = l1->size_in_kb; in amd_cpuid4()
291 eax->split.is_self_initializing = 1; in amd_cpuid4()
292 eax->split.type = types[leaf]; in amd_cpuid4()
293 eax->split.level = levels[leaf]; in amd_cpuid4()
294 eax->split.num_threads_sharing = 0; in amd_cpuid4()
295 eax->split.num_cores_on_die = __this_cpu_read(cpu_info.x86_max_cores) - 1; in amd_cpuid4()
299 eax->split.is_fully_associative = 1; in amd_cpuid4()
300 ebx->split.coherency_line_size = line_size - 1; in amd_cpuid4()
301 ebx->split.ways_of_associativity = assoc - 1; in amd_cpuid4()
302 ebx->split.physical_line_partition = lines_per_tag - 1; in amd_cpuid4()
303 ecx->split.number_of_sets = (size_in_kb * 1024) / line_size / in amd_cpuid4()
304 (ebx->split.ways_of_associativity + 1) - 1; in amd_cpuid4()
314 struct amd_l3_cache *l3 = &nb->l3_cache; in amd_calc_l3_indices()
318 pci_read_config_dword(nb->misc, 0x1C4, &val); in amd_calc_l3_indices()
321 l3->subcaches[0] = sc0 = !(val & BIT(0)); in amd_calc_l3_indices()
322 l3->subcaches[1] = sc1 = !(val & BIT(4)); in amd_calc_l3_indices()
325 l3->subcaches[0] = sc0 += !(val & BIT(1)); in amd_calc_l3_indices()
326 l3->subcaches[1] = sc1 += !(val & BIT(5)); in amd_calc_l3_indices()
329 l3->subcaches[2] = sc2 = !(val & BIT(8)) + !(val & BIT(9)); in amd_calc_l3_indices()
330 l3->subcaches[3] = sc3 = !(val & BIT(12)) + !(val & BIT(13)); in amd_calc_l3_indices()
332 l3->indices = (max(max3(sc0, sc1, sc2), sc3) << 10) - 1; in amd_calc_l3_indices()
346 pci_read_config_dword(nb->misc, 0x1BC + slot * 4, &reg); in amd_get_l3_disable_slot()
352 return -1; in amd_get_l3_disable_slot()
359 struct amd_northbridge *nb = this_leaf->priv; in show_cache_disable()
392 if (!nb->l3_cache.subcaches[i]) in amd_l3_disable_index()
395 pci_write_config_dword(nb->misc, 0x1BC + slot * 4, reg); in amd_l3_disable_index()
405 pci_write_config_dword(nb->misc, 0x1BC + slot * 4, reg); in amd_l3_disable_index()
410 * disable a L3 cache index by using a disable-slot
427 return -EEXIST; in amd_set_l3_disable_slot()
429 if (index > nb->l3_cache.indices) in amd_set_l3_disable_slot()
430 return -EINVAL; in amd_set_l3_disable_slot()
434 return -EEXIST; in amd_set_l3_disable_slot()
447 struct amd_northbridge *nb = this_leaf->priv; in store_cache_disable()
450 return -EPERM; in store_cache_disable()
452 cpu = cpumask_first(&this_leaf->shared_cpu_map); in store_cache_disable()
455 return -EINVAL; in store_cache_disable()
459 if (err == -EEXIST) in store_cache_disable()
483 int cpu = cpumask_first(&this_leaf->shared_cpu_map); in subcaches_show()
493 int cpu = cpumask_first(&this_leaf->shared_cpu_map); in subcaches_store()
497 return -EPERM; in subcaches_store()
500 return -EINVAL; in subcaches_store()
503 return -EINVAL; in subcaches_store()
518 umode_t mode = attr->mode; in cache_private_attrs_is_visible()
520 if (!this_leaf->priv) in cache_private_attrs_is_visible()
570 struct amd_northbridge *nb = this_leaf->priv; in cache_get_priv_group()
572 if (this_leaf->level < 3 || !nb) in cache_get_priv_group()
575 if (nb && nb->l3_cache.indices) in cache_get_priv_group()
590 this_leaf->nb = node_to_amd_nb(node); in amd_init_l3_cache()
591 if (this_leaf->nb && !this_leaf->nb->l3_cache.indices) in amd_init_l3_cache()
592 amd_calc_l3_indices(this_leaf->nb); in amd_init_l3_cache()
622 return -EIO; /* better error ? */ in cpuid4_cache_lookup_regs()
624 this_leaf->eax = eax; in cpuid4_cache_lookup_regs()
625 this_leaf->ebx = ebx; in cpuid4_cache_lookup_regs()
626 this_leaf->ecx = ecx; in cpuid4_cache_lookup_regs()
627 this_leaf->size = (ecx.split.number_of_sets + 1) * in cpuid4_cache_lookup_regs()
638 int i = -1; in find_num_cache_leaves()
640 if (c->x86_vendor == X86_VENDOR_AMD || in find_num_cache_leaves()
641 c->x86_vendor == X86_VENDOR_HYGON) in find_num_cache_leaves()
664 if (c->x86 < 0x17) { in cacheinfo_amd_init_llc_id()
666 per_cpu(cpu_llc_id, cpu) = c->cpu_die_id; in cacheinfo_amd_init_llc_id()
667 } else if (c->x86 == 0x17 && c->x86_model <= 0x1F) { in cacheinfo_amd_init_llc_id()
672 per_cpu(cpu_llc_id, cpu) = c->apicid >> 3; in cacheinfo_amd_init_llc_id()
679 u32 llc_index = find_num_cache_leaves(c) - 1; in cacheinfo_amd_init_llc_id()
688 per_cpu(cpu_llc_id, cpu) = c->apicid >> bits; in cacheinfo_amd_init_llc_id()
706 per_cpu(cpu_llc_id, cpu) = c->apicid >> 3; in cacheinfo_hygon_init_llc_id()
714 } else if (c->extended_cpuid_level >= 0x80000006) { in init_amd_cacheinfo()
735 unsigned int cpu = c->cpu_index; in init_intel_cacheinfo()
738 if (c->cpuid_level > 3) { in init_intel_cacheinfo()
770 l2_id = c->apicid & ~((1 << index_msb) - 1); in init_intel_cacheinfo()
776 l3_id = c->apicid & ~((1 << index_msb) - 1); in init_intel_cacheinfo()
787 if ((num_cache_leaves == 0 || c->x86 == 15) && c->cpuid_level > 1) { in init_intel_cacheinfo()
794 if (num_cache_leaves != 0 && c->x86 == 15) in init_intel_cacheinfo()
808 /* Byte 0 is level count, not a descriptor */ in init_intel_cacheinfo()
872 * c->phys_proc_id. in init_intel_cacheinfo()
875 per_cpu(cpu_llc_id, cpu) = c->phys_proc_id; in init_intel_cacheinfo()
878 c->x86_cache_size = l3 ? l3 : (l2 ? l2 : (l1i+l1d)); in init_intel_cacheinfo()
892 * For L3, always use the pre-calculated cpu_llc_shared_mask in __cache_amd_cpumap_setup()
898 if (!this_cpu_ci->info_list) in __cache_amd_cpumap_setup()
900 this_leaf = this_cpu_ci->info_list + index; in __cache_amd_cpumap_setup()
905 &this_leaf->shared_cpu_map); in __cache_amd_cpumap_setup()
911 nshared = base->eax.split.num_threads_sharing + 1; in __cache_amd_cpumap_setup()
913 first = apicid - (apicid % nshared); in __cache_amd_cpumap_setup()
914 last = first + nshared - 1; in __cache_amd_cpumap_setup()
918 if (!this_cpu_ci->info_list) in __cache_amd_cpumap_setup()
925 this_leaf = this_cpu_ci->info_list + index; in __cache_amd_cpumap_setup()
932 &this_leaf->shared_cpu_map); in __cache_amd_cpumap_setup()
950 if (c->x86_vendor == X86_VENDOR_AMD || in __cache_cpumap_setup()
951 c->x86_vendor == X86_VENDOR_HYGON) { in __cache_cpumap_setup()
956 this_leaf = this_cpu_ci->info_list + index; in __cache_cpumap_setup()
957 num_threads_sharing = 1 + base->eax.split.num_threads_sharing; in __cache_cpumap_setup()
959 cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map); in __cache_cpumap_setup()
966 if (cpu_data(i).apicid >> index_msb == c->apicid >> index_msb) { in __cache_cpumap_setup()
969 if (i == cpu || !sib_cpu_ci->info_list) in __cache_cpumap_setup()
971 sibling_leaf = sib_cpu_ci->info_list + index; in __cache_cpumap_setup()
972 cpumask_set_cpu(i, &this_leaf->shared_cpu_map); in __cache_cpumap_setup()
973 cpumask_set_cpu(cpu, &sibling_leaf->shared_cpu_map); in __cache_cpumap_setup()
980 this_leaf->id = base->id; in ci_leaf_init()
981 this_leaf->attributes = CACHE_ID; in ci_leaf_init()
982 this_leaf->level = base->eax.split.level; in ci_leaf_init()
983 this_leaf->type = cache_type_map[base->eax.split.type]; in ci_leaf_init()
984 this_leaf->coherency_line_size = in ci_leaf_init()
985 base->ebx.split.coherency_line_size + 1; in ci_leaf_init()
986 this_leaf->ways_of_associativity = in ci_leaf_init()
987 base->ebx.split.ways_of_associativity + 1; in ci_leaf_init()
988 this_leaf->size = base->size; in ci_leaf_init()
989 this_leaf->number_of_sets = base->ecx.split.number_of_sets + 1; in ci_leaf_init()
990 this_leaf->physical_line_partition = in ci_leaf_init()
991 base->ebx.split.physical_line_partition + 1; in ci_leaf_init()
992 this_leaf->priv = base->nb; in ci_leaf_init()
1000 return -ENOENT; in init_cache_level()
1002 return -EINVAL; in init_cache_level()
1003 this_cpu_ci->num_levels = 3; in init_cache_level()
1004 this_cpu_ci->num_leaves = num_cache_leaves; in init_cache_level()
1009 * The max shared threads number comes from CPUID.4:EAX[25-14] with input
1019 num_threads_sharing = 1 + id4_regs->eax.split.num_threads_sharing; in get_cache_id()
1021 id4_regs->id = c->apicid >> index_msb; in get_cache_id()
1028 struct cacheinfo *this_leaf = this_cpu_ci->info_list; in populate_cache_leaves()
1031 for (idx = 0; idx < this_cpu_ci->num_leaves; idx++) { in populate_cache_leaves()
1039 this_cpu_ci->cpu_map_populated = true; in populate_cache_leaves()