/linux-6.14.4/tools/testing/selftests/kvm/x86/ |
D | cpuid_test.c | 5 * Generic tests for KVM CPUID set/get ioctls 73 * CPUID.0xD.{0,1}.EBX enumerate XSAVE size based on the current in get_const_cpuid_mask() 90 "CPUID nent mismatch: %d vs. %d", cpuid1->nent, cpuid2->nent); in compare_cpuids() 100 "CPUID entries[%d] mismtach: 0x%x.%d.%x vs. 0x%x.%d.%x", in compare_cpuids() 111 "CPUID 0x%x.%x differ: 0x%x:0x%x:0x%x:0x%x vs 0x%x:0x%x:0x%x:0x%x", in compare_cpuids() 143 struct kvm_cpuid2 *vcpu_alloc_cpuid(struct kvm_vm *vm, vm_vaddr_t *p_gva, struct kvm_cpuid2 *cpuid) in vcpu_alloc_cpuid() argument 145 int size = sizeof(*cpuid) + cpuid->nent * sizeof(cpuid->entries[0]); in vcpu_alloc_cpuid() 149 memcpy(guest_cpuids, cpuid, size); in vcpu_alloc_cpuid() 161 /* Setting unmodified CPUID is allowed */ in set_cpuid_after_run() 163 TEST_ASSERT(!rc, "Setting unmodified CPUID after KVM_RUN failed: %d", rc); in set_cpuid_after_run() [all …]
|
/linux-6.14.4/arch/riscv/kernel/ |
D | smpboot.c | 46 int cpuid; in smp_prepare_cpus() local 60 for_each_possible_cpu(cpuid) { in smp_prepare_cpus() 61 if (cpuid == curr_cpuid) in smp_prepare_cpus() 63 set_cpu_present(cpuid, true); in smp_prepare_cpus() 64 numa_store_cpu_info(cpuid); in smp_prepare_cpus() 126 int cpuid = 1; in of_parse_and_init_cpus() local 140 if (cpuid >= NR_CPUS) { in of_parse_and_init_cpus() 141 pr_warn("Invalid cpuid [%d] for hartid [%lu]\n", in of_parse_and_init_cpus() 142 cpuid, hart); in of_parse_and_init_cpus() 146 cpuid_to_hartid_map(cpuid) = hart; in of_parse_and_init_cpus() [all …]
|
/linux-6.14.4/arch/sparc/kernel/ |
D | prom_64.c | 389 * 'portid', or 'cpuid' property. in arch_find_n_match_cpu_physical_id() 406 mid_prop = "cpuid"; in arch_find_n_match_cpu_physical_id() 441 int cpuid = of_getintprop_default(dp, mid_prop, -1); in of_iterate_over_cpus() local 445 if (cpuid < 0) { in of_iterate_over_cpus() 446 this_mid_prop = "cpuid"; in of_iterate_over_cpus() 447 cpuid = of_getintprop_default(dp, this_mid_prop, -1); in of_iterate_over_cpus() 449 if (cpuid < 0) { in of_iterate_over_cpus() 455 if (cpuid >= NR_CPUS) { in of_iterate_over_cpus() 458 cpuid, NR_CPUS); in of_iterate_over_cpus() 462 ret = func(dp, cpuid, arg); in of_iterate_over_cpus() [all …]
|
D | sun4d_smp.c | 45 static inline void show_leds(int cpuid) in show_leds() argument 47 cpuid &= 0x1e; in show_leds() 49 "r" ((cpu_leds[cpuid] << 4) | cpu_leds[cpuid+1]), in show_leds() 50 "r" (ECSR_BASE(cpuid) | BB_LEDS), in show_leds() 56 int cpuid = hard_smp_processor_id(); in sun4d_cpu_pre_starting() local 59 cpu_leds[cpuid] = 0x6; in sun4d_cpu_pre_starting() 60 show_leds(cpuid); in sun4d_cpu_pre_starting() 69 int cpuid; in sun4d_cpu_pre_online() local 71 cpuid = hard_smp_processor_id(); in sun4d_cpu_pre_online() 78 sun4d_swap((unsigned long *)&cpu_callin_map[cpuid], 1); in sun4d_cpu_pre_online() [all …]
|
D | irq_64.c | 313 static unsigned int sun4u_compute_tid(unsigned long imap, unsigned long cpuid) in sun4u_compute_tid() argument 318 tid = starfire_translate(imap, cpuid); in sun4u_compute_tid() 328 tid = cpuid << IMAP_TID_SHIFT; in sun4u_compute_tid() 331 unsigned int a = cpuid & 0x1f; in sun4u_compute_tid() 332 unsigned int n = (cpuid >> 5) & 0x1f; in sun4u_compute_tid() 340 tid = cpuid << IMAP_TID_SHIFT; in sun4u_compute_tid() 351 int cpuid; in irq_choose_cpu() local 354 cpuid = map_to_cpu(irq); in irq_choose_cpu() 356 cpuid = cpumask_first_and(affinity, cpu_online_mask); in irq_choose_cpu() 357 cpuid = cpuid < nr_cpu_ids ? cpuid : map_to_cpu(irq); in irq_choose_cpu() [all …]
|
D | sun4d_irq.c | 33 unsigned int cpuid; /* target cpu */ member 195 int cpuid = handler_data->cpuid; in sun4d_mask_irq() local 201 cc_set_imsk_other(cpuid, cc_get_imsk_other(cpuid) | (1 << real_irq)); in sun4d_mask_irq() 213 int cpuid = handler_data->cpuid; in sun4d_unmask_irq() local 220 cc_set_imsk_other(cpuid, cc_get_imsk_other(cpuid) & ~(1 << real_irq)); in sun4d_unmask_irq() 254 int cpuid = cpu_logical_map(1); in sun4d_distribute_irqs() local 256 if (cpuid == -1) in sun4d_distribute_irqs() 257 cpuid = cpu_logical_map(0); in sun4d_distribute_irqs() 261 board_to_cpu[board] = cpuid; in sun4d_distribute_irqs() 262 set_sbi_tid(devid, cpuid << 3); in sun4d_distribute_irqs() [all …]
|
/linux-6.14.4/lib/zstd/common/ |
D | cpu.h | 15 * Implementation taken from folly/CpuId.h 16 * https://github.com/facebook/folly/blob/master/folly/CpuId.h 35 /* The following block like the normal cpuid branch below, but gcc in ZSTD_cpuid() 42 "cpuid\n\t" in ZSTD_cpuid() 51 "cpuid\n\t" in ZSTD_cpuid() 59 "cpuid\n\t" in ZSTD_cpuid() 68 __asm__("cpuid" : "=a"(n) : "a"(0) : "ebx", "ecx", "edx"); in ZSTD_cpuid() 71 __asm__("cpuid" : "=a"(f1a), "=c"(f1c), "=d"(f1d) : "a"(1) : "ebx"); in ZSTD_cpuid() 75 __asm__("cpuid" in ZSTD_cpuid() 82 ZSTD_cpuid_t cpuid; in ZSTD_cpuid() local [all …]
|
/linux-6.14.4/arch/parisc/kernel/ |
D | topology.c | 28 void store_cpu_topology(unsigned int cpuid) in store_cpu_topology() argument 30 struct cpu_topology *cpuid_topo = &cpu_topology[cpuid]; in store_cpu_topology() 40 per_cpu(cpu_devices, cpuid).hotpluggable = 1; in store_cpu_topology() 42 if (register_cpu(&per_cpu(cpu_devices, cpuid), cpuid)) in store_cpu_topology() 43 pr_warn("Failed to register CPU%d device", cpuid); in store_cpu_topology() 49 p = &per_cpu(cpu_data, cpuid); in store_cpu_topology() 53 if (cpu == cpuid) /* ignore current cpu */ in store_cpu_topology() 72 update_siblings_masks(cpuid); in store_cpu_topology() 75 cpuid, in store_cpu_topology() 76 cpu_topology[cpuid].core_id, in store_cpu_topology() [all …]
|
D | processor.c | 84 unsigned long cpuid; in processor_probe() local 103 cpuid = boot_cpu_data.cpu_count; in processor_probe() 105 cpu_info.cpu_num = cpu_info.cpu_loc = cpuid; in processor_probe() 136 cpuid, cpu_info.cpu_num, cpu_info.cpu_loc, in processor_probe() 141 /* We need contiguous numbers for cpuid. Firmware's notion in processor_probe() 142 * of cpuid is for physical CPUs and we just don't care yet. in processor_probe() 155 cpuid = cpu_info.cpu_num; in processor_probe() 161 p = &per_cpu(cpu_data, cpuid); in processor_probe() 165 if (cpuid) in processor_probe() 170 p->cpuid = cpuid; /* save CPU id */ in processor_probe() [all …]
|
/linux-6.14.4/arch/x86/boot/compressed/ |
D | mem_encrypt.S | 23 movl $0x80000000, %eax /* CPUID to check the highest leaf */ 24 cpuid 30 * CPUID Fn8000_001F[EAX] - Bit 1 31 * CPUID Fn8000_001F[EBX] - Bits 5:0 35 cpuid 57 * sev_es_req_cpuid - Request a CPUID value from the Hypervisor using 61 * @%edx: CPUID Function 64 * %edx returns CPUID value on success 99 /* Keep CPUID function in %ebx */ 106 movl $0, %eax # Request CPUID[fn].EAX [all …]
|
/linux-6.14.4/include/soc/tegra/ |
D | flowctrl.h | 44 u32 flowctrl_read_cpu_csr(unsigned int cpuid); 45 void flowctrl_write_cpu_csr(unsigned int cpuid, u32 value); 46 void flowctrl_write_cpu_halt(unsigned int cpuid, u32 value); 48 void flowctrl_cpu_suspend_enter(unsigned int cpuid); 49 void flowctrl_cpu_suspend_exit(unsigned int cpuid); 51 static inline u32 flowctrl_read_cpu_csr(unsigned int cpuid) in flowctrl_read_cpu_csr() argument 56 static inline void flowctrl_write_cpu_csr(unsigned int cpuid, u32 value) in flowctrl_write_cpu_csr() argument 60 static inline void flowctrl_write_cpu_halt(unsigned int cpuid, u32 value) {} in flowctrl_write_cpu_halt() argument 62 static inline void flowctrl_cpu_suspend_enter(unsigned int cpuid) in flowctrl_cpu_suspend_enter() argument 66 static inline void flowctrl_cpu_suspend_exit(unsigned int cpuid) in flowctrl_cpu_suspend_exit() argument
|
/linux-6.14.4/drivers/soc/tegra/ |
D | flowctrl.c | 51 u32 flowctrl_read_cpu_csr(unsigned int cpuid) in flowctrl_read_cpu_csr() argument 53 u8 offset = flowctrl_offset_cpu_csr[cpuid]; in flowctrl_read_cpu_csr() 62 void flowctrl_write_cpu_csr(unsigned int cpuid, u32 value) in flowctrl_write_cpu_csr() argument 64 return flowctrl_update(flowctrl_offset_cpu_csr[cpuid], value); in flowctrl_write_cpu_csr() 67 void flowctrl_write_cpu_halt(unsigned int cpuid, u32 value) in flowctrl_write_cpu_halt() argument 69 return flowctrl_update(flowctrl_offset_halt_cpu[cpuid], value); in flowctrl_write_cpu_halt() 72 void flowctrl_cpu_suspend_enter(unsigned int cpuid) in flowctrl_cpu_suspend_enter() argument 77 reg = flowctrl_read_cpu_csr(cpuid); in flowctrl_cpu_suspend_enter() 85 reg |= TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 << cpuid; in flowctrl_cpu_suspend_enter() 106 reg |= TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 << cpuid; in flowctrl_cpu_suspend_enter() [all …]
|
/linux-6.14.4/tools/perf/arch/loongarch/util/ |
D | header.c | 46 char *line, *model, *cpuid; in _get_cpuid() local 53 line = model = cpuid = NULL; in _get_cpuid() 64 if (model && (asprintf(&cpuid, "%s", model) < 0)) in _get_cpuid() 65 cpuid = NULL; in _get_cpuid() 70 return cpuid; in _get_cpuid() 76 char *cpuid = _get_cpuid(); in get_cpuid() local 78 if (!cpuid) in get_cpuid() 81 if (sz < strlen(cpuid)) { in get_cpuid() 86 scnprintf(buffer, sz, "%s", cpuid); in get_cpuid() 89 free(cpuid); in get_cpuid()
|
/linux-6.14.4/arch/x86/kvm/ |
D | cpuid.c | 4 * cpuid support routines 24 #include <asm/cpuid.h> 25 #include "cpuid.h" 86 * Magic value used by KVM when querying userspace-provided CPUID entries and 90 * to avoid false positives when processing guest CPUID input. 101 * KVM has a semi-arbitrary rule that querying the guest's CPUID model in cpuid_entry2_find() 102 * with IRQs disabled is disallowed. The CPUID model can legitimately in cpuid_entry2_find() 108 * of the hotpath, e.g. by caching information during CPUID updates. in cpuid_entry2_find() 129 * lookup (as opposed to emulating CPUID) for a function that's in cpuid_entry2_find() 200 /* Check whether the supplied CPUID data is equal to what is already set for the vCPU. */ [all …]
|
D | cpuid.h | 19 int kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid, 23 struct kvm_cpuid *cpuid, 26 struct kvm_cpuid2 *cpuid, 29 struct kvm_cpuid2 *cpuid, 73 const struct cpuid_reg cpuid = x86_feature_cpuid(x86_feature); in guest_cpuid_has() local 85 * honor userspace's CPUID), KVM needs to check the raw guest CPUID, in guest_cpuid_has() 93 entry = kvm_find_cpuid_entry_index(vcpu, cpuid.function, cpuid.index); in guest_cpuid_has() 97 reg = __cpuid_entry_get_reg(entry, cpuid.reg); in guest_cpuid_has()
|
D | reverse_cpuid.h | 23 /* Intel-defined SGX sub-features, CPUID level 0x12 (EAX). */ 28 /* Intel-defined sub-features, CPUID level 0x00000007:1 (EDX) */ 36 /* Intel-defined sub-features, CPUID level 0x00000007:2 (EDX) */ 44 /* Intel-defined sub-features, CPUID level 0x00000024:0 (EBX) */ 49 /* CPUID level 0x80000007 (EDX). */ 52 /* CPUID level 0x80000022 (EAX) */ 88 * Reverse CPUID and its derivatives can only be used for hardware-defined 89 * feature words, i.e. words whose bits directly correspond to a CPUID leaf. 90 * Retrieving a feature bit or masking guest CPUID from a Linux-defined word 181 const struct cpuid_reg cpuid = x86_feature_cpuid(x86_feature); in cpuid_entry_get_reg() local [all …]
|
/linux-6.14.4/arch/x86/kernel/ |
D | verify_cpu.S | 40 pushfl # standard way to check for cpuid 49 jz .Lverify_cpu_no_longmode # cpu has no cpuid 52 movl $0x0,%eax # See if cpuid 1 is implemented 53 cpuid 55 jb .Lverify_cpu_no_longmode # no cpuid 1 78 cpuid 101 cpuid 106 movl $0x80000000,%eax # See if extended cpuid is implemented 107 cpuid 109 jb .Lverify_cpu_no_longmode # no extended cpuid [all …]
|
D | cpuid.c | 9 * x86 CPUID access device 11 * This device is accessed by lseek() to the appropriate CPUID level 19 * This driver uses /dev/cpu/%d/cpuid where %d is the minor number, and on 111 return -EIO; /* CPUID not supported */ in cpuid_open() 128 return kasprintf(GFP_KERNEL, "cpu/%u/cpuid", MINOR(dev->devt)); in cpuid_devnode() 132 .name = "cpuid", 156 "cpu/cpuid", &cpuid_fops)) { in cpuid_init() 157 printk(KERN_ERR "cpuid: unable to get major %d for cpuid\n", in cpuid_init() 165 err = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "x86/cpuid:online", in cpuid_init() 176 __unregister_chrdev(CPUID_MAJOR, 0, NR_CPUS, "cpu/cpuid"); in cpuid_init() [all …]
|
/linux-6.14.4/arch/alpha/kernel/ |
D | smp.c | 69 /* Set to a secondary's cpuid when it comes online. */ 81 smp_store_cpu_info(int cpuid) in smp_store_cpu_info() argument 83 cpu_data[cpuid].loops_per_jiffy = loops_per_jiffy; in smp_store_cpu_info() 84 cpu_data[cpuid].last_asn = ASN_FIRST_VERSION; in smp_store_cpu_info() 85 cpu_data[cpuid].need_new_asn = 0; in smp_store_cpu_info() 86 cpu_data[cpuid].asn_lock = 0; in smp_store_cpu_info() 93 smp_setup_percpu_timer(int cpuid) in smp_setup_percpu_timer() argument 95 cpu_data[cpuid].prof_counter = 1; in smp_setup_percpu_timer() 96 cpu_data[cpuid].prof_multiplier = 1; in smp_setup_percpu_timer() 100 wait_boot_cpu_to_stop(int cpuid) in wait_boot_cpu_to_stop() argument [all …]
|
/linux-6.14.4/tools/testing/selftests/kvm/lib/x86/ |
D | hyperv.c | 13 static struct kvm_cpuid2 *cpuid; in kvm_get_supported_hv_cpuid() local 16 if (cpuid) in kvm_get_supported_hv_cpuid() 17 return cpuid; in kvm_get_supported_hv_cpuid() 19 cpuid = allocate_kvm_cpuid2(MAX_NR_CPUID_ENTRIES); in kvm_get_supported_hv_cpuid() 22 kvm_ioctl(kvm_fd, KVM_GET_SUPPORTED_HV_CPUID, cpuid); in kvm_get_supported_hv_cpuid() 25 return cpuid; in kvm_get_supported_hv_cpuid() 44 /* Need to skip KVM CPUID leaves 0x400000xx */ in vcpu_set_hv_cpuid() 63 struct kvm_cpuid2 *cpuid = allocate_kvm_cpuid2(MAX_NR_CPUID_ENTRIES); in vcpu_get_supported_hv_cpuid() local 65 vcpu_ioctl(vcpu, KVM_GET_SUPPORTED_HV_CPUID, cpuid); in vcpu_get_supported_hv_cpuid() 67 return cpuid; in vcpu_get_supported_hv_cpuid()
|
/linux-6.14.4/tools/perf/arch/riscv/util/ |
D | header.c | 42 char *cpuid = NULL; in _get_cpuid() local 49 return cpuid; in _get_cpuid() 72 if (asprintf(&cpuid, "%s-%s-%s", mvendorid, marchid, mimpid) < 0) in _get_cpuid() 73 cpuid = NULL; in _get_cpuid() 81 return cpuid; in _get_cpuid() 86 char *cpuid = _get_cpuid(); in get_cpuid() local 89 if (sz < strlen(cpuid)) { in get_cpuid() 94 scnprintf(buffer, sz, "%s", cpuid); in get_cpuid() 96 free(cpuid); in get_cpuid()
|
/linux-6.14.4/arch/x86/include/asm/ |
D | cpuid.h | 3 * CPUID-related helpers/definitions 43 asm volatile("cpuid" in native_cpuid() 63 * Native CPUID functions returning a single datum. 77 * Generic CPUID function in native_cpuid_reg() 81 static inline void cpuid(unsigned int op, in native_cpuid_reg() 90 /* Some CPUID calls want 'count' to be placed in ecx */ 101 * CPUID functions returning a single datum 107 cpuid(op, &eax, &ebx, &ecx, &edx); in cpuid_eax() 116 cpuid(op, &eax, &ebx, &ecx, &edx); in cpuid_ebx() 125 cpuid(op, &eax, &ebx, &ecx, &edx); in cpuid_ecx() [all …]
|
/linux-6.14.4/arch/x86/kernel/cpu/ |
D | tsx.c | 33 * Ensure TSX support is not enumerated in CPUID. in tsx_disable() 53 * Ensure TSX support is enumerated in CPUID. in tsx_enable() 73 * First of all, there's a CPUID bit: X86_FEATURE_RTM_ALWAYS_ABORT 81 * the MSR is present only when *two* CPUID bits are set: 89 * CPUID bit X86_FEATURE_RTM_ALWAYS_ABORT set and for those the same strategy 96 * which, when done, may cause for the X86_FEATURE_RTM_ALWAYS_ABORT CPUID 100 * cause for the supported CPUID feature bits to get re-detected and, if 103 * short: the kernel doesn't modify CPUID feature bits after booting. 113 * MSR_TFA_TSX_CPUID_CLEAR bit is only present when both CPUID in tsx_clear_cpuid() 166 * Hardware will always abort a TSX transaction when the CPUID bit in tsx_init() [all …]
|
/linux-6.14.4/tools/perf/arch/x86/util/ |
D | header.c | 12 #include "cpuid.h" 18 cpuid(0, 0, lvl, &b, &c, &d); in get_cpuid_0() 36 cpuid(1, 0, &a, &b, &c, &d); in __get_cpuid() 77 /* Full CPUID format for x86 is vendor-family-model-stepping */ 103 * Full CPUID format is required to identify a platform. in strcmp_cpuid_str() 104 * Error out if the cpuid string is incomplete. in strcmp_cpuid_str() 107 pr_info("Invalid CPUID %s. Full CPUID is required, " in strcmp_cpuid_str() 124 /* If the full CPUID format isn't required, in strcmp_cpuid_str()
|
/linux-6.14.4/Documentation/arch/x86/ |
D | cpuinfo.rst | 19 CPUID to find out what the target machine supports and what not. 23 said CPU supports CPUID faulting - userspace can simply probe for the 32 kernel has *enabled* and *supports*. As in: the CPUID feature flag is 64 tools/arch/x86/kcpuid and cpuid(1). 73 unlikely. KVM can synthesize the CPUID bit and the KVM guest can simply 74 query CPUID and figure out what the hypervisor supports and what not. As 82 a: Feature flags can be derived from the contents of CPUID leaves. 84 These feature definitions are organized mirroring the layout of CPUID 92 b: Flags can be from scattered CPUID-based features. 94 Hardware features enumerated in sparsely populated CPUID leaves get [all …]
|