• Home
  • Raw
  • Download

Lines Matching +full:ecx +full:- +full:2000

1 // SPDX-License-Identifier: GPL-2.0-only
16 #include <asm/spec-ctrl.h>
19 #include <asm/pci-direct.h>
32 * Refer to Fam15h Models 00-0fh BKDG - CPUID Fn8000_001E_ECX
43 * variable number of family-specific model-stepping ranges created by
54 #define AMD_LEGACY_ERRATUM(...) { -1, __VA_ARGS__, 0 }
107 /* OSVW unavailable or ID unknown, match family-model-stepping range */ in cpu_has_amd_erratum()
108 ms = (cpu->x86_model << 4) | cpu->x86_stepping; in cpu_has_amd_erratum()
110 if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) && in cpu_has_amd_erratum()
157 * and section 2.6.2 of "AMD-K6 Processor Revision Guide - Model 6"
183 #define CBAR (0xfffc) /* Configuration Base Address (32-bit) */ in init_amd_k5()
186 if (c->x86_model == 9 || c->x86_model == 10) { in init_amd_k5()
197 int mbytes = get_num_physpages() >> (20-PAGE_SHIFT); in init_amd_k6()
199 if (c->x86_model < 6) { in init_amd_k6()
200 /* Based on AMD doc 20734R - June 2000 */ in init_amd_k6()
201 if (c->x86_model == 0) { in init_amd_k6()
208 if (c->x86_model == 6 && c->x86_stepping == 1) { in init_amd_k6()
214 pr_info("AMD K6 stepping B detected - "); in init_amd_k6()
225 while (n--) in init_amd_k6()
228 d = d2-d; in init_amd_k6()
237 if (c->x86_model < 8 || in init_amd_k6()
238 (c->x86_model == 8 && c->x86_stepping < 8)) { in init_amd_k6()
257 if ((c->x86_model == 8 && c->x86_stepping > 7) || in init_amd_k6()
258 c->x86_model == 9 || c->x86_model == 13) { in init_amd_k6()
279 if (c->x86_model == 10) { in init_amd_k6()
297 if (c->x86_model >= 6 && c->x86_model <= 10) { in init_amd_k7()
310 if ((c->x86_model == 8 && c->x86_stepping >= 1) || (c->x86_model > 8)) { in init_amd_k7()
320 if (!c->cpu_index) in init_amd_k7()
328 if ((c->x86_model == 6) && ((c->x86_stepping == 0) || in init_amd_k7()
329 (c->x86_stepping == 1))) in init_amd_k7()
333 if ((c->x86_model == 7) && (c->x86_stepping == 0)) in init_amd_k7()
340 * See http://www.heise.de/newsticker/data/jow-18.10.01-000 for in init_amd_k7()
343 if (((c->x86_model == 6) && (c->x86_stepping >= 2)) || in init_amd_k7()
344 ((c->x86_model == 7) && (c->x86_stepping >= 1)) || in init_amd_k7()
345 (c->x86_model > 7)) in init_amd_k7()
352 * Don't taint if we are running SMP kernel on a single non-MP in init_amd_k7()
370 for (i = apicid - 1; i >= 0; i--) { in nearby_node()
385 * Fix up cpu_core_id for pre-F17h systems to be in the
386 * [0 .. cores_per_node - 1] range. Not really needed but
393 if (c->x86 >= 0x17) in legacy_fixup_core_id()
396 cus_per_node = c->x86_max_cores / nodes_per_socket; in legacy_fixup_core_id()
397 c->cpu_core_id %= cus_per_node; in legacy_fixup_core_id()
402 * (1) AMD multi-node processors
410 /* get information required for multi-node processors */ in amd_get_topology()
413 u32 eax, ebx, ecx, edx; in amd_get_topology() local
415 cpuid(0x8000001e, &eax, &ebx, &ecx, &edx); in amd_get_topology()
417 c->cpu_die_id = ecx & 0xff; in amd_get_topology()
419 if (c->x86 == 0x15) in amd_get_topology()
420 c->cu_id = ebx & 0xff; in amd_get_topology()
422 if (c->x86 >= 0x17) { in amd_get_topology()
423 c->cpu_core_id = ebx & 0xff; in amd_get_topology()
426 c->x86_max_cores /= smp_num_siblings; in amd_get_topology()
435 c->x86_coreid_bits = get_count_order(c->x86_max_cores); in amd_get_topology()
443 c->cpu_die_id = value & 7; in amd_get_topology()
445 per_cpu(cpu_llc_id, cpu) = c->cpu_die_id; in amd_get_topology()
464 bits = c->x86_coreid_bits; in amd_detect_cmp()
466 c->cpu_core_id = c->initial_apicid & ((1 << bits)-1); in amd_detect_cmp()
468 c->phys_proc_id = c->initial_apicid >> bits; in amd_detect_cmp()
470 per_cpu(cpu_llc_id, cpu) = c->cpu_die_id = c->phys_proc_id; in amd_detect_cmp()
484 unsigned apicid = c->apicid; in srat_detect_node()
491 * On multi-fabric platform (e.g. Numascale NumaChip) a in srat_detect_node()
492 * platform-specific handler needs to be called to fixup some in srat_detect_node()
502 * - The CPU is missing memory and no node was created. In in srat_detect_node()
505 * - The APIC IDs differ from the HyperTransport node IDs in srat_detect_node()
518 int ht_nodeid = c->initial_apicid; in srat_detect_node()
533 unsigned bits, ecx; in early_init_amd_mc() local
536 if (c->extended_cpuid_level < 0x80000008) in early_init_amd_mc()
539 ecx = cpuid_ecx(0x80000008); in early_init_amd_mc()
541 c->x86_max_cores = (ecx & 0xff) + 1; in early_init_amd_mc()
544 bits = (ecx >> 12) & 0xF; in early_init_amd_mc()
548 while ((1 << bits) < c->x86_max_cores) in early_init_amd_mc()
552 c->x86_coreid_bits = bits; in early_init_amd_mc()
560 if (c->x86 > 0x10 || in bsp_init_amd()
561 (c->x86 == 0x10 && c->x86_model >= 0x2)) { in bsp_init_amd()
570 if (c->x86 == 0x15) { in bsp_init_amd()
578 va_align.mask = (upperbit - 1) & PAGE_MASK; in bsp_init_amd()
589 u32 ecx; in bsp_init_amd() local
591 ecx = cpuid_ecx(0x8000001e); in bsp_init_amd()
592 __max_die_per_package = nodes_per_socket = ((ecx >> 8) & 7) + 1; in bsp_init_amd()
602 c->x86 >= 0x15 && c->x86 <= 0x17) { in bsp_init_amd()
605 switch (c->x86) { in bsp_init_amd()
651 * will be a value above 32-bits this is still done for in early_detect_mem_encrypt()
654 c->x86_phys_bits -= (cpuid_ebx(0x8000001f) >> 6) & 0x3f; in early_detect_mem_encrypt()
683 if (c->x86 >= 0xf) in early_init_amd()
686 rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy); in early_init_amd()
689 * c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate in early_init_amd()
690 * with P/T states and does not stop in deep C-states in early_init_amd()
692 if (c->x86_power & (1 << 8)) { in early_init_amd()
698 if (c->x86_power & BIT(12)) in early_init_amd()
702 if (c->x86_power & BIT(14)) in early_init_amd()
709 if (c->x86 == 5) in early_init_amd()
710 if (c->x86_model == 13 || c->x86_model == 9 || in early_init_amd()
711 (c->x86_model == 8 && c->x86_stepping >= 8)) in early_init_amd()
716 * ApicID can always be treated as an 8-bit value for AMD APIC versions in early_init_amd()
722 if (c->x86 > 0x16) in early_init_amd()
724 else if (c->x86 >= 0xf) { in early_init_amd()
742 /* F16h erratum 793, CVE-2013-6885 */ in early_init_amd()
743 if (c->x86 == 0x16 && c->x86_model <= 0xf) in early_init_amd()
757 /* Re-enable TopologyExtensions if switched off by BIOS */ in early_init_amd()
758 if (c->x86 == 0x15 && in early_init_amd()
759 (c->x86_model >= 0x10 && c->x86_model <= 0x6f) && in early_init_amd()
766 pr_info_once(FW_INFO "CPU: Re-enabling disabled Topology Extensions Support.\n"); in early_init_amd()
775 if (c->x86 == 0x17 && boot_cpu_has(X86_FEATURE_AMD_IBPB)) in early_init_amd()
777 else if (c->x86 >= 0x19 && !wrmsrl_safe(MSR_IA32_PRED_CMD, PRED_CMD_SBPB)) { in early_init_amd()
799 if (c->x86_model < 0x14 && cpu_has(c, X86_FEATURE_LAHF_LM)) { in init_amd_k8()
807 if (!c->x86_model_id[0]) in init_amd_k8()
808 strcpy(c->x86_model_id, "Hammer"); in init_amd_k8()
815 * Errata 63 for SH-B3 steppings in init_amd_k8()
846 * degradation for certain nested-paging guests. Prevent this conversion in init_amd_gh()
872 return -EINVAL; in rdrand_cmdline()
877 return -EINVAL; in rdrand_cmdline()
894 * The self-test can clear X86_FEATURE_RDRAND, so check for in clear_rdrand_cpuid_bit()
933 if ((c->x86_model >= 0x02) && (c->x86_model < 0x20)) { in init_amd_bd()
957 * suppresses non-branch predictions. in init_spectral_chicken()
999 if (c->x86 == 0x19 && !cpu_has(c, X86_FEATURE_BTC_NO)) in init_amd_zn()
1055 if (c->x86 >= 0x10) in init_amd()
1063 c->apicid = read_apic_id(); in init_amd()
1066 if (c->x86 < 6) in init_amd()
1069 switch (c->x86) { in init_amd()
1087 if ((c->x86 >= 6) && (!cpu_has(c, X86_FEATURE_XSAVEERPTR))) in init_amd()
1116 if (c->x86 > 0x11) in init_amd()
1140 * Make sure EFER[AIBRSE - Automatic IBRS Enable] is set. The APs are brought up in init_amd()
1169 if (c->x86 == 6) { in amd_size_cache()
1171 if (c->x86_model == 3 && c->x86_stepping == 0) in amd_size_cache()
1174 if (c->x86_model == 4 && in amd_size_cache()
1175 (c->x86_stepping == 0 || c->x86_stepping == 1)) in amd_size_cache()
1184 u32 ebx, eax, ecx, edx; in cpu_detect_tlb_amd() local
1187 if (c->x86 < 0xf) in cpu_detect_tlb_amd()
1190 if (c->extended_cpuid_level < 0x80000006) in cpu_detect_tlb_amd()
1193 cpuid(0x80000006, &eax, &ebx, &ecx, &edx); in cpu_detect_tlb_amd()
1202 if (c->x86 == 0xf) { in cpu_detect_tlb_amd()
1203 cpuid(0x80000005, &eax, &ebx, &ecx, &edx); in cpu_detect_tlb_amd()
1219 if (c->x86 == 0x15 && c->x86_model <= 0x1f) { in cpu_detect_tlb_amd()
1222 cpuid(0x80000005, &eax, &ebx, &ecx, &edx); in cpu_detect_tlb_amd()
1239 [7] = "486 DX/2-WB",
1241 [9] = "486 DX/4-WB",
1242 [14] = "Am5x86-WT",
1243 [15] = "Am5x86-WB"
1300 if (c->x86 == 0x17 && ((c->x86_model >= 0x30 && c->x86_model < 0x40) || in amd_get_highest_perf()
1301 (c->x86_model >= 0x70 && c->x86_model < 0x80))) in amd_get_highest_perf()
1304 if (c->x86 == 0x19 && ((c->x86_model >= 0x20 && c->x86_model < 0x30) || in amd_get_highest_perf()
1305 (c->x86_model >= 0x40 && c->x86_model < 0x70))) in amd_get_highest_perf()